# Udev issues [solved....finally]

## psychomunky

Hello,

I recently just re-installed my PC with Gentoo 2006.1 (i wanted to rebuild to pull on drive to use elsewhere and to finally get rid of my Windows).  Everything is working well, except for one thing.  Udev or the kernel (or HAL or DBUS...I am not certain how all of these work together), get stuck when I plug in a USB storage device after boot.

When I tail the kernel log or run dmesg after plugging in the device all I get is:

```
[kernel] usb 1-6: new high speed USB device using ehci_hcd and address 6
```

Then anything that tries to access the usb info in /proc or /dev hangs, like usbview, lsusb, etc.  Unplugging and re-plugging the device doesn't help, and infact I get no new kernel output like it detected the disconnect or reconnect.  Plugging another device with out rebooting yields the same effect.

Previously, the kernel log would then say something about the usb-storage modules picking it up and udev would create my /dev/sdbX node so I could at least mount the device manually.  At one point I had this working and went to rebuild my kernel to add in sound support or something.  After that everything stopped working it seems.

The following are things I have tried (in this order):

1. re-emerging udev

2. recompiling the kernel with the USB options as modules instead of built-ins

3. unmerging udev, getting rid of /etc/udev and then upgrading udev to a masked version (like udev-103)

4. doing the same as above with the new udev, and then re-emerging the latest stable udev.

5. unmerging, getting rid of all config files in etc and then remerging the following things dependant upon udev (in this order): dbus, hal, pmount, coldplug, hotplug

I am still having this problem.  Here is some info that might be helpful:

```

# emerge --info

Portage 2.1.1-r1 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.18-gentoo-r1 i686)

=================================================================

System uname: 2.6.18-gentoo-r1 i686 AMD Athlon(tm) XP 2600+

Gentoo Base System version 1.12.5

Last Sync: Wed, 01 Nov 2006 09:50:01 +0000

distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]

ccache version 2.3 [enabled]

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: 1.3.7, 2.0.30

dev-lang/python:     2.4.3-r4

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     2.3

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc-config: 1.3.13-r4

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.17-r1

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=athlon-xp -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo"

CXXFLAGS="-O2 -march=athlon-xp -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig candy ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict usersandbox"

GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://adelie.polymtl.ca/ ftp://gentoo.arcticnetwork.ca/pub/gentoo/"

LINGUAS="en_CA en_GB en"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/misc /usr/portage/local/layman/sunrise /usr/portage/local/layman/zugaina"

SYNC="rsync://192.168.0.10/gentoo-portage"

USE="x86 3dnow 3dnowext X Xaw3d a52 aac aalib acpi addbookmarks aiglx alias alsa amr asf audiofile autoreplace bash-completion berkdb bitmap-fonts branding bzip2 cairo caps cdda cddb cdparanoia cdr chroot cli connectionstatus contactnotes cpudetection cracklib crypt css cups daap dbus dga directfb dlloader dmi dri dts dv dvb dvd dvdr dvdread dxr3 eds elibc_glibc emboss encode exscalibar extrafilters fam fame fbcon ffmpeg firefox flac flash fontconfig fortran fusion gadu gdbm ggi gif gnutls gpm graphviz groupwise gs gstreamer gtk2 hal highlight history hpn iconv idn imagemagick imlib input_devices_evdev input_devices_joystick input_devices_keyboard input_devices_mouse irc isdnlog java javamail jbig jpeg jpeg2k kde kdeenablefinal kdrive kernel_linux latex lcms libcaca libedit libg++ linguas_en linguas_en_CA linguas_en_GB live lm_sensors logitech-mouse logrotate lua lzo mad mikmod mjpeg mmx mmxext mng mod modplug mozilla mp3 mp4 mpeg multiuser musepack musicbrainz ncurses nethack netmeeting network nls nowlistening nptl nptlonly nsplugin nvidia offensive ogg openal opengl oss pam parse-clocks pcre perl png ppds pppd python qt3 qt4 quicktime rdesktop readline real reflection rtc rtsp sametime sdl sensord session sftplogging shout skins slp sms sndfile socks5 spell spl sse ssl statistics stream svg svga symlink tcpd texteffect theora threads tiff translator truetype truetype-fonts type1-fonts udev unicode urandom userland_GNU utempter vcd video_cards_fbdev video_cards_nvidia vidix visualization vlm vorbis webpresence wifi win32codecs winpopup wmf x264 xanim xcomposite xine xinerama xml xorg xosd xpm xprint xscreensaver xv xvid xvmc yahoo yv12 zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

```

 $ equery l udev

[ Searching for package 'udev' in all categories among: ]

 * installed packages

[I--] [  ] sys-fs/udev-087-r1 (0)

