Re: [RFC 12/15] usb: Register second xHCI roothub.

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

 



On Thu, 2 Dec 2010, Sarah Sharp wrote:

> > Have the core check for HCD_NO_RESOURCES.  If that flag is set, don't 
> > allocate or free the bandwidth mutex.  In your probe routine, copy the 
> > mutex pointer from one hcd to the other.
> > 
> > I admit, this amounts to a bunch of somewhat ad-hoc changes just to 
> > avoid changing the hcd-is-a-bus assumption.  But since that would end 
> > up being such a big change, this seems justified.
> 
> When the PCI probe function sees HCD_NO_RESOURCES, should it also not
> allocate things like hcd bounce buffers?

It doesn't allocate bounce buffers currently, so I don't see why it 
should start doing so when HCD_NO_RESOURCES is set.  It _does_ create a 
few DMA pools, but that's not a terribly big deal.

>  Should those be shared across
> the two roothubs?

That's up to you.

>  If the answer is yes, I'd rather have the code to
> make those decisions in the USB core, rather than the xHCI driver.  It
> seems like it would be a time-bomb just waiting for someone to add some
> sort of new resource to the HCD structure and not update the xHCI
> driver.  I'd really rather have the changes be visible in the USB core.

I suppose instead of HCD_NO_RESOURCES you could add a "primary_hcd"  
pointer to the usb_hcd structure.  Normally it would be NULL, but for
secondary hcd's (where you don't want resources allocated) you set it
to point to the associated primary hcd.  Then whenever this pointer is
set, instead of allocating a new set of DMA pools the core could just
copy the pool pointers from the primary hcd.

The advantage over what you posted is that this doesn't make
assumptions about dev_get_drvdata(hcd->self.controller); the core
shouldn't have anything to do with this -- it's private to the driver.  
(Some drivers might not want to store a pointer to the hcd there.)
It also doesn't make assumptions about whether the primary is USB-2 and
the secondary is USB-3 or vice versa.

Alternatively, we could bite the bullet and really separate buses from 
hcds.  The difficulty of doing this will only increase as time passes.

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