Cannot read using USB Skeleton Driver

Greg KH greg at kroah.com
Mon Sep 19 09:46:49 EDT 2011


On Mon, Sep 19, 2011 at 06:51:18PM +0530, Felix Varghese wrote:
> Oh I don't think I have customized it to the point of breaking it. I
> just modified the VID and PID to those of my device. And later, when I
> noticed where it was getting stuck, I changed the wait_for_completion
> to wait_for_completion_interruptible (in the code snippet quoted
> previously) so that I could recover with Ctrl-C instead of a reboot.
> And my hardware works fine with the usbserial driver you suggested (I
> can read/write to it from a simple terminal program). But, to develop
> a full-fledged driver, the skeleton driver seemed like a better
> starting point, which is I am still trying to get it working.
> 
> The condition which causes the code to wait for eternity (from the
> line I quoted in one of my previous mails) seems to be: if
> (!dev->processed_urb)
> But I notice that this variable is not true even for the first read.
> So the code seems to wait for the completion of something that has not
> yet started. Also, I do not see this variable being explicitly set to
> false either, anywhere within the driver. I may be on the wrong track,
> but isn't this variable one that is used only within our driver? If
> so, what exactly is it used for, considering that it is only set to 1
> (never to 0) and is 0 initially?

You might be right and the code might be wrong, care to send a patch for
it correcting the issue?

thanks,

greg k-h



More information about the Kernelnewbies mailing list