Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
modules usbcore and usbcommon
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 185

PostPosted: Sun Mar 16, 2014 1:22 pm    Post subject: modules usbcore and usbcommon Reply with quote

Hallo Forum,
I am running a system without any USB hardware present. USB support is nevertheless compiled as a module (usbcore and usbcommon and a few others). This is because I am using the same kernel version and environment for various systems and a few of these do actually have USB hardware (before you ask: those various systems are all XEN guests running on the same host as virtual machines and currently there's only one domU guests which gets USB-hardware passed through).

Nevertheless, all virtual machines automatically load the USB support modules 'usbcommon' and 'usbcore'. Upon investigation it turned out that the startup script /etc/init.d/procfs
Code:
[... snip ...]
start()
{
        # Make sure we insert usbcore if it's a module
        if [ -f /proc/modules -a ! -d /sys/module/usbcore -a ! -d /proc/bus/usb ]; then
                modprobe -q usbcore
        fi
[... snip ...]
unconditionally loads the 'usbcore' module which in turn seems to autoload 'usbcommon'.

It would be easy to comment those lines out, but I wonder what's the rational for loading usb support modules even if no USb hardware is present in the system?

Also: Is there a recommended approach to prevent those modules from being autloaded if no USB hardware is present? Creating a file /etc/modprobe.d/usb.blacklist.conf
Code:
blacklist usbcore
blacklist usbcommon
did not change anything - i.e. the modules are still being loaded during system startup.

Thanks Atom2
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5761

PostPosted: Mon Mar 17, 2014 9:42 pm    Post subject: Reply with quote

It looks like they hardcode it to make sure the usbfs code near the bottom succeeds... which is pretty useless, because that's an ancient and obsolete thing itself.
Back to top
View user's profile Send private message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 185

PostPosted: Mon Mar 17, 2014 10:59 pm    Post subject: Reply with quote

Ant P. wrote:
It looks like they hardcode it to make sure the usbfs code near the bottom succeeds... which is pretty useless, because that's an ancient and obsolete thing itself.

But that code would only succeed if /proc/bus/usb were created by usbcommon and/or usbcore - but that's not the case on my system even for the one XEN guest to which I pass through the USB hardware. I guess the part of the code you are referring to is never being executed.

BTW if the presence of USB hardware would be indicated by the existence of /proc/bus/usb it had been very easy to solve the issue by just adding a modprobe -r after the initial loading of the module in case there's no /proc/bus/usb.

My solution currently is to have the loading of the module completely commented out and - and that's even for the guest that has USB hardware passed through. For that guest nevertheless usbcommon and usbcore somehow get loaded automatically - obviously from somewhere else.

I currently tend to consider this as a bug in the script. What are your thoughts?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5761

PostPosted: Tue Mar 18, 2014 12:02 pm    Post subject: Reply with quote

I think it's more likely just bit-rotted code than a mistake, the copyright header on that file still says 2009. Either way I'd agree all the USB stuff in that file can go away.
Back to top
View user's profile Send private message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 185

PostPosted: Wed Mar 19, 2014 12:31 am    Post subject: Reply with quote

I have searched the bugzilla as I intended to report "an issue" - and there was already a bug filed: https://bugs.gentoo.org/show_bug.cgi?id=480312. I have added my observations as my issues were not really covered by the initial bug report, but have yet to hear back from those guys dealing with the bug ...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum