Re: [linux-usb-devel] usb+sysfs: duplicate filename 'bInterfaceNumber'

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Greg KH <greg@...>, Dave Young <hidave.darkstar@...>
Cc: <bbpetkov@...>, Kernel development list <linux-kernel@...>, USB development list <linux-usb-devel@...>
Date: Tuesday, October 16, 2007 - 10:55 am

On Tue, 16 Oct 2007, Dave Young wrote:


Okay, good, the extra printk messages show exactly where the problem 
lies.

In usb_set_configuration(), each new interfaces is registered and then
usb_create_sysfs_intf_files() gets called for that interface.  This
makes sense, because obviously we can't create sysfs files for an
interface before it is registered.

The problem is that during registration drivers get probed, and drivers 
sometimes call usb_set_interface() from their probe method.  This 
routine also calls usb_create_sysfs_intf_files(), and the result is 
that the sysfs files get created twice:

	First by usb_set_interface, from the driver probe;

	Then by usb_set_configuration, when registration is
	finished.

I can think of two possible ways around the problem.  One is to add a 
bit to the usb_interface structure, recording whether the sysfs files 
have been created.  The other is always to remove the files just before 
trying to create them.

The first seems more workable, although it is slightly awkward.  Greg, 
what do you think?

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [linux-usb-devel] usb+sysfs: duplicate filename 'bInterf..., Alan Stern, (Tue Oct 16, 10:55 am)