Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73196 - usb storage device not usable when HAL is running
Summary: usb storage device not usable when HAL is running
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-03 00:24 UTC by Surakshan Mendis
Modified: 2005-01-14 22:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Surakshan Mendis 2004-12-03 00:24:52 UTC
I have a generic "thumb drive" 256MB.
I've had it successfully working under Gentoo and 2.6 kernels for a while.

More recently this particular device stopped working. It however works on Redhat, Windows. My other mass storage devices, namely my ipod mini, and Sony digital camer a continue to work on the same Gentoo setup. The thumb drive works perfectly on other systems mentioned above.

When I plug the thumb drive: dmesg shows this.

scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor:           Model: USB DISK Pro      Rev: 1.09
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 504832 512-byte hdwr sectors (258 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda:<4>usb 1-6: control timeout on ep0in
usb 1-6: control timeout on ep0in
usb 1-6: control timeout on ep0in
usb 1-6: control timeout on ep0in

Now f I replug the device 2 things can happen
a) the same error
b) nothing, in which cause the usb subsystem has died and plugging my ipod won't even work (the ipod system doesn't say its pluged). interestingly my keyboard and mouse function (they are usb as well). 

I have found stopping HAL or hotplug (I'm sure its hal) fixes this problem. That is I don't get the timeout error above and I can mount the drive. I test this by stopping hotplug which then stops HAL.

To put a spanner in the works, I am certain this occurs with 2.6.9 and not 2.6.7 kernel as well.

Reproducible: Always
Steps to Reproduce:
1. Make sure HAL is running
2. Plugin generic usb thumbdrive


Actual Results:  
ep0in timeout errors,
devices partition number eg /dev/sdaX (X doesnt' appear)
may crash usb system, ie pluging other devices may not response after this.

Device in question works perfectly without HAL, works in Windows and Redhad FC2

Expected Results:  
mount and use the device

NB: bug occurs regardless of GCC version (I'm using 3.4.3 at the moment)

Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.4.3, glibc-2.3.4.20040808-r1,
 2.6.9 i686)
=================================================================
System uname: 2.6.9 i686 Intel(R) Pentium(R) 4 CPU 2.66GHz
Gentoo Base System version 1.4.16
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux26-headers-2.6.8.1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2
/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /
usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/dis
tributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb bitmap-fonts cdr crypt cups divx4linux eds encod
e esd f77 fam flac foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 hal
imagemagick imlib java jpeg junit libg++ libwww lirc mad mikmod mmx motif mpeg m
ppe-mppc mysql ncurses network nls nptl oggvorbis opengl oss pam pdflib perl pic
 png ppds python quicktime readline rtc samba sdl slang spell sqlite ssl svga tc
ltk tcpd tiff truetype x86 xml xml2 xv xvid zlib"
Comment 1 Surakshan Mendis 2004-12-03 12:33:55 UTC
Just to clarify (i've done more testing)

1. Problem occurs with Development-sources-2.6.9 WITH hal/hotplug.

1.1 Turning off hotplug which causes hal to turn off as well allows me to plug the device and mount it.

1.2 other storage devices, eg ipod and sony camera work regardless of hal/hotplug running or not

2. Problem DOES NOT OCCUR in development-sources-2.6.7 with hal/hotplug. 
2.1 Thus turning hal/hotplug on/off doesn't do anything, the drive works regardless.

Something in the kernel has changed.
So I'm thinking now that perhaps the kernel is trying it initalize the drive (2.6.9) and hal is trying to do something at the same time, and the device is stalling. Perhaps its hardware related AND kernel related hence it works on 2.6.7 and not 2.6.9 and perhaps explains why the ipod and camera continue to work regardless.
Comment 2 Surakshan Mendis 2004-12-03 18:27:10 UTC
Obvious work around with 2.6.9 is to stop HAL, plug device, start HAL. Everything works fine. Downside is root access is needed to stop HAL
Comment 3 foser (RETIRED) gentoo-dev 2004-12-12 14:50:50 UTC
what hal version are you currently using ? You don't happen to use usbd ?
Comment 4 Surakshan Mendis 2004-12-12 22:58:23 UTC
I don't use usbd -- should I be?
Hal is 0.4.1, it happens with 0.2.98-r1 WITH development-sources-2.6.9 and the device in question.

If I use 2.6.7 then it works with HAL.
It only works 2.6.9 if I turn hal off.

I'm reluctant to try HAL 0.4.2 as it requires util-linux-2.12i which is also in ~x86
Comment 5 foser (RETIRED) gentoo-dev 2004-12-13 03:24:19 UTC
no you shouldn't use usbd .. well given the kernel change fixes it, i bet its some sort of kernel thing that breaks it. But i am aware of any serious hal breakage until the 2.6.10 series came along. kernel guys got any clues ?

hal 0.4.2 might help, but looking at the changelog i don't really see anything relevant to your situation being added.
Comment 6 Surakshan Mendis 2004-12-13 03:37:47 UTC
Could this be mildly related?
http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg27982.html

ie, HAL is trying to get info, and the kernel is trying to get info and so it stalls (in relation to above url)
Comment 7 Surakshan Mendis 2005-01-14 22:33:16 UTC
it appears kernel 2.6.10 fixes this problem... (or a hal update, though I'm certain its 2.6.10)