Re: [RFC 05/15] xhci: Change hcd_priv be a pointer.

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

 



On Tue, 30 Nov 2010, Sarah Sharp wrote:

> > This is not a good idea.  Since the xhci_hcd structure is allocated 
> > very early in the life cycle, it should be deallocated very late.  For 
> > example, at the time when the usb_hcd structure is destroyed.
> 
> It's difficult to figure out exactly where the xHCI private structure
> should be freed, which is why the free ended up in xhci_stop().  I don't
> want the USB core PCI code having to deallocate something the xHCI
> driver allocated.  Perhaps I need to introduce a new HCD call,
> free_hcd_priv(), that is called in hcd_release()?  It seems like a
> heavy-handed approach, but I'm not sure how else to do it.

I see your problem.  The simplest answer I can think of is to define an 
xhci_pci_remove() function in xhci-pci.c.  Have it call 
usb_hcd_pci_remove() and then free the private structure, and stick it 
in xhci_pci_driver as the .remove member.

The real problem here lies in the HCD framework itself.  There are two
methods called during binding (.reset and .start) but only one (.stop)  
called during unbinding.  There should also be a .remove method (and 
.reset should be renamed to .init).

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