On Wed, Apr 22, 2015 at 08:54:34AM +0200, Martin Pieuchot wrote:
> On 17/04/15(Fri) 16:47, Dimitris Papastamos wrote:
> > Hi,
> > 
> > This patch adds an option to usbdevs(8) to disable USB bus probing
> > at runtime.  The operation is restricted to the root user.
> 
> It would be nice to show if probing is on or off, for example
> 
> # usbdevs -p
> bus probing: on
> 
> # usbdevs -p off
> 
> But other people might have better suggestions.

Yeah I thought about that, I will add it.

> > I am not sure if this approach is sensible or even correct.  Some
> > pointers would be much appreciated.
> 
> Setting a variable per hub (and here roothub) is overkill, a global
> would be enough.

Will fix.

> How did you try it?  What happen if you plug a hub with multiple
> devices, turn bus probing off then detach the hub?

I have not tried connecting a hub, but connecting a device with probing
on, disabling probing and then removing works as expected by first detaching
the device and disallowing any further probes after disabling them.

I will try with a hub too.

> What happen if you plug a device like a phone that use the power to
> charge its battery after turning probing off.  If I read your diff
> correctly you still allow the device to be charged which is fine.  Did
> you try that?  I think it's worth a documentation note.

Not tried this yet, but will do.

On a side note, What do you think of using a sysctl instead of an ioctl?
I guess an ioctl will do but it would make it easy for people to disable
this at boot time by simply adding the relevant knob in /etc/sysctl.conf.
Otherwise I imagine people adding usbdevs -p off in rc.local.

Cheers,
Dimitris

Reply via email to