On Mon, 2010-02-08 at 10:43 +0100, Oliver Neukum wrote: > Am Sonntag, 7. Februar 2010 20:39:05 schrieb Mark Ellis: > > > This patch seems to be very effective, but as I mentioned, none of us > > are really device side developers, and John was never completely > > convinced this was correct. Quoting him from a while back.... > > > > "The reason I consider it dirty is that it needs the > > rndis_get_in_endpoint function which is called every time something > > calls rndis_command. > > > > Ideally that should run once when the driver loads for a given device, > > but i felt like i was being too invasive when I started doing that and > > whimped out. > > No problem, we can do that. > > > The patch exists through careful comparison of the deprecated user > > mode and the current kernel mode implementations of usb-rndis, the > > poking of an INT IN endpoint being the only difference I found." > > It would be nice if we knew why it works. If not, we need a comment > to that effect. > > > So we think we are on the right lines, but perhaps not fixing the > > problem in the correct way. It would be great if someone could take a > > look at this, and either say it's fine for submission, or point us in a > > more appropriate direction. > > [..] > > > + char int_buf[128]; > > [..] > > + retval = usb_interrupt_msg(dev->udev, > > + pipe, > > + int_buf, > > + (maxp > 8 ? 8 : maxp), > > + &partial, > > + RNDIS_CONTROL_TIMEOUT_MS); > > This means doing DMA on the stack. int_buf needs to be allocated with kmalloc() > preferably during probe(). > Ok, that makes sense. > Can you comment on why this patch is needed? If that is clear, either you can > clear up the issues I mentioned, or I can do so if you prefer. > Specifically, I can't say, why it works. We first tried it for devices with Samsung processors, but since then it has become our general fix if rndis_host gives something like the following. [ 246.753730] usb 1-1.3: new full speed USB device using uhci_hcd and address 4 [ 246.887677] usb 1-1.3: configuration #1 chosen from 1 choice [ 247.518396] usbcore: registered new interface driver cdc_ether [ 269.730612] rndis_host 1-1.3:1.0: RNDIS init failed, -110 [ 271.310247] rndis_host: probe of 1-1.3:1.0 failed with error -110 [ 271.310310] usbcore: registered new interface driver rndis_host Mark
Attachment:
signature.asc
Description: This is a digitally signed message part