Bug 187005
| Summary: | udev does not make entries for my joystick | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Christopher Stone <tkmame> | ||||
| Component: | kernel | Assignee: | Dave Jones <davej> | ||||
| Status: | CLOSED RAWHIDE | QA Contact: | |||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 5 | CC: | harald, hdegoede, jcm, kay.sievers, nmiell, pfrields, stefan.hoelldampf, wtogami | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2006-08-23 05:16:45 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Christopher Stone
2006-03-27 22:53:15 UTC
Please paste the output of: lsmod | grep joy if it prints nothing, run: modprobe joydev and look for the nodes. It that doesn't do anything, run: udevmonitor plug in the device and paste the output here. [root@rivendell ~]# ls /dev/input event0 event1 event2 event3 event4 mice mouse0 mouse1 [root@rivendell ~]# lsmod | grep joy [root@rivendell ~]# modprobe joydev [root@rivendell ~]# lsmod | grep joy joydev 44225 0 [root@rivendell ~]# ls /dev/input event0 event1 event2 event3 event4 js0 mice mouse0 mouse1 So does this mean it's a bug somewhere else in the system? Please advise on the best course of action to take from this point. In FC4 I did not have to modprobe joydev, so it seems something is missing somewhere. Thanks for the help. Get the kernel device path: $ udevinfo -q path -n /dev/input/js0 /class/input/input5/js0 Lookup the first modalias entry of this path: $ udevinfo -a -p /class/input/input5/js0 | grep modalias Take the first string and pass it to modprobe modprobe --first-time -n -v input:b000... And please paste the command and the result here. # udevinfo -q path -n /dev/input/js0
/class/input/input4/js0
# udevinfo -a -p /class/input/input4/js0 | grep modalias
SYSFS{modalias}=="input:b0003v046DpC216e0200-e0_1_3_k120_121_122_123_124_125_126_127_128_129_12A_12B_ra0_1_2_5_10_11_mlsfw"
SYSFS{modalias}=="usb:v046DpC216d0200dc00dsc00dp00ic03isc00ip00"
SYSFS{modalias}=="pci:v000010DEd0000005Asv00001043sd0000815Abc0Csc03i10"
# modprobe --first-time -n -v
"input:b0003v046DpC216e0200-e0_1_3_k120_121_122_123_124_125_126_127_128_129_12A_12B_ra0_1_2_5_10_11_mlsfw"
FATAL: Module
input:b0003v046DpC216e0200_e0_1_3_k120_121_122_123_124_125_126_127_128_129_12A_12B_ra0_1_2_5_10_11_mlsfw
not found.
(Oh, the "'" gets replaced by "_" in udevinfo cause the value is read from sysfs, but should not be the problem and it is fixed in a later udev version) Please remove the last part of the result you get with: udevinfo -q path -n /dev/input/js0 /class/input/input4/js0 And try: udevtest /class/input/input4 And paste the result in here. # udevtest /class/input/input4 main: looking at device '/class/input/input4' from subsystem 'input' main: run: 'socket:/org/kernel/udev/monitor' main: run: '/lib/udev/udev_run_devd' main: run: 'socket:/org/freedesktop/hal/udev_event' Hmm, ok, next try :) What does: modprobe -n -v --first-time $(cat /sys/class/input/input4/modalias) print? # cat /sys/class/input/input4/modalias input:b0003v046DpC216e0200-e0,1,3,k120,121,122,123,124,125,126,127,128,129,12A,1 # modprobe -n -v --first-time $(cat /sys/class/input/input4/modalias) FATAL: Module input:b0003v046DpC216e0200_e0,1,3,k120,121,122,123,124,125,126,127,128,129,12A,12B,ra0,1,2,5,10,11,mlsfw not found. Ok, we're coming closer. What does: grep joydev /lib/modules/$(uname -r)/modules.alias print? # grep joydev /lib/modules/$(uname -r)/modules.alias alias input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w* joydev alias input:b*v*p*e*-e*3,*k*r*a*8,*28,*m*l*s*f*w* joydev alias input:b*v*p*e*-e*3,*k*r*a*6,*26,*m*l*s*f*w* joydev Ick, that should definitely work. Your modalias works fine for me (not Fedora) and matches the joydev module: modprobe -n -v --first-time input:b0003v046DpC216e0200-e0,1,3,k120,121,122,123,124,125,126,127,128,129,12A,12B,ra0,1,2,5,10,11,mlsfw FATAL: Module joydev already in kernel. Please try exactly that command if it fails to find joydev on your box. ok Im a bit confused here because it looks like none of those aliases actually match. The only one that comes close is: alias input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w* joydev but this does not match the *20 part after the r*a*0, Typing the exact command: # modprobe -n -v --first-time input:b0003v046DpC216e0200-e0,1,3,k120,121,122,123,124,125,126,127,128,129,12A,12B,ra0,1,2,5,10,11,mlsfw FATAL: Module input:b0003v046DpC216e0200_e0,1,3,k120,121,122,123,124,125,126,127,128,129,12A,12B,ra0,1,2,5,10,11,mlsfw not found. Yeah, you are right. It prints for me: grep joydev /lib/modules/$(uname -r)/modules.alias alias input:b*v*p*e*-e*3,*k*r*a*0,*m*l*s*f*w* joydev alias input:b*v*p*e*-e*3,*k*r*a*8,*m*l*s*f*w* joydev alias input:b*v*p*e*-e*3,*k*r*a*6,*m*l*s*f*w* joydev Now, let's find the difference why I have different aliases generated from the MODULE_DEVICE_TABLE macro. :) What does: uname -a and modprobe -V print. I have 2.6.16 and 3.2.2. # uname -a Linux rivendell 2.6.16-1.2080_FC5 #1 SMP Tue Mar 28 03:38:47 EST 2006 x86_64 x86_64 x86_64 GNU/Linux # modprobe -V module-init-tools version 3.2-pre9 Harald, it's likely a module-init-tools bug. module-init-tools-3.2.2/ChangeLog 3.2.2 Version: o depmod: Try to generate correct input tables for 2.6.14 and above (thanks to report from Scott James Remnant) Thank you Kay! Please test the erratum from: https://www.redhat.com/archives/fedora-test-list/2006-April/msg00052.html # rpm -q module-init-tools module-init-tools-3.2.2-0.FC5.2 # grep joydev /lib/modules/$(uname -r)/modules.alias alias input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w* joydev alias input:b*v*p*e*-e*3,*k*r*a*8,*28,*m*l*s*f*w* joydev alias input:b*v*p*e*-e*3,*k*r*a*6,*26,*m*l*s*f*w* joydev Seems the updated version of module-init-tools did not help. :( What does: /sbin/depmod -n | grep joydev print? # /sbin/depmod -n | grep joydev /lib/modules/2.6.16-1.2080_FC5/kernel/drivers/input/joydev.ko: joydev 0x90 0x0 0x0 0x0 0x0 8 0 0 1 0 0 0 0 0 0x0 joydev 0x90 0x0 0x0 0x0 0x0 8 0 0 100 0 0 0 0 0 0x0 joydev 0x90 0x0 0x0 0x0 0x0 8 0 0 40 0 0 0 0 0 0x0 alias input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w* joydev alias input:b*v*p*e*-e*3,*k*r*a*8,*28,*m*l*s*f*w* joydev alias input:b*v*p*e*-e*3,*k*r*a*6,*26,*m*l*s*f*w* joydev Hmm, strange. What's in the module itself? /sbin/modinfo joydev $ /sbin/modinfo joydev filename: /lib/modules/2.6.16-1.2080_FC5/kernel/drivers/input/joydev.ko author: Vojtech Pavlik <vojtech> description: Joystick device interfaces license: GPL vermagic: 2.6.16-1.2080_FC5 SMP gcc-4.1 depends: alias: input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*8,*28,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*6,*26,*m*l*s*f*w* srcversion: 61FB5FE89F97C26D3909D22 I asked on IRC for the output of a rawhide box with kernel-2.6.16-1.2118_FC6 and got: alias: input:b*v*p*e*-e*3,*k*r*a*0,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*8,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*6,*m*l*s*f*w* which looks fine. So it's a FC5 kernel issue? We got another box which is fine: 2.6.16-1.2080_FC5 686 REGPARM 4KSTACKS gcc-4.1 input:b*v*p*e*-e*3,*k*r*a*0,*m*l*s*f*w* input:b*v*p*e*-e*3,*k*r*a*8,*m*l*s*f*w* input:b*v*p*e*-e*3,*k*r*a*6,*m*l*s*f*w* And we found a SUSE box with kernel-smp-2.6.16_rc5_git9-2 which has the wrong alias strings too. ok.. reassigning to component kernel. *** Bug 189060 has been marked as a duplicate of this bug. *** It is identified as a module-init-tools "range pattern match" bug. Patch or new version is available. did the update work? hmm okay I rebooted into 2.6.17-1.2157_FC5 and now when I plug in my joystick I get a /dev/input/event4: # ls /dev/input ; # Before plugging in joystick event0 event1 event2 event3 mice mouse0 mouse1 # ls /dev/input ; # After plugging in joystick event0 event1 event2 event3 event4 mice mouse0 mouse1 jstest on /dev/input/event4 doesn't seem to work. The native event devices have always been created -- that isn't the problem. The problem is that joydev never gets loaded and thus /dev/js* don't get created, and apps actually use /dev/js* as opposed to the input event devices. And, no, module-init-tools-3.2.2-0.FC5.3 did not fix this. Hi all, I'm digging into this as this bug has annoyed me for long enough the problem is either with jodev.ko itself or with module-init-tools. With the latest kernel and module-init-tools from Rawhide I get: /sbin/modinfo joydev: alias: input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*8,*28,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*6,*26,*m*l*s*f*w* From which the first one in order to work for me should be: alias: input:b*v*p*e*-e*3,*k*r*a*0,*11,*m*l*s*f*w* (20 -> 11), but as commented before some other machines have: alias: input:b*v*p*e*-e*3,*k*r*a*0,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*8,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*6,*m*l*s*f*w* Thus accepting both 20 and 11, which is probably correct. With the problem narrowed down to this, there are only 2 questions left: 1) kernel or module-init-tools problem 2) locate the problem and fix it I'm now downloading the kernel and will take a look in which form this info is in the kernel sources. This is a known bug fixed in m-i-t 3.3*, see comment #27. Are you sure you run a fixed version? Works for me: [sun@sisko ~ :) 7]$ /sbin/modinfo joydev filename: /lib/modules/2.6.17-1.2462.fc6/kernel/drivers/input/joydev.ko author: Vojtech Pavlik <vojtech> description: Joystick device interfaces license: GPL vermagic: 2.6.17-1.2462.fc6 SMP mod_unload 686 REGPARM 4KSTACKS gcc-4.1 depends: alias: input:b*v*p*e*-e*3,*k*r*a*0,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*8,*m*l*s*f*w* alias: input:b*v*p*e*-e*3,*k*r*a*6,*m*l*s*f*w* srcversion: 750C0C08E65178E6C4B5E74 [sun@sisko ~ :) 8]$ rpm -q module-init-tools module-init-tools-3.3-0.pre1.4.17 rpm -q module-init-tools: module-init-tools-3.3-0.pre1.4.17.x86_64 Notice the "pre" perhaps that is the problem I'll try downloading the latest upstream and rebuilding the SRPM with the latest upstream, hopefully that will fix things. I just collided with Ralphs comment, but submitted mine anyway since it was only a comment. Thinking some more about Ralphs comment, we run the same version! But ralph is on an i386 system, so this most likely is a 64 bit related bug! Hmm, Compiling m-i-t gives this: modprobe.c: In function 'do_command': modprobe.c:786: warning: field precision should have type 'int', but argument 3 modinfo.c: In function 'main': modinfo.c:338: warning: 'infosize' may be used uninitialized in this function The modprobe warning is very likely 64 bit related, but probably unrelated to this, I'll dig into the source. Hmm, The problem is not in m-i-t, unless m-i-t injects it during the kernel build, a simple strings on /lib/modules/2.6.17-1.2505.fc6/kernel/drivers/input/joydev.ko reveals: alias=input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w* alias=input:b*v*p*e*-e*3,*k*r*a*8,*28,*m*l*s*f*w* alias=input:b*v*p*e*-e*3,*k*r*a*6,*26,*m*l*s*f*w* So the ,*20 is injected during kernel build, on x86_64 only? Getting much much closer now, the problem is in the kernel not in m-i-t,
reassigning.
The problem is somewhere in:
scripts/mod/file2alias.c
In there is the following code for generating the input aliases:
static void do_input(char *alias,
kernel_ulong_t *arr, unsigned int min, unsigned int max)
{
unsigned int i;
for (i = min; i < max; i++)
if (arr[i / BITS_PER_LONG] & (1 << (i%BITS_PER_LONG)))
sprintf(alias + strlen(alias), "%X,*", i);
}
On 32 bits systems, this correctly generates "0,*" for the first alias, "8,*"
for the second etc.
However on 64 bits it generates: "0,*20,*" resp "8,*28,*" Notice how it adds 20
+ first entry (hex) ! to the list of hex codes, which is 32 more then the first
entry, thus the bit test above appearently wraps at 32 bits instead of 64 for
some reason, or something like that. Investigating further!
Yes YES *YES*,
I nailed this nasty bug, it could very well affect other input modules too.
scripts/mod/file2alias.c, line 379 reads:
if (arr[i / BITS_PER_LONG] & (1 << (i%BITS_PER_LONG)))
That should be:
if (arr[i / BITS_PER_LONG] & (1l << (i%BITS_PER_LONG)))
Notice the added 'l' after the 1, otherwise that is an 32 bit int instead of a
64 bit long, and when that int gets shifted >= 32 times, appearantly the number
by which to shift is wrapped at 5 bits ( % 32) causing it to test a bit 32 bits
too low.
Dave, can you add this fix to the next kernel please? Read the long story above
for the rational.
Dave, I know you are really busy, put could you please spare a few minutes and take a look at this bug. Its a really annoying bug and I've hunted down the cause and provided a fix for you above. The fix is a one liner (one char actually) and is trivially correct. Thanks! Created attachment 134122 [details]
Patch fixing auto loading of jodev.ko on x86_64
Since this bug doesn't seem to be moving anywhere, despite beeing very very
easy to fix now that I've provided the fix, I've submitted a patch to fix this
upstream in the hope that this will eventually trickle down inte Fedora.
I've also attached the patch here, so that you can apply it in the mean time.
The patch has been accepted upstream by GKH and should be merged by Linus when he returns from his vacation. Kernel 2.6.17-1.2573.fc6 from rawhide has picked up the fix for this from GKH's tree, closing. |