Driver probing defaults (was: Re: [PATCH] USB: Add LVS Test device driver)

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

 



On Wed, 14 May 2014, Pratyush Anand wrote:

> I see some references on different mailing lists that "probe will be
> executed according to object link order which is decided by Makefile".
> 
> http://comments.gmane.org/gmane.linux.usb.general/98616

I believe that refers to probing during driver registration, not during
device registration.  And it obviously doesn't apply to drivers in
modules.

> If that is not true, may be I can do what Bj�ork is suggesting.
> But that would require change in drivers/base/bus.c:driver_(un)bind.
> 
> -- Add a new field manual_binding in struct device_driver.
> -- set this flag in drivers_bind before calling driver_probe_device.
> -- reset this flag if driver_probe_device returns error.
> -- reset this flag in driver_unbind.
> -- return error from lvs_rh_probe if manual_binding is not true.

As Bjørn said, this doesn't seem like a good way to go.

> Please let me know if there could be a better way to do it.

I don't know.  It's a difficult problem.

Greg, do you have any suggestions?  If two drivers can manage the same 
device, but one of them is intended for normal use whereas the other is 
just for testing, how can we insure that the normal driver is the one 
that gets bound to the device by default?

Is it really safe to rely on the device core always probing drivers in
order of driver registration?  If it is then we are okay (at least in
this particular case), because the hub driver will always be registered
before the lvstest driver.

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