linux
linux copied to clipboard
Issue with the w1 driver
I build Linux image using https://github.com/openbmc/openbmc/ for Ziaus machine and tried to boot the Linux using QEMU. Booted successfully, but showing the following messages periodically.
[ 125.350000] w1_master_driver w1_bus_master1: Family 0 for 00.400000000000.46 is not registered. [ 125.930000] w1_master_driver w1_bus_master3: Family 0 for 00.400000000000.46 is not registered. [ 125.930000] ------------[ cut here ]------------ [ 125.930000] WARNING: CPU: 0 PID: 399 at /kernel-source//fs/sysfs/dir.c:31 sysfs_warn_dup+0x68/0x88 [ 125.930000] sysfs: cannot create duplicate filename '/bus/w1/devices/00-400000000000' [ 125.930000] CPU: 0 PID: 399 Comm: w1_bus_master3 Tainted: G W 4.7.10-2499942f10b161f6c980e558ffa3f99402b1710e [ 125.930000] Hardware name: ASpeed SoC [ 125.930000] [<800111f4>] (unwind_backtrace) from [<8000e920>] (show_stack+0x20/0x24) [ 125.930000] [<8000e920>] (show_stack) from [<801f6184>] (dump_stack+0x20/0x28) [ 125.930000] [<801f6184>] (dump_stack) from [<8001c8ec>] (__warn+0xe0/0x108) [ 125.930000] [<8001c8ec>] (__warn) from [<8001c968>] (warn_slowpath_fmt+0x54/0x74) [ 125.930000] [<8001c968>] (warn_slowpath_fmt) from [<80160310>] (sysfs_warn_dup+0x68/0x88) [ 125.930000] [<80160310>] (sysfs_warn_dup) from [<80160610>] (sysfs_do_create_link_sd+0xb0/0xb4) [ 125.930000] [<80160610>] (sysfs_do_create_link_sd) from [<80160668>] (sysfs_create_link+0x34/0x44) [ 125.930000] [<80160668>] (sysfs_create_link) from [<8028b32c>] (bus_add_device+0x118/0x1d0) [ 125.930000] [<8028b32c>] (bus_add_device) from [<80289dd8>] (device_add+0x360/0x5c8) [ 125.930000] [<80289dd8>] (device_add) from [<8028a064>] (device_register+0x24/0x28) [ 125.930000] [<8028a064>] (device_register) from [<8032475c>] (w1_attach_slave_device+0x1a0/0x3cc) [ 125.930000] [<8032475c>] (w1_attach_slave_device) from [<80324b1c>] (w1_slave_found+0xd4/0xe0) [ 125.930000] [<80324b1c>] (w1_slave_found) from [<8032547c>] (w1_search+0x294/0x2e8) [ 125.930000] [<8032547c>] (w1_search) from [<80326774>] (w1_search_devices+0x50/0x54) [ 125.930000] [<80326774>] (w1_search_devices) from [<80325550>] (w1_search_process_cb+0x80/0x124) [ 125.980000] [<80325550>] (w1_search_process_cb) from [<80325770>] (w1_process+0x104/0x150) [ 125.980000] [<80325770>] (w1_process) from [<80038840>] (kthread+0xf4/0x108) [ 125.980000] [<80038840>] (kthread) from [<8000a718>] (ret_from_fork+0x14/0x3c) [ 125.980000] ---[ end trace e2503f9188fa9c41 ]--- [ 125.980000] w1_slave_driver 00-400000000000: Device registration [00-400000000000] failed. err=-17 [ 125.980000] w1_master_driver w1_bus_master3: w1_attach_slave_device: Attaching 00-400000000000 failed. [ 126.280000] w1_master_driver w1_bus_master2: Family 0 for 00.400000000000.46 is not registered.
Please someone help to resolve the issue.
My understanding of w1 (which is from ancient memory seeing technology demos, white papers, etc, and reading Linux kernel driver code) is that the id address, 00.400000000000.46
, is supposed to be a unique serial number of the device, so the Linux kernel does not include the master bus when creating the device name. Having the same device serial number appear on two buses causes sysfs to attempt to use the same name for the /sys/bus/w1/devices
symlink and results in the warning you listed, with the second device creation being failed back to the caller. I have seen similar issues reported (with address 800..0 iirc) when the hardware pullup was missing).
My advice is to teach your qemu machine that each w1 device has a unique serial number.
what type of w1 device are you using ? I don't know any under QEMU.
Also we don't have a zaius-bmc QEMU machine. Could you paste your QEMU command line please ?