On Tue, Feb 18, 2003 at 12:49:43PM -0500, Johannes Erdfelt wrote:
> On Tue, Feb 18, 2003, Greg KH <[EMAIL PROTECTED]> wrote:
> > On Tue, Feb 18, 2003 at 12:24:49PM -0500, Johannes Erdfelt wrote:
> > > On Tue, Feb 18, 2003, Greg KH <[EMAIL PROTECTED]> wrote:
> > > > On Tue, Feb 18, 2003 at 08:59:15AM -0800, David Brownell wrote:
> > > > > Not supposed to happen ... when they call giveback(), that's supposed to
> > > > > mean they've forgotten about that URB.  Is it buggy disconnect() logic,
> > > > > or some HCD calling giveback too early?
> > > > 
> > > > I'm seeing uhci_irq() get called for an urb that belongs to a usb device
> > > > that has already been disconnected.  Things go wrong when
> > > > uhci_transfer_result() is called, which calls usb_release_bandwidth()
> > > > which expects dev->bus to be a valid pointer.  I thought that after
> > > > deallocate() is called on the bus for the device, everything would be
> > > > cleaned up.
> > > 
> > > This is a reference counting problem.
> > > 
> > > In 2.4, uhci.c holds a reference to the device until after it's done
> > > calling the completion handler.
> > > 
> > > Now in 2.5, the hcd layer doesn't hold that reference anymore it seems.
> > > 
> > > That should be fixed.
> > 
> > Hm, well in my patch, I'm making the assumption that after deallocate()
> > the device is really gone, is that true?  The hcd can still hold a
> > reference to the device, if it needs it, that's a valid thing to do.
> > What does the hcd use to tell if the dev is really present or not?
> > That's what I'm after.
> 
> I don't think setting dev->bus to NULL is the right way, simply because
> the bandwidth is not available to the rest of the system until all of
> the URBs have been fully removed. To handle the bandwidth correctly, we
> need that pointer to the end.

Ok, good point, I put back the "present" flag and everything works much
better now.  I'll not mess with the bus pointer anymore.

> Also, deallocate() needs to be called when there are no more URBs for
> the OHCI driver to work (atleast in 2.4, I'm assuming the 2.5 driver has
> similar requirements)
> 
> Are you worried about submitting an URB after the device has been
> disconnected?

Yes, and unlinking them.  Now the driver doesn't need to worry about
if the device is really present or not and it's much simpler.  Gotta
love reference counting :)

Sorry for the comments about being a problem with the uhci driver.

thanks,

greg k-h


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to