```

```

 $ equery l hotplug

[ Searching for package 'hotplug' in all categories among: ]

 * installed packages

[I--] [  ] sys-apps/hotplug-20040923-r2 (0)

[I--] [  ] sys-apps/hotplug-base-20040401 (0)

```

```

$ equery l coldplug

[ Searching for package 'coldplug' in all categories among: ]

 * installed packages

[I--] [  ] sys-apps/coldplug-20040920-r1 (0)

```

```

$ equery l dbus

[ Searching for package 'dbus' in all categories among: ]

 * installed packages

[I--] [  ] sys-apps/dbus-0.61-r1 (0)

```

```

$ equery l sys-apps/hal

[ Searching for package 'hal' in 'sys-apps' among: ]

 * installed packages

[I--] [ ~] sys-apps/hal-0.5.7.1-r1 (0)

```

```

 $ uname -a

Linux moria 2.6.18-gentoo-r1 #11 PREEMPT Sun Nov 5 00:35:19 MST 2006 i686 AMD Athlon(tm) XP 2600+ GNU/Linux

```

I'll post my kernel config if anyone wants to see it, but CONFIG_HOTPLUG is definately turned on (set to y) because I have /proc/sys/kernel/hotplug, but it is empty (this might be okay I guess, but I know older hotplug, kernels and udevs had /sbin/hotplug as the contents of this file).

Also, I have tried many different devices: two different USB thumb drives, my digital camera and my PSP...all do the same thing.

Also as I understand it doing a udevmonitor --env should show me some events when I plug the device in, but nothing comes up.  To me it looks like my kernel is not talking to udev at all.  Does anyone have any ideas??  Without my USB devices linux is very limiting to me.  At the moment, I'd just like to get the kernel (or whatever) to recognize the device so I can at at least mount it manually.  Although eventually, I'd like to get the KDE HAL integration working again too (yes it's broken I think as well, because, when I had the kernel recognizing the devices earlier today, KDE didn't detect them like it used to).

Please help.Last edited by psychomunky on Sat Nov 11, 2006 5:59 am; edited 3 times in total

----------

## Kate Monster

Hello,

Along with the usb-storage module, have you checked that 

Device Drivers -> SCSI support ->

<*>   SCSI disk support

<*>   SCSI generic support

are on? Or compiled as modules.

Maybe also check to make sure your specific USB hub driver is compiled in. IE OHCI, UCHI, EHCI etc.

----------

## psychomunky

OKay, here is my kernel config:

```

Device Drivers -> SCSI support ->

 <*> SCSI device support

[*]   legacy /proc/scsi/ support

---   SCSI support type (disk, tape, CD-ROM)

<*>   SCSI disk support

< >   SCSI tape support

< >   SCSI OnStream SC-x0 tape support

< >   SCSI CDROM support

<*>   SCSI generic support

< >   SCSI media changer support

---   Some SCSI devices (e.g. CD jukebox) support multiple LUNs

[*]   Probe all LUNs on each SCSI device

[*]   Verbose SCSI error reporting (kernel size +=12K)

Device Drivers -> USB support ->

<*> Support for Host-side USB  

[*]   USB device filesystem

[*]   Dynamic USB minor allocation (EXPERIMENTAL)

<*>   EHCI HCD (USB 2.0) support

[ ]     Full speed ISO transactions (EXPERIMENTAL)

[*]     Root Hub Transaction Translators (EXPERIMENTAL)

[*]     Improved Transaction Translator scheduling (EXPERIMENTAL)

<M>   OHCI HCD support

<M>   SL811HS HCD support

<M>   USB Printer suppor

<M> USB Mass Storage support

[ ]   USB Mass Storage verbose debug

[ ]   Datafab Compact Flash Reader support (EXPERIMENTAL)

[ ]   Freecom USB/ATAPI Bridge support

[ ]   ISD-200 USB/ATA Bridge support

[ ]   Microtech/ZiO! CompactFlash/SmartMedia support

[ ]   USBAT/USBAT02-based storage support (EXPERIMENTAL)

[ ]   SanDisk SDDR-09 (and other SmartMedia) support (EXPERIMENTAL)

[ ]   SanDisk SDDR-55 SmartMedia support (EXPERIMENTAL)

[ ]   Lexar Jumpshot Compact Flash Reader (EXPERIMENTAL)

[ ]   Olympus MAUSB-10/Fuji DPC-R1 support (EXPERIMENTAL)

<M> USB Human Interface Device (full HID) support

[*]   HID input layer support

[*]   HID input layer support

[*]       PID Devices (Microsoft Sidewinder Force Feedback 2)

[*]       Logitech WingMan *3D support

[*]   /dev/hiddev raw HID device support

