Greg,

Do you like this patch the way it is or do you
have some changes that you would recommend
(other than the good idea of adding some email
comments to the source code as comments)?

Johannes,
What about Tom's comment?  I agree with him.

> > I've also added an ioctl() call to reset the device through usbdevfs.

> This is dangerous for composite devices with multiple drivers.
> I'd like this to be only possible if the user driver is the owner
> of all interfaces or alternatively no interface is owned by another driver

Instead of this being a search, it could be implemented as
a claimed driver counter for each usb_device [interface]
and the ioctl would fail if the claimed counter is > 1
or (counter == 1 && the caller is not the owner).
Just an idea.

Tom
~Randy


> -----Original Message-----
> From: Greg KH [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 13, 2000 11:52 PM
> To: Johannes Erdfelt
> Cc: [EMAIL PROTECTED]
> Subject: Re: [linux-usb] [patch] new usb_reset_device 
> semantics + ioctl
> 
> 
> On Tue, Jun 13, 2000 at 06:37:46PM -0700, Johannes Erdfelt wrote:
> > After talking to Matthew Dharm, Randy Dunlap and a couple 
> of other people
> > it became apparent that we probably want different semantics for
> > usb_reset_device to make it more useful.
> 
> I was just talking to someone else about this too, great 
> timing, thanks.
> 
> > This patch resets the device, then it programs the address, 
> programs the
> > active configuration previously set and then sets the 
> > alternate setting for all of the interfaces.
> 
> What happens if the configuration changes after the device is reset?
> Firmware download could cause this to happen. 
> 
> I guess it is up to the driver to change the configuration back to a
> different one if it want to after the reset?
> 
> > The calling driver still retains control of the device and 
> it does not
> > simulate a disconnect() and then probe() call on the device.
> > 
> > I've also added an address 0 semaphore. If we reset a 
> device while a new
> > device was plugged in, we can have 2 devices on address 0 which will
> > most likely cause problems.
> > 
> > I've also added an ioctl() call to reset the device through 
> usbdevfs.
> 
> If usbdevfs calls the ioctl, then the disconnect and probe will not
> happen for the driver that is currently connected to this device,
> correct? That isn't a good thing, is it?
> 
> > WARNING - If a driver calls usb_reset_device, you should simulate a
> > disconnect() and probe() for other interfaces you doesn't 
> claim. This
> > is left up to the driver writer right now. This insures 
> other drivers
> > have a chance to re-setup their interface.
> > 
> > If you wish to still have the old semantics. Make a call to 
> usb_disconnect
> > and then usb_connect (to get a new address) and then usb_new_device.
> 
> You might want to put the above two paragraphs in the code as 
> comments,
> as I know people will need to know this in the future.
> 
> I like this patch. Thanks for beating me to it :)
> 
> greg k-h
> greg@(kroah|wirex).com
> 
> ---------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to