Re: use_generic and usb probing

From: Hans Petter Selasky <hselasky_at_freebsd.org>
Date: Wed, 6 Apr 2011 09:33:47 +0200
On Tuesday 05 April 2011 18:45:51 Andriy Gapon wrote:
> on 05/04/2011 15:55 Hans Petter Selasky said the following:
> > On Tuesday 05 April 2011 14:50:43 Andriy Gapon wrote:
> >> I believe that newbus already supports ordering of children on a bus.
> >> 
> >> BTW, does USB have to pass anything from probe to attach?
> > 
> > Mostly only the driver info field. To avoid duplicate lookups.
> > 
> >> Duplicate lookup is of course not very nice, but duplicate probing pass
> >> is not nice either.
> > 
> > This can all be avoided if the bus-drivers are sorted correctly before
> > probing!

Hi,

> 
> Well, I think that that's what probe priorities actually for.
> I also think that typically ivars should be set by a bus driver.  So maybe
> it's not such a good idea to pass data from probe to attach via ivars in
> child drivers. But I could be mistaken about that.
> 

The same device_t is used to do all the probes!

> Practically speaking, you most likely don't have to worry about that for
> drivers that return BUS_PROBE_SPECIFIC (=0) from their probe methods.  And
> there is only a few "generic" drivers that can be handled on a case by
> case basis.

There are more drivers that needs patching! Please scan all of the kernel 
files for usbdi.h and the use_generic flag.

After looking at subr_usb.c I see your solution is fine as long as the PROBE() 
method that it attaches is the last one called before ATTACH(). If this is 
documented in how newbus should function, then please go ahead updating your 
patch to cover all USB drivers using use_generic.

--HPS
Received on Wed Apr 06 2011 - 05:34:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:13 UTC