Re: Oops in CDC ACM after an Openmoko phone (neo1973) changes its usb interface from ACM to Ethernet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 4 Aug 2009, Oliver Neukum wrote:

> Am Dienstag, 4. August 2009 00:04:57 schrieb Alan Stern:
> > On Mon, 3 Aug 2009, Oliver Neukum wrote:
> > > Am Montag, 3. August 2009 23:11:07 schrieb Alan Stern:
> > > > The tasklet races with disconnection anyway.  Why add a bunch of
> > > > special code in this one spot?
> > >
> > > The alternative is to cache the pointer. I don't like making unnecessary
> > > copies. It is safe with respect to disconnect as disconnect sets a flag.
> > > Which solution would you suggest?
> >
> > Caching the pointer would make the routine behave just like it used to
> > before the possibility of using an interrupt endpoint was added.  That
> > seems safest.
> 
> But it would break the devices for which that possibility was added.

I wasn't clear.  Add a new field, acm->rx_endpoint_desc of type
"pointer to struct usb_endpoint_descriptor", and during initialization
assign

	acm->rx_endpoint_desc = epread;

Then in acm_rx_tasklet replace each occurrence of &ep->desc with 
acm->rx_endpoint_desc and remove the assignment to ep.  The ability to 
use either bulk or interrupt endpoints is thus retained.

Not only will this fix the problem, it also gives a net shrinkage of
code (a complicated assignment is replaced by a simple assignment).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux