View previous topic :: View next topic |
Author |
Message |
Jefklak l33t
Joined: 26 Oct 2003 Posts: 818 Location: Belgium
|
Posted: Tue Mar 16, 2004 6:58 pm Post subject: Udev & hotplug USB troubles (mouse/memory stick) |
|
|
Ok, this is for anti-spam reasons I wanted to create a new thread instead of going off-topic in the "udev got it working, now what" thread.
First problem
===============
Every f*cking time I restart /etc/init.d/hotplug or I restart/shutdown my computer the hotplug thing hangs I'm really getting frustrated! "rmmod [usb module]" also crashes. I have no Idea why. I tried to compile every USB module into the kernel and now I can restart hotplug without crashing. Why? I don't even want to compile every thing into the kernel... ALSA did not work eighter, compiling into the kernel did. Huh?
Second problem
=================
Also, when plugging in my USB Stick, udev creates NOTHING. No sda thing, no modules loaded by hotplug, nothing. I solved this by compiling "usb_storage" INTO the kernel instead of making it a module. But I still would like to get a module... Anyway, as long as it works eh. Forget it. I plug it in, ok, I can even mount/read/edit, nice. I plug out, and replug, nothing. udev creates no /dev/sda(x?) device. Nothing nothing happens... Why?
Third problem
================
Same prob with USB Mouse... Everything works the first time, not the second. HUH? When I compiled ehci_hcd, ohci_hcd and uhci_hcd as modules, my mouse loads the first time. I replug it into an usb port >> same prob as the usb stick; nothing happens... First time, second not.
I tried compiling EVERY module mentioned above into the kernel, but now my mouse does not work, not even the first time. Why the heck...?
Some clues
==============
Restarting or starting hotplug gives:
Code: | root@lan hotplug # /etc/init.d/hotplug restart
* WARNING: you are stopping a boot service.
* Stopping USB and PCI hotplugging... [ ok ] * Starting USB and PCI hotplugging...
cannot get config descriptor: No such device
cannot get config descriptor: No such device
FATAL: Module mousedev not found.
FATAL: Module input not found. |
Of course you cant find input and mousedev, stupid thing. I compiled it into the kernel!
At the same time I restart hotplug, dmesg gives:
Code: | usbfs: USBDEVFS_CONTROL failed cmd usbmodules dev 2 rqt 128 rq 6 len 18 ret -19
usbfs: USBDEVFS_CONTROL failed cmd usbmodules dev 2 rqt 128 rq 6 len 18 ret -19
usbfs: USBDEVFS_CONTROL failed cmd usbmodules dev 2 rqt 128 rq 6 len 18 ret -19
usbfs: USBDEVFS_CONTROL failed cmd usbmodules dev 2 rqt 128 rq 6 len 18 ret -19
usbfs: USBDEVFS_CONTROL failed cmd usbmodules dev 2 rqt 128 rq 6 len 18 ret -19 |
Err, usbfs? Isn't that part of devfs and I'm using pure udev? Weird weird weird!
Even weirder, at the same time I start/stop/whatever hotplug, /var/log/messages gives:
Code: |
Mar 16 19:47:41 lan input.agent[9340]: ... no modules for INPUT product 0011/0002/0007/0000
Mar 16 19:47:41 lan input.agent[9346]: ... no modules for INPUT product 0011/0001/0001/ab41
Mar 16 19:47:42 lan usb.agent[10073]: ... no modules for USB product 0/0/0
Mar 16 19:47:42 lan usbfs: USBDEVFS_CONTROL failed cmd usbmodules dev 2 rqt 128 rq 6 len 18 ret -19
Mar 16 19:47:42 lan usbfs: USB[b]DEVFS[/b]_CONTROL failed cmd usbmodules dev 2 rqt 128 rq 6 len 18 ret -19
Mar 16 19:47:42 lan usb.agent[10092]: ... no modules for USB product 0/0/0 |
Aha! Why the heck is devfs still there?
Could anyone PLEASE give me some usefull tips or at least try? I'm out of ideas... Thank you VERRY much in advance!!!
MOD 1 I tried downgrading to an older version of hotplug. Forget it. Currently using latest baselayout, udev 0.21 and hotplug 20040105 (Yes, I ran the latest version, but that didn't work anything out)
Jefklak |
|
Back to top |
|
|
dsd Developer
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Tue Mar 16, 2004 9:26 pm Post subject: |
|
|
first, thanks for splitting off the udev thread
which kernel are you running?
for your second problem, with usb_storage compiled as a module, which lines appear in dmesg when you plug the device in? does the "usb_storage" module get listed in "lsmod" at this stage?
third problem: please post the relevant dmesg output the right after the first time you plug it in, when you unplug it, and when you replug it. do the modules get auto loaded/unloaded at each stage? i have a feeling this is related to problem 1 - hotplug tries to unload the module when you unplug, but fails...
as for USBDEVFS - well, this was originally a "usb device file system". but the name usbDEVFS was confusing, as the system was in no way related to devfs. it is now known as "usbfs" and gets mounted at /proc/bus/usb. it is nothing to do with devfs, and it is usual that you have it in a udev-based system.
some of the code still includes functions with the name USBDEVFS, e.g. USBDEVFS_CONTROL - so you may see the word "usbdevfs" in error logs sometimes. it is really just usbfs.
what happened when you downgraded hotplug? did it fix any problems?
(it sounds like your issues here are kernel issues)
also, try running the current stable baselayout. i've heard some things about the masked version, which has put me off upgrading... _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
|
agrippa_cash Tux's lil' helper
Joined: 08 May 2003 Posts: 143 Location: Los Angeles
|
Posted: Wed Mar 17, 2004 1:09 am Post subject: |
|
|
My hotplug would freeze on shutdown when I booted with a scheduler instruction in Grub and then used a USB device. My boogey line was: elevator = cfq.
The reason for this is explained somewhere in one of the many ovlay-ourcesay threads.
I'm useing pig latin because I'm tired of getting all these extrainous threads when I'm searching for the newest ovlay-ourcesay.
Iay ishway atthay ethay earchsay unctionfay ouldway earchsay orfay ethay ewestnay ppearancay foay ethay equestedray ermtay (otnay ewestnay readthay ontainingcay iadsay ermtay).
Ighsay. |
|
Back to top |
|
|
Jefklak l33t
Joined: 26 Oct 2003 Posts: 818 Location: Belgium
|
Posted: Wed Mar 17, 2004 8:46 am Post subject: |
|
|
I'm running 2.6.4-mm1. I will try to update to love-sources, ck-sources or mm2 and see what happens, and I'll also try to downgrade my baselayout. Downgrading hotplug didn't solve anything...
When usb_storage was compiled as a module, nothing happened when I plugged it into my usb port. I tried loading usb_storage manually (that worked but I still couln't mount it because udev didnt create any devices). So I rmmod-ded the module and that resulted into a crash.
Agrippa_cash: i'm also using "elevator=cfq" with preemptive kernel support enabled. But I also have an 2.6.4-mm1 without preemptive kernel for testing and with that kernel hotplug also hangs. I noticed (as I said) when you compile most things in he complains less about stuff like
Code: | no module INPUT for product 0001/0002/0000/... |
usb as modules, I got this 6 times on bootup. Usb built-in, I got this 2 times... And hotplug doesn't hang anymore, BUT my mouse is still gone! udev doesn't create any /dev/input/mouse1 anymore... (Im on a laptop, touchpad works). usb as modules, mouse worked.
I will post various dmesg outputs ASAP, I'm right now in evil Windows... The only OS where plugging things in and out works Thanks for the usbfs explanation, that indeed confused me. When compiled usb as modules, and plugged my mouse in, udev created device and hotplug loaded it (I think, I also had them in /etc/modules.autoload.d/kernel-2.6). Yes you are right, when hotplug tries to UNload them the whole sh*t hangs and linux goes crazy (at least hotplug)... But of course the stupid thing can't unload modules built-in...
So what should I do now?
A little desparate |
|
Back to top |
|
|
nevynxxx Veteran
Joined: 12 Nov 2003 Posts: 1123 Location: Manchester - UK
|
Posted: Wed Mar 17, 2004 8:58 am Post subject: |
|
|
I am also having the "only works the first time" thing going on. I seem to be getting kernel oopses when I unplug my stick, is there anything that should be done to tell the usb system you are unplugging? like in windows you have to stop the device? also is there a command that will check the usb tree and remove any devices that don't exist anymore? _________________ My Public Key
Wanted: Instructor in the art of Bowyery |
|
Back to top |
|
|
dsd Developer
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Wed Mar 17, 2004 1:52 pm Post subject: |
|
|
try running kernel 2.6.4 vanilla.
-mm is full of experimental stuff and you can safely expect the odd screwup here and there (its not that common right now, but 2.6.4-mm1 was pretty much marked as a "dont use me" release by-description..) _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
|
Jefklak l33t
Joined: 26 Oct 2003 Posts: 818 Location: Belgium
|
Posted: Wed Mar 17, 2004 4:49 pm Post subject: |
|
|
Ok, compiling right now.
I'm going to try agian making usb stuff modules.
I'll let you know if there's any progress in this...
Hah. compiled ehci-hcd, hid and ohci_hcd as MODULES and everything (at least my mouse) works fine with udev. usbcore & input still compiled in.
Code: | Mar 17 18:19:59 lan usb 1-1: USB disconnect, address 2 |
When I plug out my USB.
Replugging gives:
Code: | Mar 17 18:20:09 lan usb 1-1: new low speed USB device using address 3
Mar 17 18:20:09 lan input: USB HID v1.10 Mouse [Logitech USB Receiver] on usb-0000:00:1d.0-1
Mar 17 18:20:10 lan udev[14398]: configured rule in '/etc/udev/udev.rules' at line 79 applied, 'mouse2' becomes 'input/mouse%n'
Mar 17 18:20:10 lan udev[14398]: creating device node '/dev/input/mouse2' |
That's nice.
But how do I tell hotplug to use the USB 2.0 drivers instead of the 1.1 ones? Can that be done? Thanks!
Trying out my USB Stick right now... |
|
Back to top |
|
|
Jefklak l33t
Joined: 26 Oct 2003 Posts: 818 Location: Belgium
|
Posted: Wed Mar 17, 2004 6:00 pm Post subject: |
|
|
OW YEAH
Plug in, plug out.
Plug back in, plug back out.
Repeat and dance!!!
Thank you so much. Everything works as it has to, the only thing I did was changing kernel as you said... -mm sucks!
Only one little problem: I created a rule for my usb stick
Code: | BUS="scsi", SYSFS{vendor}="USB*", SYSFS{model}="Flash Drive*", NAME="%k", SYMLINK="usbstick" |
That works perfectly. But mounting /dev/usbstick gives
Code: | mount: /dev/usbstick is not a block device |
Err? Mounting /dev/sda(x) works perfectly. But thats what the symlink is for, mounting on the same file!
And that USB 1.1 / USB 2.0 thingie.
But thank you so much My hero! |
|
Back to top |
|
|
dsd Developer
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Wed Mar 17, 2004 6:21 pm Post subject: |
|
|
your USB mouse is usb 1.1 hardware. theres no way to force it to use USB2. you wouldnt gain anything even if you could.
however, if you have EHCI compiled in (or as a module), and you plug in a USB2-capable device, then yes, that device will use the USB2 capabilities.
the problem that you are having with your USB stick is that it creates more than one device node (e.g. sda _and_ sda1). sda is not mountable, sda1 is. the problem is that your rule matches both of those nodes, so it gets confused. you only want to be matching sda1.
add a key that says:
KERNEL="sd?1"
and it will work.
for more info, see my page on this topic. i detail this exact scenario on there (for my camera) _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
|
Jefklak l33t
Joined: 26 Oct 2003 Posts: 818 Location: Belgium
|
Posted: Wed Mar 17, 2004 6:34 pm Post subject: |
|
|
Thank you very much dsd.
Anyway, i'm still running preemptive sheduling so that wasn't the problem. for people having the same problem as me: try another kernel! Nothing more, nothing less...
However, Mounting /dev/sda? (or the symlink) gives:
Code: | mount: /dev/sda1: can't read superblock |
Only /dev/sda itself works...
Why 's that?
I also noticed one little thing: Plugging in and out and back in (usb mouse) results in perfectly working mouse and good symlinks but the scroll wheel doesnt work anymore until I restart X... Weird because XF86Config correctly loads the right node (the symlink) |
|
Back to top |
|
|
dsd Developer
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Wed Mar 17, 2004 7:25 pm Post subject: |
|
|
ok, its probably a little different on your device then.
change the rule to
KERNEL="sd?"
i dont know about your X problem _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
|
Jefklak l33t
Joined: 26 Oct 2003 Posts: 818 Location: Belgium
|
Posted: Wed Mar 17, 2004 7:35 pm Post subject: |
|
|
That works. Thanks
I'm so happy |
|
Back to top |
|
|
MasquedAvenger Guru
Joined: 21 Aug 2003 Posts: 559 Location: Southern California
|
Posted: Fri Apr 30, 2004 4:08 pm Post subject: |
|
|
By the way, I don't think you would want to do this, but you could actually run fdisk on your /dev/sda and create partitions, and even create any filesystems you want, just like a HD
James |
|
Back to top |
|
|
drakos7 Apprentice
Joined: 21 Feb 2003 Posts: 294 Location: Rockville, MD, USA, Earth, Sol
|
Posted: Wed Aug 11, 2004 2:02 am Post subject: |
|
|
bumping this thread because I also have the problem Jefklak experiences that the scroll functionality is lost when plugging the usb mouse back in. Anyone have any suggestions?
EDIT: using /dev/input/mice instead of /dev/input/mouse1 worked for me. Now I can plug and unplug with impunity. Woohoo! |
|
Back to top |
|
|
|
|
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
|
|