On 31/01/08 17:50, Alan Stern wrote:
>>>> It currently informs an error if the device is unplugged. IMHO that's
>>>> the right thing to do, the user space application can then close the
>>>> file handle and try to open it again, if it fails the application can
>>>> then try to interact with the user asking to replug the device.
>>>>     
>>>>         
>>> When a reset fails, the kernel should do exactly the same thing as if 
>>> the device was unplugged.  Are you saying that it doesn't?
>>>   
>>>       
>> Nope. My user space program continues reading from the hiddev device, of
>> course it never gets events ;-)
>> Important: I'm polling using a NONBLOCKing file handler.
>>     
>
> Are you really certain that you get different behavior with an unplug 
> and a reset failure?  As far as the HID driver is concerned there's no 
> difference.
>   

Here is what I get with a physical disconnect:

$ cat /dev/usb/hiddev0
ÿ ÿ!ÿ"ÿ#ÿÿ ÿ!ÿ"ÿ#ÿÿ ÿ!ÿ"ÿ#ÿÿ ÿ!ÿ"ÿ#ÿcat: /dev/usb/hiddev0: Error de
entrada/salida

Note: The above message means input/output error.

Now, I tried unplugging the device while executing a NONBLOCKing
program. I didn't get any I/O error. It means I was wrong about the
difference between unplugging the device and the effect of a recovery
like the one I mentioned previously. You are right, but IMHO that's odd,
the device should also inform I/O error when reading using a NONBLOCKing
file handler. Currently a program must use blocking reads in order to
get notified about the problem. It looks bad and lacks consistency. What
do you think?

Regards, SET

-- 
_______________________________________________________________
Ing. Salvador Eduardo Tropea          http://utic.inti.gov.ar/
INTI-Electrónica e Informática        Tel: (+54 11) 4724 6315
Colectora de Av. General Paz 5445     San Martín - B1650KNA
Casilla de Correo 157                 FAX: (+54 11) 4754 5194
Buenos Aires * Argentina              http://www.inti.gov.ar/


-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to