[linux-usb-devel] usb sysfs intf files no longer created when probe fails

[linux-usb-devel] usb sysfs intf files no longer created when probe fails

Post by Stelian Po » Fri, 24 Jun 2005 00:30:12


Le mercredi 22 juin 2005 07:59 -0700, Greg KH a crit :


I am the author :)

That driver worked until yesterday, and I was not able to find out about
any API change which would disrupt it now, that's why I reported this to
the list...

Stelian.
--
Stelian Pop < XXXX@XXXXX.COM >

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

[linux-usb-devel] usb sysfs intf files no longer created when probe fails

Post by Stelian Po » Fri, 24 Jun 2005 01:10:08

Le mercredi 22 juin 2005 11:41 -0400, Alan Stern a crit :


Indeed. I've also tracked my problem down to the hid core which returns
-EIO when it fails to drive an unknown HID device, instead of a more
logical -ENODEV (this is not a failure to init a known device, but
rather the impossibility to init an unknown device).

The patch below solves the problem for me:

Index: linux-2.6-trunk.git/drivers/usb/input/hid-core.c
===================================================================
--- linux-2.6-trunk.git.orig/drivers/usb/input/hid-core.c 2005-06-22
10:33:23.000000000 +0200
+++ linux-2.6-trunk.git/drivers/usb/input/hid-core.c 2005-06-22
17:43:10.000000000 +0200
@@ -1784,7 +1784,7 @@
if (!hid->claimed) {
printk ("HID device not claimed by input or hiddev\n");
hid_disconnect(intf);
- return -EIO;
+ return -ENODEV;
}

printk(KERN_INFO);



I agree, presence in /sys/devices shouldn't be related to the existence
or success/failure of a driver. The link between /sys/class
towards /sys/devices is already saying this.

Stelian.
--
Stelian Pop < XXXX@XXXXX.COM >

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

 
 
 

[linux-usb-devel] usb sysfs intf files no longer created when probe fails

Post by Stelian Po » Fri, 24 Jun 2005 03:30:14

Le mercredi 22 juin 2005 09:26 -0700, Greg KH a rit :
>>>> - return -EIO; >>>> + return -ENODEV; >>>> } >> >> Also need to do the same a few lines above in the code. I've fixed that >> too now.

Indeed, especially since the only way to use an alternate driver for a
real hid device is to blacklist it using HID_QUIRK_IGNORE, and in this
case we go through that path.

Stelian.
--
Stelian Pop<< XXXX@XXXXX.COM >>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

[linux-usb-devel] usb sysfs intf files no longer created when probe fails

Post by Stelian Po » Fri, 24 Jun 2005 03:40:10

Le mercredi 22 juin 2005 09:22 -0700, Greg KH a rit :
>>>> Le mercredi 22 juin 2005 ?? 11:41 -0400, Alan Stern a ??crit : >>>> >>>>>> This is a curious aspect of the driver model core. Should failure of a >>>>>> driver to bind be considered serious enough to cause device_add to fail? >>>>>> The current answer is Yes unless the driver's probe routine returns >>>>>> -ENODEV or -ENXIO, in which case the failure is not considered serious. >>>> >>>> Indeed. I've also tracked my problem down to the hid core which returns >>>> -EIO when it fails to drive an unknown HID device, instead of a more >>>> logical -ENODEV (this is not a failure to init a known device, but >>>> rather the impossibility to init an unknown device). >>>> >>>> The patch below solves the problem for me: >> >> Damm, beat me by a few minutes :)

:)
>> Yes, this is the proper fix for this. >> >> But to answer Alan's main question, I think you are correct, we should >> not fail device_add if binding a device fails. I can see this causing a >> lot of very difficult problems in the future (including the fact that >> I've been hitting this bug with a new driver I'm writing and didn't even >> realize it...) >> >> So, I'll apply this one, and revert the main part of Hannes's patch too.

Thanks.

Stelian.
--
Stelian Pop<< XXXX@XXXXX.COM >>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/