```

Everything else in USB is turned off if it is not listed.  I am not certain why I have SL811HS HCD support turned on, as I don't even have MB that supports it.  I'll turn that off and try again.

As well, here is the output of lspci and lsmod right after booting:

```

# lspci

00:00.0 Host bridge: nVidia Corporation nForce2 AGP (different version?) (rev c1)

00:00.1 RAM memory: nVidia Corporation nForce2 Memory Controller 1 (rev c1)

00:00.2 RAM memory: nVidia Corporation nForce2 Memory Controller 4 (rev c1)

00:00.3 RAM memory: nVidia Corporation nForce2 Memory Controller 3 (rev c1)

00:00.4 RAM memory: nVidia Corporation nForce2 Memory Controller 2 (rev c1)

00:00.5 RAM memory: nVidia Corporation nForce2 Memory Controller 5 (rev c1)

00:01.0 ISA bridge: nVidia Corporation nForce2 ISA Bridge (rev a4)

00:01.1 SMBus: nVidia Corporation nForce2 SMBus (MCP) (rev a2)

00:02.0 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)

00:02.1 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)

00:02.2 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)

00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97 Audio Controler (MCP) (rev a1)

00:08.0 PCI bridge: nVidia Corporation nForce2 External PCI Bridge (rev a3)

00:09.0 IDE interface: nVidia Corporation nForce2 IDE (rev a2)

00:1e.0 PCI bridge: nVidia Corporation nForce2 AGP (rev c1)

01:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

01:0d.0 Mass storage controller: Silicon Image, Inc. SiI 3112 [SATALink/SATARaid] Serial ATA Controller (rev 02)

01:0e.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)

02:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5500] (rev a1)

 # lsmod

Module                  Size  Used by

usb_storage            30020  4

nvidia               4542676  12

snd_intel8x0           25372  3

nvidia_agp              5660  1

it87                   16356  0

hwmon_vid               2240  1 it87

eeprom                  5200  0

i2c_isa                 3328  1 it87

i2c_nforce2             5504  0

usbhid                 37408  0

```

----------

## paul.marsh

Hello,

Not quite sure if it is the same issue but my udev would not create the sd[n] file in /dev until I added:

RC_DEVFSD_STARTUP="yes" in /etc/conf.d/rc

This udev guide was linked off http://gentoo-wiki.com and had good information.

I am using 2.6.16-gentoo-r13 and sys-apps/baselayout-1.12.5-r2. Not sure why the option was missing from rc.

Top marks for your investigation  :Very Happy: 

----------

## psychomunky

Thankyou paul.marsh.  I'll try that when I get home.

----------

## psychomunky

OMG....paul.marsh you are amazing.  Adding that option to the /etc/conf.d/rc fixed the issue of hotplug not working.  I must have done a baselayout upgrade during my previous playing which broke things.  I am going to file a bug about this.

It has also got KDE detecting connects and disconnects now and prompting me for different options upon connect.  I am going to reboot once more just to make certain this is fixed.

-- EDIT --

Just finished a reboot and things are still working.  I will update this thread once I file a bug or find a related bug for baselayout-1.12.5-r2.

----------

## psychomunky

Okay WTF???  Left my machine running for like 24 hours then the USB stuff stopped working again.  Rebooted and things are still fubar. I haven't touched the kernel, hotplug or anything.....

Booted the 2006.1 install disk and everything is peachy....before I submit a bug or switch distros, I'll try an older kernel.

----------

## psychomunky

OKay...it seems that the EHCI component of the kernel is the culprit.  It also happens on other distros for me like kubuntu and the gentoo install cd.  Once I disable the EHCI driver completely in the kernel, USB hotplugging seems to work fine.

It would sporadically work with EHCI, but if the device (usually my USB key), was disconnected (even without mounting), then the whole of the USB subsystem would hang, except for the devices that were coldplugged.

I am wondering if this is a bug in the EHCI kernel, or caused by another USB device on my system??  I am pretty certain it is not a hardware related item, as at one time quite a few kernel versions ago, I had EHCI enabled and everything worked beautifully.

Any ideas would be appreciated.

----------

## psychomunky

I found this link today:

http://groups.google.ca/group/linux.kernel/browse_thread/thread/adf460ef7a1d0452/eb4f8be0e1fcf961?lnk=st&q=ehci_hcd&rnum=2#eb4f8be0e1fcf961

it seems that my hunch about the ehci stuff being the culprit may have been right.  Anyways, i manually applied the patch to my kernel (gentoo-sources-2.6.18-r1), rebuilt, rebooted and then tried some USB2 devices.  All seem to be working as expected now.

I filed the following bug:

https://bugs.gentoo.org/show_bug.cgi?id=154752

----------

