WhyCan Forum

人过留名,雁过留声,感谢各位朋友不离不弃地支持。 QQ: 516333132 (挖坑网/填坑网) admin@whycan.cn

您尚未登录。

#1 2019-09-19 23:23:47

firstman
会员
注册时间: 2019-04-06
累计积分: 177

V3s Linux4.13执行modprobe g_webcam 出现端点错误, 是端点不够吗? 其他的 g_serial/g_ffs没问题

# modprobe g_webcam
[   13.884493] g_webcam gadget: uvc: uvc_function_bind()
[   13.889574] g_webcam gadget: uvc: Unable to allocate streaming EP
[   13.895850] g_webcam musb-hdrc.1.auto: failed to start g_webcam: -22
[   13.905209] g_webcam gadget: uvc: uvc_function_bind()
[   13.910284] g_webcam gadget: uvc: Unable to allocate streaming EP
[   13.916566] g_webcam musb-hdrc.1.auto: failed to start g_webcam: -22
modprobe: can't load module g_webcam (kernel/drivers/usb/gadget/legacy/g_webcam.ko): Invalid argument

发现 HI3518 也有一模一样的问题 http://bbs.ebaina.com/thread-39433-1-1.html

离线

#2 2019-09-19 23:28:37

firstman
会员
注册时间: 2019-04-06
累计积分: 177

Re: V3s Linux4.13执行modprobe g_webcam 出现端点错误, 是端点不够吗? 其他的 g_serial/g_ffs没问题

https://devtalk.nvidia.com/default/topic/1036885/tx1-usb-uvc-gadget-troubles/

问题:
TX1的OTG端口是否支持等时模式?
是否有不同的方法来配置系统以解决此错误?
我可以提供其他日志/信息,以便更容易调试吗?

在设备模式下,OTG端口不支持等时模式。

看来有点悲剧了

离线

#3 2019-09-19 23:35:07

firstman
会员
注册时间: 2019-04-06
累计积分: 177

Re: V3s Linux4.13执行modprobe g_webcam 出现端点错误, 是端点不够吗? 其他的 g_serial/g_ffs没问题

不知道这个补丁有没有用哦: https://gitlab-beta.engr.illinois.edu/ejclark2/linux/commit/f82a689faeb328ba7c194782f42cc438519d508e

		musb_writew(hw_ep->regs, MUSB_RXCSR, val);

#ifdef CONFIG_USB_INVENTRA_DMA
		if (usb_pipeisoc(pipe)) {
			struct usb_iso_packet_descriptor *d;

			d = urb->iso_frame_desc + qh->iso_idx;
			d->actual_length = xfer_len;

			/* even if there was an error, we did the dma
			 * for iso_frame_desc->length
			 */
			if (d->status != EILSEQ && d->status != -EOVERFLOW)
				d->status = 0;

			if (++qh->iso_idx >= urb->number_of_packets)
				done = true;
			else
				done = false;

		} else  {
		/* done if urb buffer is full or short packet is recd */
		done = (urb->actual_length + xfer_len >=
				urb->transfer_buffer_length
			|| dma->actual_len < qh->maxpacket);
		}

		/* send IN token for next packet, without AUTOREQ */
		if (!done) {
		if (dma) {
			struct dma_controller	*c;
			u16			rx_count;
			int			ret;
			int			ret, length;
			dma_addr_t		buf;

			rx_count = musb_readw(epio, MUSB_RXCOUNT);


			c = musb->dma_controller;

			if (usb_pipeisoc(pipe)) {
				int status = 0;
				struct usb_iso_packet_descriptor *d;

				d = urb->iso_frame_desc + qh->iso_idx;

				if (iso_err) {
					status = -EILSEQ;
					urb->error_count++;
				}
				if (rx_count > d->length) {
					if (status == 0) {
						status = -EOVERFLOW;
						urb->error_count++;
					}
					DBG(2, "** OVERFLOW %d into %d\n",\
					    rx_count, d->length);

					length = d->length;
				} else
					length = rx_count;
				d->status = status;
				buf = urb->transfer_dma + d->offset;
			} else {
				length = rx_count;
				buf = urb->transfer_dma +
						urb->actual_length;
			}

			dma->desired_mode = 0;
#ifdef USE_MODE1
			/* because of the issue below, mode 1 will
						urb->actual_length)
					> qh->maxpacket)
				dma->desired_mode = 1;
			if (rx_count < hw_ep->max_packet_sz_rx) {
				length = rx_count;
				dma->bDesiredMode = 0;
			} else {
				length = urb->transfer_buffer_length;
			}
#endif

/* Disadvantage of using mode 1:
			 */
			ret = c->channel_program(
				dma, qh->maxpacket,
				dma->desired_mode,
				urb->transfer_dma
					+ urb->actual_length,
				(dma->desired_mode == 0)
					? rx_count
					: urb->transfer_buffer_length);
				dma->desired_mode, buf, length);

			if (!ret) {
				c->channel_release(dma);
		}
	}

	if (dma && usb_pipeisoc(pipe)) {
		struct usb_iso_packet_descriptor	*d;
		int					iso_stat = status;

		d = urb->iso_frame_desc + qh->iso_idx;
		d->actual_length += xfer_len;
		if (iso_err) {
			iso_stat = -EILSEQ;
			urb->error_count++;
		}
		d->status = iso_stat;
	}

finish:
	urb->actual_length += xfer_len;
	qh->offset += xfer_len;

离线

#4 2019-09-19 23:36:15

firstman
会员
注册时间: 2019-04-06
累计积分: 177

Re: V3s Linux4.13执行modprobe g_webcam 出现端点错误, 是端点不够吗? 其他的 g_serial/g_ffs没问题

https://linux-sunxi.org/USB_OTG_Controller_Register_Guide

Supports up to 5 user configurable endpoints for bulk, isochronous, control, and interrupt bi-directional transfers

离线

#5 2019-09-20 08:59:57

firstman
会员
注册时间: 2019-04-06
累计积分: 177

Re: V3s Linux4.13执行modprobe g_webcam 出现端点错误, 是端点不够吗? 其他的 g_serial/g_ffs没问题

http://davinci-linux-open-source.1494791.n2.nabble.com/DM365-uvc-gadget-td5992168.html

对USB协议没有研究, 这个问题太难了,等大神帮我填坑,或者以后再说吧

离线

页脚