lkml.org 
[lkml]   [2005]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-usb-devel] usb sysfs intf files no longer created when probe fails
On Wed, 22 Jun 2005, Stelian Pop wrote:

> Notice the '1-2:1.1' is missing. Upon booting I get:
>
> Jun 22 13:34:04 localhost kernel: HID device not claimed by input or hiddev
> Jun 22 13:34:04 localhost kernel: usbhid: probe of 1-2:1.1 failed with error -5
> Jun 22 13:34:04 localhost kernel: usb 1-2: device_add(1-2:1.1) --> -5

> Ok, there are two separate problems here:
>
> 1. The sysfs intf entry is not created, and this causes the oops later
> when trying to remove the entry, etc.
>
> I've tracked this problem back to this patch:
> [PATCH] driver core: fix error handling in bus_add_device
> http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ca2b94ba12f3c36fd3d6ed9d38b3798d4dad0d8b
>
> Once the patch above is reverted, I have no more oops, my driver can
> be loaded/unloaded just fine, and the /sys/devices/.../ is present.
>
> However, I'm not really sure if the problem comes from the above
> patch or from my driver which should manually call
> usb_create_sysfs_intf_files() or something equivalent.

You shouldn't call usb_create_sysfs_intf_files in any case.

Your driver is returning -EIO from its probe routine according to the log,
so it's not getting bound to the device. Hence there shouldn't be any
attempt to unbind the device when your driver is removed. This is a bug
in usbcore; it tries to delete all the interfaces without checking whether
they were successfully added.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-22 18:09    [W:0.054 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site