Userspace can't access i2c devices (missing i2c entries in /dev)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
SRU justification:
Impact: userspace code cannot access i2c devices until the i2c-chardev module is loaded (and thus people might think they are not working/it's a kernel bug)
Fix: build in i2c-chardev
Test case: boot a kernel with i2c-chardev compiled in and look for i2c entries in /dev:
[flag@luxor linux]$ ls -la /dev/i2c*
crw-rw---- 1 root i2c 89, 0 Feb 2 09:33 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Feb 2 09:33 /dev/i2c-1
crw-rw---- 1 root i2c 89, 2 Feb 2 09:33 /dev/i2c-2
crw-rw---- 1 root i2c 89, 3 Feb 2 09:33 /dev/i2c-3
crw-rw---- 1 root i2c 89, 4 Feb 2 09:33 /dev/i2c-4
crw-rw---- 1 root i2c 89, 5 Feb 2 09:33 /dev/i2c-5
crw-rw---- 1 root i2c 89, 6 Feb 2 09:33 /dev/i2c-6
crw-rw---- 1 root i2c 89, 7 Feb 2 09:33 /dev/i2c-7
--
My board has an i2c bus (and devices attached to it), but the corresponding /dev entries are missing and userspace can't access these devices until the i2c-dev module is loaded:
[flag@luxor ~]$ ls -la /sys/bus/
total 0
drwxr-xr-x 2 root root 0 Feb 2 08:38 .
drwxr-xr-x 4 root root 0 Feb 2 08:38 ..
lrwxrwxrwx 1 root root 0 Feb 2 09:28 i2c-0 -> ../../.
lrwxrwxrwx 1 root root 0 Feb 2 09:28 i2c-1 -> ../../.
lrwxrwxrwx 1 root root 0 Feb 2 09:28 i2c-2 -> ../../.
lrwxrwxrwx 1 root root 0 Feb 2 09:28 i2c-3 -> ../../.
lrwxrwxrwx 1 root root 0 Feb 2 09:28 i2c-4 -> ../../.
lrwxrwxrwx 1 root root 0 Feb 2 09:28 i2c-5 -> ../../.
lrwxrwxrwx 1 root root 0 Feb 2 09:28 i2c-6 -> ../../.
lrwxrwxrwx 1 root root 0 Feb 2 09:28 i2c-7 -> ../../.
[flag@luxor ~]$ i2cdetect -l
[flag@luxor ~]$ ls -la /dev/i2c*
ls: cannot access /dev/i2c*: No such file or directory
[flag@luxor ~]$
[flag@luxor ~]$ sudo modprobe i2c-dev
[flag@luxor ~]$ ls -la /dev/i2c*
crw-rw---- 1 root i2c 89, 0 Feb 2 09:33 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Feb 2 09:33 /dev/i2c-1
crw-rw---- 1 root i2c 89, 2 Feb 2 09:33 /dev/i2c-2
crw-rw---- 1 root i2c 89, 3 Feb 2 09:33 /dev/i2c-3
crw-rw---- 1 root i2c 89, 4 Feb 2 09:33 /dev/i2c-4
crw-rw---- 1 root i2c 89, 5 Feb 2 09:33 /dev/i2c-5
crw-rw---- 1 root i2c 89, 6 Feb 2 09:33 /dev/i2c-6
crw-rw---- 1 root i2c 89, 7 Feb 2 09:33 /dev/i2c-7
[flag@luxor ~]$ i2cdetect -l
i2c-0 unknown Radeon i2c bit bus 0x90 N/A
i2c-1 unknown Radeon i2c bit bus 0x91 N/A
i2c-2 unknown Radeon i2c bit bus 0x92 N/A
i2c-3 unknown Radeon i2c bit bus 0x93 N/A
i2c-4 unknown Radeon i2c bit bus 0x94 N/A
i2c-5 unknown Radeon i2c bit bus 0x95 N/A
i2c-6 unknown Radeon i2c bit bus 0x96 N/A
i2c-7 unknown Radeon i2c bit bus 0x97 N/A
[flag@luxor ~]$
Since the module is not automatically loaded, and there's no clue to load it if i2c devices fail to work (and people reported it as a bug), i propose to build it statically (it adds ~8k to the uncompressed kernel image).
description: | updated |
description: | updated |
Changed in linux (Ubuntu): | |
status: | Incomplete → Fix Committed |
This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:
apport-collect 1417032
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.