x86, lpc, Allow only one load of lpc_ich
Subsystems (2)
PATCH 1/1 x86, lpc, Allow only one load of lpc_ich
On multi-socket systems the following confusing splats are seen:
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
lpc_ich: Resource conflict(s) found affecting gpio_ich
------------[ cut here ]------------ WARNING: CPU: 7 PID: 1813 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() sysfs: cannot create duplicate filename '/bus/platform/devices/iTCO_wdt' Modules linked in: lpc_ich(+) crc32c_intel shpchp mfd_core acpi_cpufreq i2c_i801 dca xfs libcrc32c sd_mod crc_t10dif crct10dif_common ata_generic pata_acpi mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm mptsas drm scsi_transport_sas ata_piix mptscsih i2ccore libata mptbase dm_mirror dm_region_hash dm_log dm_mod CPU: 7 PID: 1813 Comm: systemd-udevd Not tainted 3.17.0-rc3+ #1 Hardware name: IBM System x3950 M3 -[7145AC1]-/Node 1, Processor Card, BIOS -[G0E130WUS-1.31]- 07/23/2010 0000000000000000 00000000f205abcf ffff88066bb7b8d0 ffffffff81647056 ffff88066bb7b918 ffff88066bb7b908 ffffffff81072c9d ffff880273d05000 ffff88027349d110 ffff880874c5cc30 0000000000000001 ffffffffffffffef Call Trace: [<ffffffff81647056>] dump_stack+0x45/0x56 [<ffffffff81072c9d>] warn_slowpath_common+0x7d/0xa0 [<ffffffff81072d1c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff81256598>] ? kernfs_path+0x48/0x60 [<ffffffff81259e34>] sysfs_warn_dup+0x64/0x80 [<ffffffff8125a1b1>] sysfs_do_create_link_sd.isra.2+0xc1/0xd0 [<ffffffff8125a1e5>] sysfs_create_link+0x25/0x50 [<ffffffff81401689>] bus_add_device+0x119/0x200 [<ffffffff813ff4b8>] device_add+0x498/0x630 [<ffffffff810778f6>] ? __insert_resource+0x26/0x150 [<ffffffff81404391>] platform_device_add+0xd1/0x2d0 [<ffffffffa050b3f5>] mfd_add_device+0x285/0x320 [mfd_core] [<ffffffffa050b705>] mfd_add_devices+0xb5/0x9b0 [mfd_core] [<ffffffffa0abf55b>] lpc_ich_probe+0x3cb/0x600 [lpc_ich] [<ffffffff8132eb55>] local_pci_probe+0x45/0xa0 [<ffffffff8132fd45>] ? pci_match_device+0xe5/0x110 [<ffffffff8132fea9>] pci_device_probe+0xf9/0x150 [<ffffffff814024b0>] driver_probe_device+0x90/0x3c0 [<ffffffff814028b3>] __driver_attach+0x93/0xa0 [<ffffffff81402820>] ? __device_attach+0x40/0x40 [<ffffffff814003f3>] bus_for_each_dev+0x73/0xc0 [<ffffffff81401f4e>] driver_attach+0x1e/0x20 [<ffffffff81401b30>] bus_add_driver+0x180/0x250 [<ffffffffa0acb000>] ? 0xffffffffa0acb000 [<ffffffff81403094>] driver_register+0x64/0xf0 [<ffffffff8132e4ec>] __pci_register_driver+0x4c/0x50 [<ffffffffa0acb01e>] lpc_ich_driver_init+0x1e/0x1000 [lpc_ich] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811c2fed>] ? kfree+0xfd/0x140 [<ffffffff811a8b42>] ? __vunmap+0xb2/0x100 [<ffffffff810f2839>] load_module+0x1619/0x1a70 [<ffffffff810edde0>] ? store_uevent+0x70/0x70 [<ffffffff810eea39>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f2e46>] SyS_finit_module+0xa6/0xd0 [<ffffffff8164f069>] system_call_fastpath+0x16/0x1b ---[ end trace 1429eb73c1995841 ]--- ------------[ cut here ]------------ WARNING: CPU: 71 PID: 1813 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() sysfs: cannot create duplicate filename '/bus/platform/devices/gpio_ich' Modules linked in: serio_raw lpc_ich(+) crc32c_intel shpchp mfd_core acpi_cpufreq i2c_i801 dca xfs libcrc32c sd_mod crc_t10dif crct10dif_common ata_generic pata_acpi mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm mptsas drm scsi_transport_sas ata_piix mptscsih i2ccore libata mptbase dm_mirror dm_region_hash dm_log dm_mod CPU: 71 PID: 1813 Comm: systemd-udevd Tainted: G W 3.17.0-rc3+ #1 Hardware name: IBM System x3950 M3 -[7145AC1]-/Node 1, Processor Card, BIOS -[G0E130WUS-1.31]- 07/23/2010 0000000000000000 00000000f205abcf ffff88066bb7b8d0 ffffffff81647056 ffff88066bb7b918 ffff88066bb7b908 ffffffff81072c9d ffff88027382d000 ffff880273640030 ffff880874c5cc30 0000000000000001 ffffffffffffffef Call Trace: [<ffffffff81647056>] dump_stack+0x45/0x56 [<ffffffff81072c9d>] warn_slowpath_common+0x7d/0xa0 [<ffffffff81072d1c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff81256598>] ? kernfs_path+0x48/0x60 [<ffffffff81259e34>] sysfs_warn_dup+0x64/0x80 [<ffffffff8125a1b1>] sysfs_do_create_link_sd.isra.2+0xc1/0xd0 [<ffffffff8125a1e5>] sysfs_create_link+0x25/0x50 [<ffffffff81401689>] bus_add_device+0x119/0x200 [<ffffffff813ff4b8>] device_add+0x498/0x630 [<ffffffff810778f6>] ? __insert_resource+0x26/0x150 [<ffffffff81404391>] platform_device_add+0xd1/0x2d0 [<ffffffffa050b3f5>] mfd_add_device+0x285/0x320 [mfd_core] [<ffffffffa050b705>] mfd_add_devices+0xb5/0x9b0 [mfd_core] [<ffffffffa0abf464>] lpc_ich_probe+0x2d4/0x600 [lpc_ich] [<ffffffff8132eb55>] local_pci_probe+0x45/0xa0 [<ffffffff8132fd45>] ? pci_match_device+0xe5/0x110 [<ffffffff8132fea9>] pci_device_probe+0xf9/0x150 [<ffffffff814024b0>] driver_probe_device+0x90/0x3c0 [<ffffffff814028b3>] __driver_attach+0x93/0xa0 [<ffffffff81402820>] ? __device_attach+0x40/0x40 [<ffffffff814003f3>] bus_for_each_dev+0x73/0xc0 [<ffffffff81401f4e>] driver_attach+0x1e/0x20 [<ffffffff81401b30>] bus_add_driver+0x180/0x250 [<ffffffffa0acb000>] ? 0xffffffffa0acb000 [<ffffffff81403094>] driver_register+0x64/0xf0 [<ffffffff8132e4ec>] __pci_register_driver+0x4c/0x50 [<ffffffffa0acb01e>] lpc_ich_driver_init+0x1e/0x1000 [lpc_ich] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811c2fed>] ? kfree+0xfd/0x140 [<ffffffff811a8b42>] ? __vunmap+0xb2/0x100 [<ffffffff810f2839>] load_module+0x1619/0x1a70 [<ffffffff810edde0>] ? store_uevent+0x70/0x70 [<ffffffff810eea39>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f2e46>] SyS_finit_module+0xa6/0xd0 [<ffffffff8164f069>] system_call_fastpath+0x16/0x1b ---[ end trace 1429eb73c1995842 ]--- lpc_ich 0000:80:1f.0: No MFD cells added
This occurs because there are two LPC devices on the system:
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller 80:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
which AFAICT is a hardware configuration error that can be resolved in firmware by hiding the second LPC device. Having two of these results in two GPIO mappings and two Watchdog Timers which doesn't make much sense.
An end user has no idea what the splats mean. We should inform the user that the issue lies with the hardware and that they should contact their vendor for resolution.
After the patch, the following warning is displayed:
lpc_ich 0000:80:1f.0: [Firmware Bug]: This system has two LPC devices. Additional driver loads would result in multiple GPIO and Watchdog Devices being initialized. Please report this problem to your hardware vendor.
--- drivers/mfd/lpc_ich.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/mfd/lpc_ich.c +6 -1
@@ -998,12 +998,17 @@ wdt_done:return ret; } +static bool cell_added;static int lpc_ich_probe (struct pci_dev *dev,const struct pci_device_id *id) {struct lpc_ich_priv *priv;int ret; -bool cell_added = false; + +if (cell_added) { +dev_warn (&dev->dev,FW_BUG "This system has two LPC devices. Additional driver loads would result in multiple GPIO and Watchdog Devices being initialized. Please report this problem to your hardware vendor.\n" ); +return -EBUSY ; + } priv =devm_kzalloc (&dev->dev,sizeof (struct lpc_ich_priv ),GFP_KERNEL );
Signature · 1 line
1.7.9.3
[PATCH] x86, lpc, Allow only one load of lpc_ich
Please use $SUBJECT format corresponding to the subsystem.
This is not an X86 patch, it's an MFD one.
I would expecte to see something along the lines of:
mfd: lpc_ich: Prevent LCP devices from probing twice
Quoted 7 lines · Prarit Bhargava
On multi-socket systems the following confusing splats are seen:
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
lpc_ich: Resource conflict(s) found affectinggpio_ich------------[ cut here ]------------ WARNING: CPU: 7 PID: 1813 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() sysfs: cannot create duplicate filename '/bus/platform/devices/iTCO_wdt'
All this from here
------------------8<--------------------
Quoted 36 lines
Modules linked in: lpc_ich(+) crc32c_intel shpchp mfd_core acpi_cpufreq i2c_i801 dca xfs libcrc32c sd_mod crc_t10dif crct10dif_common ata_generic pata_acpi mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm mptsas drm scsi_transport_sas ata_piix mptscsih i2ccore libata mptbase dm_mirror dm_region_hash dm_log dm_mod CPU: 7 PID: 1813 Comm: systemd-udevd Not tainted 3.17.0-rc3+ #1 Hardware name: IBM System x3950 M3 -[7145AC1]-/Node 1, Processor Card, BIOS -[G0E130WUS-1.31]- 07/23/2010 0000000000000000 00000000f205abcf ffff88066bb7b8d0 ffffffff81647056 ffff88066bb7b918 ffff88066bb7b908 ffffffff81072c9d ffff880273d05000 ffff88027349d110 ffff880874c5cc30 0000000000000001 ffffffffffffffef Call Trace: [<ffffffff81647056>] dump_stack+0x45/0x56 [<ffffffff81072c9d>] warn_slowpath_common+0x7d/0xa0 [<ffffffff81072d1c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff81256598>] ? kernfs_path+0x48/0x60 [<ffffffff81259e34>] sysfs_warn_dup+0x64/0x80 [<ffffffff8125a1b1>] sysfs_do_create_link_sd.isra.2+0xc1/0xd0 [<ffffffff8125a1e5>] sysfs_create_link+0x25/0x50 [<ffffffff81401689>] bus_add_device+0x119/0x200 [<ffffffff813ff4b8>] device_add+0x498/0x630 [<ffffffff810778f6>] ? __insert_resource+0x26/0x150 [<ffffffff81404391>] platform_device_add+0xd1/0x2d0 [<ffffffffa050b3f5>] mfd_add_device+0x285/0x320 [mfd_core] [<ffffffffa050b705>] mfd_add_devices+0xb5/0x9b0 [mfd_core] [<ffffffffa0abf55b>] lpc_ich_probe+0x3cb/0x600 [lpc_ich] [<ffffffff8132eb55>] local_pci_probe+0x45/0xa0 [<ffffffff8132fd45>] ? pci_match_device+0xe5/0x110 [<ffffffff8132fea9>] pci_device_probe+0xf9/0x150 [<ffffffff814024b0>] driver_probe_device+0x90/0x3c0 [<ffffffff814028b3>] __driver_attach+0x93/0xa0 [<ffffffff81402820>] ? __device_attach+0x40/0x40 [<ffffffff814003f3>] bus_for_each_dev+0x73/0xc0 [<ffffffff81401f4e>] driver_attach+0x1e/0x20 [<ffffffff81401b30>] bus_add_driver+0x180/0x250 [<ffffffffa0acb000>] ? 0xffffffffa0acb000 [<ffffffff81403094>] driver_register+0x64/0xf0 [<ffffffff8132e4ec>] __pci_register_driver+0x4c/0x50 [<ffffffffa0acb01e>] lpc_ich_driver_init+0x1e/0x1000 [lpc_ich] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811c2fed>] ? kfree+0xfd/0x140
Quoted 8 lines
[<ffffffff811a8b42>] ? __vunmap+0xb2/0x100 [<ffffffff810f2839>] load_module+0x1619/0x1a70 [<ffffffff810edde0>] ? store_uevent+0x70/0x70 [<ffffffff810eea39>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f2e46>] SyS_finit_module+0xa6/0xd0 [<ffffffff8164f069>] system_call_fastpath+0x16/0x1b ---[ end trace 1429eb73c1995841 ]--- ------------[ cut here ]------------
------------------8<--------------------
To here.
Quoted 2 lines
WARNING: CPU: 71 PID: 1813 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() sysfs: cannot create duplicate filename '/bus/platform/devices/gpio_ich'
And from here:
------------------8<--------------------
Quoted 36 lines
Modules linked in: serio_raw lpc_ich(+) crc32c_intel shpchp mfd_core acpi_cpufreq i2c_i801 dca xfs libcrc32c sd_mod crc_t10dif crct10dif_common ata_generic pata_acpi mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm mptsas drm scsi_transport_sas ata_piix mptscsih i2ccore libata mptbase dm_mirror dm_region_hash dm_log dm_mod CPU: 71 PID: 1813 Comm: systemd-udevd Tainted: G W 3.17.0-rc3+ #1 Hardware name: IBM System x3950 M3 -[7145AC1]-/Node 1, Processor Card, BIOS -[G0E130WUS-1.31]- 07/23/2010 0000000000000000 00000000f205abcf ffff88066bb7b8d0 ffffffff81647056 ffff88066bb7b918 ffff88066bb7b908 ffffffff81072c9d ffff88027382d000 ffff880273640030 ffff880874c5cc30 0000000000000001 ffffffffffffffef Call Trace: [<ffffffff81647056>] dump_stack+0x45/0x56 [<ffffffff81072c9d>] warn_slowpath_common+0x7d/0xa0 [<ffffffff81072d1c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff81256598>] ? kernfs_path+0x48/0x60 [<ffffffff81259e34>] sysfs_warn_dup+0x64/0x80 [<ffffffff8125a1b1>] sysfs_do_create_link_sd.isra.2+0xc1/0xd0 [<ffffffff8125a1e5>] sysfs_create_link+0x25/0x50 [<ffffffff81401689>] bus_add_device+0x119/0x200 [<ffffffff813ff4b8>] device_add+0x498/0x630 [<ffffffff810778f6>] ? __insert_resource+0x26/0x150 [<ffffffff81404391>] platform_device_add+0xd1/0x2d0 [<ffffffffa050b3f5>] mfd_add_device+0x285/0x320 [mfd_core] [<ffffffffa050b705>] mfd_add_devices+0xb5/0x9b0 [mfd_core] [<ffffffffa0abf464>] lpc_ich_probe+0x2d4/0x600 [lpc_ich] [<ffffffff8132eb55>] local_pci_probe+0x45/0xa0 [<ffffffff8132fd45>] ? pci_match_device+0xe5/0x110 [<ffffffff8132fea9>] pci_device_probe+0xf9/0x150 [<ffffffff814024b0>] driver_probe_device+0x90/0x3c0 [<ffffffff814028b3>] __driver_attach+0x93/0xa0 [<ffffffff81402820>] ? __device_attach+0x40/0x40 [<ffffffff814003f3>] bus_for_each_dev+0x73/0xc0 [<ffffffff81401f4e>] driver_attach+0x1e/0x20 [<ffffffff81401b30>] bus_add_driver+0x180/0x250 [<ffffffffa0acb000>] ? 0xffffffffa0acb000 [<ffffffff81403094>] driver_register+0x64/0xf0 [<ffffffff8132e4ec>] __pci_register_driver+0x4c/0x50 [<ffffffffa0acb01e>] lpc_ich_driver_init+0x1e/0x1000 [lpc_ich] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811c2fed>] ? kfree+0xfd/0x140
Quoted 8 lines
[<ffffffff811a8b42>] ? __vunmap+0xb2/0x100 [<ffffffff810f2839>] load_module+0x1619/0x1a70 [<ffffffff810edde0>] ? store_uevent+0x70/0x70 [<ffffffff810eea39>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f2e46>] SyS_finit_module+0xa6/0xd0 [<ffffffff8164f069>] system_call_fastpath+0x16/0x1b ---[ end trace 1429eb73c1995842 ]--- lpc_ich 0000:80:1f.0: No MFD cells added
------------------8<--------------------
To here - should be removed from the commit log.
Quoted 5 lines
This occurs because there are two LPC devices on the system:
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller 80:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
Quoted 7 lines
which AFAICT is a hardware configuration error that can be resolved in firmware by hiding the second LPC device. Having two of these results in two GPIO mappings and two Watchdog Timers which doesn't make much sense.
An end user has no idea what the splats mean. We should inform the user that the issue lies with the hardware and that they should contact their vendor for resolution.
Why is it a problem for 2 of these devices to exist on a single system?
Shouldn't the driver just be able to handle 2 devices?
Quoted 3 lines
After the patch, the following warning is displayed:
lpc_ich0000:80:1f.0: [Firmware Bug]: This system has two LPC devices. Additional driver loads would result in multiple GPIO and Watchdog Devices being initialized. Please report this problem to your hardware vendor.
Your commit log goes way over 72 chars here.
Quoted 13 lines
Cc Peter Tyser <[email protected]>Cc Samuel Ortiz <[email protected]>Cc Lee Jones <[email protected]>Signed-off-by Prarit Bhargava <[email protected]>--- drivers/mfd/lpc_ich.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/mfd/lpc_ich.c +0
-0
drivers/mfd/lpc_ich.c wdt_done: · line 1001
Quoted 4 lines
drivers/mfd/lpc_ich.c +1
-0@@ -998,12 +998,17 @@ wdt_done:return ret; } +static bool cell_added;
Why have you globalised this?
drivers/mfd/lpc_ich.c wdt_done: · line 1009
Quoted 9 lines
drivers/mfd/lpc_ich.c +3
-1static int lpc_ich_probe (struct pci_dev *dev,const struct pci_device_id *id) {struct lpc_ich_priv *priv;int ret; -bool cell_added = false; + +if (cell_added) { +dev_warn (&dev->dev,FW_BUG "This system has two LPC devices. Additional driver loads would result in multiple GPIO and Watchdog Devices being initialized. Please report this problem to your hardware vendor.\n" );
Did you run this patch through checkpatch.pl?
drivers/mfd/lpc_ich.c wdt_done: · line 1010
Quoted 1 line
drivers/mfd/lpc_ich.c +1
-0+return -EBUSY ;
You print a warning, but return an error here. One of them is wrong.
But why is it a problem for two of these devices to exist anyway?
Quoted 4 lines
drivers/mfd/lpc_ich.c +1
-0+ } priv =devm_kzalloc (&dev->dev,sizeof (struct lpc_ich_priv ),GFP_KERNEL );
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 9 lines · Lee Jones
[PATCH] x86, lpc, Allow only one load of
lpc_ichPlease use $SUBJECT format corresponding to the subsystem.
This is not an X86 patch, it's an MFD one.
I would expecte to see something along the lines of:
mfd:
lpc_ich: Prevent LCP devices from probing twice
Sure, okay ... I was unsure as this relates only to x86 IIUC.
Quoted 115 lines · Prarit Bhargava
Quoted 7 lines
On multi-socket systems the following confusing splats are seen:
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
lpc_ich: Resource conflict(s) found affectinggpio_ich------------[ cut here ]------------ WARNING: CPU: 7 PID: 1813 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() sysfs: cannot create duplicate filename '/bus/platform/devices/iTCO_wdt'All this from here
------------------8<--------------------
Quoted 36 lines
Modules linked in: lpc_ich(+) crc32c_intel shpchp mfd_core acpi_cpufreq i2c_i801 dca xfs libcrc32c sd_mod crc_t10dif crct10dif_common ata_generic pata_acpi mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm mptsas drm scsi_transport_sas ata_piix mptscsih i2ccore libata mptbase dm_mirror dm_region_hash dm_log dm_mod CPU: 7 PID: 1813 Comm: systemd-udevd Not tainted 3.17.0-rc3+ #1 Hardware name: IBM System x3950 M3 -[7145AC1]-/Node 1, Processor Card, BIOS -[G0E130WUS-1.31]- 07/23/2010 0000000000000000 00000000f205abcf ffff88066bb7b8d0 ffffffff81647056 ffff88066bb7b918 ffff88066bb7b908 ffffffff81072c9d ffff880273d05000 ffff88027349d110 ffff880874c5cc30 0000000000000001 ffffffffffffffef Call Trace: [<ffffffff81647056>] dump_stack+0x45/0x56 [<ffffffff81072c9d>] warn_slowpath_common+0x7d/0xa0 [<ffffffff81072d1c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff81256598>] ? kernfs_path+0x48/0x60 [<ffffffff81259e34>] sysfs_warn_dup+0x64/0x80 [<ffffffff8125a1b1>] sysfs_do_create_link_sd.isra.2+0xc1/0xd0 [<ffffffff8125a1e5>] sysfs_create_link+0x25/0x50 [<ffffffff81401689>] bus_add_device+0x119/0x200 [<ffffffff813ff4b8>] device_add+0x498/0x630 [<ffffffff810778f6>] ? __insert_resource+0x26/0x150 [<ffffffff81404391>] platform_device_add+0xd1/0x2d0 [<ffffffffa050b3f5>] mfd_add_device+0x285/0x320 [mfd_core] [<ffffffffa050b705>] mfd_add_devices+0xb5/0x9b0 [mfd_core] [<ffffffffa0abf55b>] lpc_ich_probe+0x3cb/0x600 [lpc_ich] [<ffffffff8132eb55>] local_pci_probe+0x45/0xa0 [<ffffffff8132fd45>] ? pci_match_device+0xe5/0x110 [<ffffffff8132fea9>] pci_device_probe+0xf9/0x150 [<ffffffff814024b0>] driver_probe_device+0x90/0x3c0 [<ffffffff814028b3>] __driver_attach+0x93/0xa0 [<ffffffff81402820>] ? __device_attach+0x40/0x40 [<ffffffff814003f3>] bus_for_each_dev+0x73/0xc0 [<ffffffff81401f4e>] driver_attach+0x1e/0x20 [<ffffffff81401b30>] bus_add_driver+0x180/0x250 [<ffffffffa0acb000>] ? 0xffffffffa0acb000 [<ffffffff81403094>] driver_register+0x64/0xf0 [<ffffffff8132e4ec>] __pci_register_driver+0x4c/0x50 [<ffffffffa0acb01e>] lpc_ich_driver_init+0x1e/0x1000 [lpc_ich] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811c2fed>] ? kfree+0xfd/0x140Quoted 8 lines
[<ffffffff811a8b42>] ? __vunmap+0xb2/0x100 [<ffffffff810f2839>] load_module+0x1619/0x1a70 [<ffffffff810edde0>] ? store_uevent+0x70/0x70 [<ffffffff810eea39>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f2e46>] SyS_finit_module+0xa6/0xd0 [<ffffffff8164f069>] system_call_fastpath+0x16/0x1b ---[ end trace 1429eb73c1995841 ]--- ------------[ cut here ]------------------------------8<--------------------
To here.
Quoted 2 lines
WARNING: CPU: 71 PID: 1813 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() sysfs: cannot create duplicate filename '/bus/platform/devices/gpio_ich'And from here:
------------------8<--------------------
Quoted 36 lines
Modules linked in: serio_raw lpc_ich(+) crc32c_intel shpchp mfd_core acpi_cpufreq i2c_i801 dca xfs libcrc32c sd_mod crc_t10dif crct10dif_common ata_generic pata_acpi mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm mptsas drm scsi_transport_sas ata_piix mptscsih i2ccore libata mptbase dm_mirror dm_region_hash dm_log dm_mod CPU: 71 PID: 1813 Comm: systemd-udevd Tainted: G W 3.17.0-rc3+ #1 Hardware name: IBM System x3950 M3 -[7145AC1]-/Node 1, Processor Card, BIOS -[G0E130WUS-1.31]- 07/23/2010 0000000000000000 00000000f205abcf ffff88066bb7b8d0 ffffffff81647056 ffff88066bb7b918 ffff88066bb7b908 ffffffff81072c9d ffff88027382d000 ffff880273640030 ffff880874c5cc30 0000000000000001 ffffffffffffffef Call Trace: [<ffffffff81647056>] dump_stack+0x45/0x56 [<ffffffff81072c9d>] warn_slowpath_common+0x7d/0xa0 [<ffffffff81072d1c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff81256598>] ? kernfs_path+0x48/0x60 [<ffffffff81259e34>] sysfs_warn_dup+0x64/0x80 [<ffffffff8125a1b1>] sysfs_do_create_link_sd.isra.2+0xc1/0xd0 [<ffffffff8125a1e5>] sysfs_create_link+0x25/0x50 [<ffffffff81401689>] bus_add_device+0x119/0x200 [<ffffffff813ff4b8>] device_add+0x498/0x630 [<ffffffff810778f6>] ? __insert_resource+0x26/0x150 [<ffffffff81404391>] platform_device_add+0xd1/0x2d0 [<ffffffffa050b3f5>] mfd_add_device+0x285/0x320 [mfd_core] [<ffffffffa050b705>] mfd_add_devices+0xb5/0x9b0 [mfd_core] [<ffffffffa0abf464>] lpc_ich_probe+0x2d4/0x600 [lpc_ich] [<ffffffff8132eb55>] local_pci_probe+0x45/0xa0 [<ffffffff8132fd45>] ? pci_match_device+0xe5/0x110 [<ffffffff8132fea9>] pci_device_probe+0xf9/0x150 [<ffffffff814024b0>] driver_probe_device+0x90/0x3c0 [<ffffffff814028b3>] __driver_attach+0x93/0xa0 [<ffffffff81402820>] ? __device_attach+0x40/0x40 [<ffffffff814003f3>] bus_for_each_dev+0x73/0xc0 [<ffffffff81401f4e>] driver_attach+0x1e/0x20 [<ffffffff81401b30>] bus_add_driver+0x180/0x250 [<ffffffffa0acb000>] ? 0xffffffffa0acb000 [<ffffffff81403094>] driver_register+0x64/0xf0 [<ffffffff8132e4ec>] __pci_register_driver+0x4c/0x50 [<ffffffffa0acb01e>] lpc_ich_driver_init+0x1e/0x1000 [lpc_ich] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811c2fed>] ? kfree+0xfd/0x140Quoted 8 lines
[<ffffffff811a8b42>] ? __vunmap+0xb2/0x100 [<ffffffff810f2839>] load_module+0x1619/0x1a70 [<ffffffff810edde0>] ? store_uevent+0x70/0x70 [<ffffffff810eea39>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f2e46>] SyS_finit_module+0xa6/0xd0 [<ffffffff8164f069>] system_call_fastpath+0x16/0x1b ---[ end trace 1429eb73c1995842 ]--- lpc_ich 0000:80:1f.0: No MFD cells added
Quoted 3 lines
------------------8<--------------------
To here - should be removed from the commit log.
No, that's not the right thing to do. A lot of other commit log messages contain backtraces. If I do it your way we lose the log of exactly what the bug was and how it appeared.
See recent commits 39b5552cd5090d4c210d278cd2732f493075f033, and 5e3c516b512c0f8f18359413b04918f6347f67e7 for examples.
Quoted 10 lines
Quoted 10 lines
This occurs because there are two LPC devices on the system:
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller 80:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
which AFAICT is a hardware configuration error that can be resolved in firmware by hiding the second LPC device. Having two of these results in two GPIO mappings and two Watchdog Timers which doesn't make much sense.
Quoted 8 lines
Quoted 3 lines
An end user has no idea what the splats mean. We should inform the user that the issue lies with the hardware and that they should contact their vendor for resolution.
Why is it a problem for 2 of these devices to exist on a single system?
Shouldn't the driver just be able to handle 2 devices?
You end up with two watchdogs on the same system (and more confusingly they use the same global interface). Additionally you end up with two sets of GPIOs which also use the same global interface ... not good. I asked Intel about this earlier and they said it was an error on FW/HW; a suggestion was made that the vendor hide the second devices in FW.
Quoted 5 lines
Quoted 3 lines
After the patch, the following warning is displayed:
lpc_ich0000:80:1f.0: [Firmware Bug]: This system has two LPC devices. Additional driver loads would result in multiple GPIO and Watchdog Devices being initialized. Please report this problem to your hardware vendor.Your commit log goes way over 72 chars here.
For *years* we haven't conformed to this style requirement. Please don't do it here.
Quoted 17 lines
Quoted 17 lines
Cc Peter Tyser <[email protected]>Cc Samuel Ortiz <[email protected]>Cc Lee Jones <[email protected]>Signed-off-by Prarit Bhargava <[email protected]>--- drivers/mfd/lpc_ich.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/mfd/lpc_ich.c +0
-0@@ -998,12 +998,17 @@ wdt_done:return ret; }
Quoted 4 lines
drivers/mfd/lpc_ich.c wdt_done: · line 1001
Quoted 1 line
drivers/mfd/lpc_ich.c +1
-0+static bool cell_added;Why have you globalised this?
See below.
Quoted 6 lines
drivers/mfd/lpc_ich.c wdt_done: · line 1006
Quoted 6 lines
drivers/mfd/lpc_ich.c +0
-1static int lpc_ich_probe (struct pci_dev *dev,const struct pci_device_id *id) {struct lpc_ich_priv *priv;int ret; -bool cell_added = false;
I thought about making this a 'static bool' here, but that violates CodingStyle IIUC. Admittedly I've seen some exceptions over the years about the declaration of statics within functions so maybe this is one of them. I'll leave it up to the maintainer to make a decision.
Peter -- any objection to making this a static here?
Quoted 5 lines
drivers/mfd/lpc_ich.c wdt_done: · line 1009
Quoted 3 lines
drivers/mfd/lpc_ich.c +3
-0+ +if (cell_added) { +dev_warn (&dev->dev,FW_BUG "This system has two LPC devices. Additional driver loads would result in multiple GPIO and Watchdog Devices being initialized. Please report this problem to your hardware vendor.\n" );Did you run this patch through checkpatch.pl?
Yes, and output messages are okay as we search for these in the code. Breaks result in not finding error messages easily.
Quoted 5 lines
drivers/mfd/lpc_ich.c wdt_done: · line 1010
Quoted 2 lines
drivers/mfd/lpc_ich.c +1
-0+return -EBUSY ;You print a warning, but return an error here. One of them is wrong.
I suppose dev_bug() might be more appropriate, but bug implies an absolute failure of the driver which hasn't happened here. The first device has loaded the driver.
Quoted 2 lines
But why is it a problem for two of these devices to exist anyway?
The big issue is that we initialize two iTCO_wdt's and two sets of GPIOs -- the system should only have one o/w we'll end up in a bizarre state of two watchdog timers and GPIOs. I asked Intel about this previously and they said that it is not expected that two exist on the same platform.
P.
Quoted 5 lines
Quoted 4 lines
drivers/mfd/lpc_ich.c +1
-0+ } priv =devm_kzalloc (&dev->dev,sizeof (struct lpc_ich_priv ),GFP_KERNEL );
Quoted 5 lines · Prarit Bhargava
Quoted 4 lines · Lee Jones
[PATCH] x86, lpc, Allow only one load of
lpc_ichPlease use $SUBJECT format corresponding to the subsystem.
Quoted 7 lines
Quoted 5 lines
This is not an X86 patch, it's an MFD one.
I would expecte to see something along the lines of:
mfd:
lpc_ich: Prevent LCP devices from probing twiceSure, okay ... I was unsure as this relates only to x86 IIUC.
It doesn't matter if the driver is pinned to a particular architecture, your patch is fixing an MFD driver which resides only in the MFD subsystem, thus it is an MFD patch.
Quoted 116 lines
Quoted 116 lines · Prarit Bhargava
Quoted 7 lines
On multi-socket systems the following confusing splats are seen:
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
lpc_ich: Resource conflict(s) found affectinggpio_ich------------[ cut here ]------------ WARNING: CPU: 7 PID: 1813 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() sysfs: cannot create duplicate filename '/bus/platform/devices/iTCO_wdt'All this from here
------------------8<--------------------
Quoted 36 lines
Modules linked in: lpc_ich(+) crc32c_intel shpchp mfd_core acpi_cpufreq i2c_i801 dca xfs libcrc32c sd_mod crc_t10dif crct10dif_common ata_generic pata_acpi mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm mptsas drm scsi_transport_sas ata_piix mptscsih i2ccore libata mptbase dm_mirror dm_region_hash dm_log dm_mod CPU: 7 PID: 1813 Comm: systemd-udevd Not tainted 3.17.0-rc3+ #1 Hardware name: IBM System x3950 M3 -[7145AC1]-/Node 1, Processor Card, BIOS -[G0E130WUS-1.31]- 07/23/2010 0000000000000000 00000000f205abcf ffff88066bb7b8d0 ffffffff81647056 ffff88066bb7b918 ffff88066bb7b908 ffffffff81072c9d ffff880273d05000 ffff88027349d110 ffff880874c5cc30 0000000000000001 ffffffffffffffef Call Trace: [<ffffffff81647056>] dump_stack+0x45/0x56 [<ffffffff81072c9d>] warn_slowpath_common+0x7d/0xa0 [<ffffffff81072d1c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff81256598>] ? kernfs_path+0x48/0x60 [<ffffffff81259e34>] sysfs_warn_dup+0x64/0x80 [<ffffffff8125a1b1>] sysfs_do_create_link_sd.isra.2+0xc1/0xd0 [<ffffffff8125a1e5>] sysfs_create_link+0x25/0x50 [<ffffffff81401689>] bus_add_device+0x119/0x200 [<ffffffff813ff4b8>] device_add+0x498/0x630 [<ffffffff810778f6>] ? __insert_resource+0x26/0x150 [<ffffffff81404391>] platform_device_add+0xd1/0x2d0 [<ffffffffa050b3f5>] mfd_add_device+0x285/0x320 [mfd_core] [<ffffffffa050b705>] mfd_add_devices+0xb5/0x9b0 [mfd_core] [<ffffffffa0abf55b>] lpc_ich_probe+0x3cb/0x600 [lpc_ich] [<ffffffff8132eb55>] local_pci_probe+0x45/0xa0 [<ffffffff8132fd45>] ? pci_match_device+0xe5/0x110 [<ffffffff8132fea9>] pci_device_probe+0xf9/0x150 [<ffffffff814024b0>] driver_probe_device+0x90/0x3c0 [<ffffffff814028b3>] __driver_attach+0x93/0xa0 [<ffffffff81402820>] ? __device_attach+0x40/0x40 [<ffffffff814003f3>] bus_for_each_dev+0x73/0xc0 [<ffffffff81401f4e>] driver_attach+0x1e/0x20 [<ffffffff81401b30>] bus_add_driver+0x180/0x250 [<ffffffffa0acb000>] ? 0xffffffffa0acb000 [<ffffffff81403094>] driver_register+0x64/0xf0 [<ffffffff8132e4ec>] __pci_register_driver+0x4c/0x50 [<ffffffffa0acb01e>] lpc_ich_driver_init+0x1e/0x1000 [lpc_ich] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811c2fed>] ? kfree+0xfd/0x140Quoted 8 lines
[<ffffffff811a8b42>] ? __vunmap+0xb2/0x100 [<ffffffff810f2839>] load_module+0x1619/0x1a70 [<ffffffff810edde0>] ? store_uevent+0x70/0x70 [<ffffffff810eea39>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f2e46>] SyS_finit_module+0xa6/0xd0 [<ffffffff8164f069>] system_call_fastpath+0x16/0x1b ---[ end trace 1429eb73c1995841 ]--- ------------[ cut here ]------------------------------8<--------------------
To here.
Quoted 2 lines
WARNING: CPU: 71 PID: 1813 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() sysfs: cannot create duplicate filename '/bus/platform/devices/gpio_ich'And from here:
------------------8<--------------------
Quoted 36 lines
Modules linked in: serio_raw lpc_ich(+) crc32c_intel shpchp mfd_core acpi_cpufreq i2c_i801 dca xfs libcrc32c sd_mod crc_t10dif crct10dif_common ata_generic pata_acpi mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ttm mptsas drm scsi_transport_sas ata_piix mptscsih i2ccore libata mptbase dm_mirror dm_region_hash dm_log dm_mod CPU: 71 PID: 1813 Comm: systemd-udevd Tainted: G W 3.17.0-rc3+ #1 Hardware name: IBM System x3950 M3 -[7145AC1]-/Node 1, Processor Card, BIOS -[G0E130WUS-1.31]- 07/23/2010 0000000000000000 00000000f205abcf ffff88066bb7b8d0 ffffffff81647056 ffff88066bb7b918 ffff88066bb7b908 ffffffff81072c9d ffff88027382d000 ffff880273640030 ffff880874c5cc30 0000000000000001 ffffffffffffffef Call Trace: [<ffffffff81647056>] dump_stack+0x45/0x56 [<ffffffff81072c9d>] warn_slowpath_common+0x7d/0xa0 [<ffffffff81072d1c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff81256598>] ? kernfs_path+0x48/0x60 [<ffffffff81259e34>] sysfs_warn_dup+0x64/0x80 [<ffffffff8125a1b1>] sysfs_do_create_link_sd.isra.2+0xc1/0xd0 [<ffffffff8125a1e5>] sysfs_create_link+0x25/0x50 [<ffffffff81401689>] bus_add_device+0x119/0x200 [<ffffffff813ff4b8>] device_add+0x498/0x630 [<ffffffff810778f6>] ? __insert_resource+0x26/0x150 [<ffffffff81404391>] platform_device_add+0xd1/0x2d0 [<ffffffffa050b3f5>] mfd_add_device+0x285/0x320 [mfd_core] [<ffffffffa050b705>] mfd_add_devices+0xb5/0x9b0 [mfd_core] [<ffffffffa0abf464>] lpc_ich_probe+0x2d4/0x600 [lpc_ich] [<ffffffff8132eb55>] local_pci_probe+0x45/0xa0 [<ffffffff8132fd45>] ? pci_match_device+0xe5/0x110 [<ffffffff8132fea9>] pci_device_probe+0xf9/0x150 [<ffffffff814024b0>] driver_probe_device+0x90/0x3c0 [<ffffffff814028b3>] __driver_attach+0x93/0xa0 [<ffffffff81402820>] ? __device_attach+0x40/0x40 [<ffffffff814003f3>] bus_for_each_dev+0x73/0xc0 [<ffffffff81401f4e>] driver_attach+0x1e/0x20 [<ffffffff81401b30>] bus_add_driver+0x180/0x250 [<ffffffffa0acb000>] ? 0xffffffffa0acb000 [<ffffffff81403094>] driver_register+0x64/0xf0 [<ffffffff8132e4ec>] __pci_register_driver+0x4c/0x50 [<ffffffffa0acb01e>] lpc_ich_driver_init+0x1e/0x1000 [lpc_ich] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811c2fed>] ? kfree+0xfd/0x140Quoted 8 lines
[<ffffffff811a8b42>] ? __vunmap+0xb2/0x100 [<ffffffff810f2839>] load_module+0x1619/0x1a70 [<ffffffff810edde0>] ? store_uevent+0x70/0x70 [<ffffffff810eea39>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f2e46>] SyS_finit_module+0xa6/0xd0 [<ffffffff8164f069>] system_call_fastpath+0x16/0x1b ---[ end trace 1429eb73c1995842 ]--- lpc_ich 0000:80:1f.0: No MFD cells added------------------8<--------------------
Quoted 8 lines
Quoted 1 line
To here - should be removed from the commit log.
No, that's not the right thing to do. A lot of other commit log messages contain backtraces. If I do it your way we lose the log of exactly what the bug was and how it appeared.
See recent commits
39b5552cd5090d4c210d278cd2732f493075f033, and5e3c516b512c0f8f18359413b04918f6347f67e7for examples.
I don't want this kind depth of information in the commit log for such a simple bug - most of it is useless cruft. I can understand if the stack-trace was unusual or would aid in debugging, but providing full back-trace comprising mostly of a standard driver bind is not helpful and its over-complicated nature actually detracts from the issue. Keep it succinct. The driver was bound twice and some mechanisms which are designed to only run once were repeated causing a warning.
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
This occurs because there are two LPC devices on the system:
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller 80:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
which AFAICT is a hardware configuration error that can be resolved in firmware by hiding the second LPC device. Having two of these results in two GPIO mappings and two Watchdog Timers which doesn't make much sense.
An end user has no idea what the splats mean. We should inform the user that the issue lies with the hardware and that they should contact their vendor for resolution.
Quoted 8 lines
Quoted 4 lines
Why is it a problem for 2 of these devices to exist on a single system?
Shouldn't the driver just be able to handle 2 devices?
You end up with two watchdogs on the same system (and more confusingly they use the same global interface). Additionally you end up with two sets of GPIOs which also use the same global interface ... not good.
I understand the problem with the _driver_, but why is it a problem that two of these _devices_ exist on one system? Bailing out of the second .probe() sounds hacky to me. The driver should know that this is possible and act accordingly, or the second devices shouldn't be registered.
Can these devices be controlled seperately? Perhaps some more background on what these devices to and how they are used might help to lift the fog a little.
Quoted 3 lines
I asked Intel about this
earlier and they said it was an error on FW/HW; a suggestion was made that the vendor hide the second devices in FW.
Well until they do that we have to handle these cases gracefully. Once I get a handle on what's really going on here, I can help to suggest something a little less hacky.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
After the patch, the following warning is displayed:
lpc_ich0000:80:1f.0: [Firmware Bug]: This system has two LPC devices. Additional driver loads would result in multiple GPIO and Watchdog Devices being initialized. Please report this problem to your hardware vendor.Your commit log goes way over 72 chars here.
For *years* we haven't conformed to this style requirement. Please don't do it here.
Who's we?
Please read and adhere to Documentation/SubmittingPatches:
"For these reasons, the "summary" must be no more than 70-75
characters, and it must describe both what the patch changes, as well as why the patch might be necessary. It is challenging to be both succinct and descriptive, but that is what a well-written summary should do."
... failure to do so will result in non-acceptance of your patch.
Quoted 23 lines
Quoted 16 lines
Quoted 16 lines
Cc Peter Tyser <[email protected]>Cc Samuel Ortiz <[email protected]>Cc Lee Jones <[email protected]>Signed-off-by Prarit Bhargava <[email protected]>--- drivers/mfd/lpc_ich.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/mfd/lpc_ich.c +0
-0@@ -998,12 +998,17 @@ wdt_done:return ret; }Quoted 4 lines
drivers/mfd/lpc_ich.c wdt_done: · line 1001
Quoted 1 line
drivers/mfd/lpc_ich.c +1
-0+static bool cell_added;Why have you globalised this?
See below.
Quoted 11 lines
Quoted 6 lines
drivers/mfd/lpc_ich.c wdt_done: · line 1006
Quoted 6 lines
drivers/mfd/lpc_ich.c +0
-1static int lpc_ich_probe (struct pci_dev *dev,const struct pci_device_id *id) {struct lpc_ich_priv *priv;int ret; -bool cell_added = false;I thought about making this a 'static bool' here, but that violates CodingStyle IIUC. Admittedly I've seen some exceptions over the years about the declaration of statics within functions so maybe this is one of them. I'll leave it up to the maintainer to make a decision.
Can you show me where this violation is documented please?
Quoted 10 lines
Peter -- any objection to making this a static here?
Quoted 5 lines
drivers/mfd/lpc_ich.c wdt_done: · line 1009
Quoted 3 lines
drivers/mfd/lpc_ich.c +3
-0+ +if (cell_added) { +dev_warn (&dev->dev,FW_BUG "This system has two LPC devices. Additional driver loads would result in multiple GPIO and Watchdog Devices being initialized. Please report this problem to your hardware vendor.\n" );Did you run this patch through checkpatch.pl?
Yes, and output messages are okay as we search for these in the code. Breaks result in not finding error messages easily.
This is true, split lines will also not be accepted. That's why you have to split the line and display it on separate lines in the bootlog. However, I am having trouble with this print anyway. I'd prefer to get this fixed properly. Worrying users and getting them to call Intel/PC World/Fry's for help whenever this happens sounds like the wrong thing to do.
Quoted 8 lines
Quoted 4 lines
drivers/mfd/lpc_ich.c wdt_done: · line 1010
Quoted 1 line
drivers/mfd/lpc_ich.c +1
-0+return -EBUSY ;You print a warning, but return an error here. One of them is wrong.
I suppose
dev_bug()might be more appropriate, but bug implies an absolute failure of the driver which hasn't happened here. The first device has loaded the driver.
No, if you are returning an error, you should use dev_err().
Quoted 6 lines
Quoted 2 lines
But why is it a problem for two of these devices to exist anyway?
The big issue is that we initialize two iTCO_wdt's and two sets of GPIOs -- the system should only have one o/w we'll end up in a bizarre state of two watchdog timers and GPIOs.
That's fine, we can make checks to see if these have already been registered. But what I'm confused about is; if there are two devices that exist on one platform why can't they exist as separate entities, with their own resources and act independently from one another?
Quoted 2 lines
I asked Intel about this previously and they said that it is not expected that two exist on the same platform.
Then why do they?
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
drivers/mfd/lpc_ich.c +1
-0+ } priv =devm_kzalloc (&dev->dev,sizeof (struct lpc_ich_priv ),GFP_KERNEL );
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
On 09/03/2014 07:35 AM, Lee Jones wrote:
<snip>
Quoted 23 lines
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
This occurs because there are two LPC devices on the system:
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller 80:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
Quoted 7 lines
which AFAICT is a hardware configuration error that can be resolved in firmware by hiding the second LPC device. Having two of these results in two GPIO mappings and two Watchdog Timers which doesn't make much sense.
An end user has no idea what the splats mean. We should inform the user that the issue lies with the hardware and that they should contact their vendor for resolution.
Why is it a problem for 2 of these devices to exist on a single system?
Quoted 7 lines
Quoted 2 lines
Shouldn't the driver just be able to handle 2 devices?
You end up with two watchdogs on the same system (and more confusingly they use the same global interface). Additionally you end up with two sets of GPIOs which also use the same global interface ... not good.
Quoted 7 lines
I understand the problem with the _driver_, but why is it a problem that two of these _devices_ exist on one system? Bailing out of the second .probe() sounds hacky to me. The driver should know that this is possible and act accordingly, or the second devices shouldn't be registered.
Can these devices be controlled seperately?
Let's just try and address this for now ... They can be controlled separately but that's not the issue here.
Consider just the watchdog timer (because it is easier to explain). The way the watchdog timer works is that we write to it every 30 seconds (or so ... it depends on your setup obviously). If we don't write to it within 30 seconds the system will panic and reboot.
Now ... suppose you have two on a system. To what end? It doesn't make sense to have two. Either you can write from userspace or you can't. Now you have two running with different timeouts -- why? That doesn't make sense either. It isn't like the one with the longer timeout is ever going to cause a reboot.
Does that explain things better? It's a not a real-world scenario.
You also asked ...
Quoted 1 line
Then why do they [have two devices specified]?
Because the vendor didn't/forgot to hide one from the kernel in BIOS -- hence FW_BUG.
P.
Quoted 35 lines · Prarit Bhargava
Quoted 23 lines · Lee Jones
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
This occurs because there are two LPC devices on the system:
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller 80:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
Quoted 7 lines
which AFAICT is a hardware configuration error that can be resolved in firmware by hiding the second LPC device. Having two of these results in two GPIO mappings and two Watchdog Timers which doesn't make much sense.
An end user has no idea what the splats mean. We should inform the user that the issue lies with the hardware and that they should contact their vendor for resolution.
Why is it a problem for 2 of these devices to exist on a single system?
Quoted 7 lines
Quoted 2 lines
Shouldn't the driver just be able to handle 2 devices?
You end up with two watchdogs on the same system (and more confusingly they use the same global interface). Additionally you end up with two sets of GPIOs which also use the same global interface ... not good.
Quoted 7 lines
I understand the problem with the _driver_, but why is it a problem that two of these _devices_ exist on one system? Bailing out of the second .probe() sounds hacky to me. The driver should know that this is possible and act accordingly, or the second devices shouldn't be registered.
Can these devices be controlled seperately?
Let's just try and address this for now ... They can be controlled separately but that's not the issue here.
Quoted 8 lines
Consider just the watchdog timer (because it is easier to explain). The way the watchdog timer works is that we write to it every 30 seconds (or so ... it depends on your setup obviously). If we don't write to it within 30 seconds the system will panic and reboot.
Now ... suppose you have two on a system. To what end? It doesn't make sense to have two. Either you can write from userspace or you can't. Now you have two running with different timeouts -- why? That doesn't make sense either. It
You only have 2 running if you start them both.
Quoted 3 lines
isn't like the one with the longer timeout is ever going to cause a reboot.
Does that explain things better? It's a not a real-world scenario.
On the h/w I'm currently working on, we have 3 Watchdogs.
Quoted 6 lines
You also asked ...
Quoted 1 line
Then why do they [have two devices specified]?
Because the vendor didn't/forgot to hide one from the kernel in BIOS -- hence
FW_BUG.
If only one is useful, why have the second one in the first place?
If the devices are present and we can see them, why not have 2? Some users might find a use for them.
In the WARNING you submitted only sysfs was having a hard time. Perhaps the real fix would be to allow the Watchdog and GPIO driver to change their name when registering, so they can each have their own sysfs entries.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 45 lines · Lee Jones
Quoted 35 lines · Prarit Bhargava
Quoted 23 lines · Lee Jones
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
This occurs because there are two LPC devices on the system:
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller 80:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
Quoted 7 lines
which AFAICT is a hardware configuration error that can be resolved in firmware by hiding the second LPC device. Having two of these results in two GPIO mappings and two Watchdog Timers which doesn't make much sense.
An end user has no idea what the splats mean. We should inform the user that the issue lies with the hardware and that they should contact their vendor for resolution.
Why is it a problem for 2 of these devices to exist on a single system?
Quoted 7 lines
Quoted 2 lines
Shouldn't the driver just be able to handle 2 devices?
You end up with two watchdogs on the same system (and more confusingly they use the same global interface). Additionally you end up with two sets of GPIOs which also use the same global interface ... not good.
Quoted 7 lines
I understand the problem with the _driver_, but why is it a problem that two of these _devices_ exist on one system? Bailing out of the second .probe() sounds hacky to me. The driver should know that this is possible and act accordingly, or the second devices shouldn't be registered.
Can these devices be controlled seperately?
Let's just try and address this for now ... They can be controlled separately but that's not the issue here.
Quoted 8 lines
Consider just the watchdog timer (because it is easier to explain). The way the watchdog timer works is that we write to it every 30 seconds (or so ... it depends on your setup obviously). If we don't write to it within 30 seconds the system will panic and reboot.
Now ... suppose you have two on a system. To what end? It doesn't make sense to have two. Either you can write from userspace or you can't. Now you have two running with different timeouts -- why? That doesn't make sense either. It
Quoted 7 lines
You only have 2 running if you start them both.
Quoted 3 lines
isn't like the one with the longer timeout is ever going to cause a reboot.
Does that explain things better? It's a not a real-world scenario.
On the h/w I'm currently working on, we have 3 Watchdogs.
"3": what are they? Are they all system-level watchdogs? I can understand the BMC having a watchdog, the system HW having a watchdog (which is what we're talking about here), and I'm sure we can think of other watchdogs ... but two that are EXACTLY the same?
Quoted 9 lines
Quoted 7 lines
You also asked ...
Quoted 1 line
Then why do they [have two devices specified]?
Because the vendor didn't/forgot to hide one from the kernel in BIOS -- hence
FW_BUG.If only one is useful, why have the second one in the first place?
That's just it -- it shouldn't have been exposed (again, according to Intel).
Quoted 3 lines
If the devices are present and we can see them, why not have 2? Some users might find a use for them.
No one will.
Quoted 5 lines
In the WARNING you submitted only sysfs was having a hard time. Perhaps the real fix would be to allow the Watchdog and GPIO driver to change their name when registering, so they can each have their own sysfs entries.
/me scratches head.
How does that help having multiple devices which shouldn't be exposed?
P.
Quoted 1 line
Quoted 3 lines
Quoted 1 line
If only one is useful, why have the second one in the first place?
That's just it -- it shouldn't have been exposed (again, according to Intel).
I didn't mean at an OS level, I mean what's the point of having two on the h/w. I guess only Intel may know.
Quoted 4 lines
Quoted 2 lines
If the devices are present and we can see them, why not have 2? Some users might find a use for them.
No one will.
Okay, I guess I have my hackers head on here. Perhaps this guy shouldn't probe. It just seems weird to have a device that we know about and have register access to, but we're specifying "no playing".
Quoted 8 lines
Quoted 4 lines
In the WARNING you submitted only sysfs was having a hard time. Perhaps the real fix would be to allow the Watchdog and GPIO driver to change their name when registering, so they can each have their own sysfs entries.
/me scratches head.
How does that help having multiple devices which shouldn't be exposed?
The fact that they shouldn't be exposed should be neither here nor there. I'm thinking that they are exposed, so why suffocate them. Besides, what happens when there is a use-case for two of these devices?
How are these guys being registered anyway? Does PCI detect and register them automatically?
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 71 lines · Prarit Bhargava
Quoted 45 lines · Lee Jones
Quoted 35 lines · Prarit Bhargava
Quoted 23 lines · Lee Jones
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
This occurs because there are two LPC devices on the system:
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller 80:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
Quoted 7 lines
which AFAICT is a hardware configuration error that can be resolved in firmware by hiding the second LPC device. Having two of these results in two GPIO mappings and two Watchdog Timers which doesn't make much sense.
An end user has no idea what the splats mean. We should inform the user that the issue lies with the hardware and that they should contact their vendor for resolution.
Why is it a problem for 2 of these devices to exist on a single system?
Quoted 7 lines
Quoted 2 lines
Shouldn't the driver just be able to handle 2 devices?
You end up with two watchdogs on the same system (and more confusingly they use the same global interface). Additionally you end up with two sets of GPIOs which also use the same global interface ... not good.
Quoted 7 lines
I understand the problem with the _driver_, but why is it a problem that two of these _devices_ exist on one system? Bailing out of the second .probe() sounds hacky to me. The driver should know that this is possible and act accordingly, or the second devices shouldn't be registered.
Can these devices be controlled seperately?
Let's just try and address this for now ... They can be controlled separately but that's not the issue here.
Quoted 8 lines
Consider just the watchdog timer (because it is easier to explain). The way the watchdog timer works is that we write to it every 30 seconds (or so ... it depends on your setup obviously). If we don't write to it within 30 seconds the system will panic and reboot.
Now ... suppose you have two on a system. To what end? It doesn't make sense to have two. Either you can write from userspace or you can't. Now you have two running with different timeouts -- why? That doesn't make sense either. It
Quoted 7 lines
You only have 2 running if you start them both.
Quoted 3 lines
isn't like the one with the longer timeout is ever going to cause a reboot.
Does that explain things better? It's a not a real-world scenario.
On the h/w I'm currently working on, we have 3 Watchdogs.
"3": what are they? Are they all system-level watchdogs? I can understand the BMC having a watchdog, the system HW having a watchdog (which is what we're talking about here), and I'm sure we can think of other watchdogs ... but two that are EXACTLY the same?
Quoted 9 lines
Quoted 7 lines
You also asked ...
Quoted 1 line
Then why do they [have two devices specified]?
Because the vendor didn't/forgot to hide one from the kernel in BIOS -- hence
FW_BUG.If only one is useful, why have the second one in the first place?
Quoted 8 lines
That's just it -- it shouldn't have been exposed (again, according to Intel).
Quoted 3 lines
If the devices are present and we can see them, why not have 2? Some users might find a use for them.
No one will.
Really ? I must be the "no one" then.
If available, I like using two watchdogs: One to be controlled by, say, systemd, one to be controlled by the watchdog daemon. If I have three, I might find use for it as well: One more to be controlled by whatever application is running on the system.
Sure, that may be considered overkill, but declaring that "no one will use them" if more than one watchdog is available is just not correct. After all, there was a _reason_ for introducing the capability to support more than one watchdog into the watchdog subsystem.
Similar, if there are multiple LPCs with separate GPIO pins on each in the system, I don't entirely understand why the GPIO pins on the second chip would or should be declared to be unusable. Why ?
Guenter
Peter Tyser
maintainerQuoted 21 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Then why do they [have two devices specified]?
Because the vendor didn't/forgot to hide one from the kernel in BIOS -- hence
FW_BUG.Quoted 8 lines
Quoted 1 line
If only one is useful, why have the second one in the first place?
That's just it -- it shouldn't have been exposed (again, according to Intel).>
Quoted 2 lines
If the devices are present and we can see them, why not have 2? Some users might find a use for them.
No one will.
Really ? I must be the "no one" then.
If available, I like using two watchdogs: One to be controlled by, say, systemd, one to be controlled by the watchdog daemon. If I have three, I might find use for it as well: One more to be controlled by whatever application is running on the system.
Quoted 8 lines
Sure, that may be considered overkill, but declaring that "no one will use them" if more than one watchdog is available is just not correct. After all, there was a _reason_ for introducing the capability to support more than one watchdog into the watchdog subsystem.
Similar, if there are multiple LPCs with separate GPIO pins on each in the system, I don't entirely understand why the GPIO pins on the second chip would or should be declared to be unusable. Why ?
I agree with Guenter - I'd like to support and use as many watchdogs and GPIOs as available. High reliability applications often have 2 watchdogs as a data point, and more GPIO is always nice!
Can you give more background on your hardware and firmware setup? Are there physically two ICH bridges, or just one that is showing up two times due to a firmware bug? If there are two ICH bridges, how are they wired up to your CPU? Understanding your configuration would help others give suggestions on fixes or workarounds.
Regards,
Peter
Quoted 12 lines · Peter Tyser
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Then why do they [have two devices specified]?
Because the vendor didn't/forgot to hide one from the kernel in BIOS -- hence
FW_BUG.If only one is useful, why have the second one in the first place?
That's just it -- it shouldn't have been exposed (again, according to Intel).>
Quoted 2 lines
If the devices are present and we can see them, why not have 2? Some users might find a use for them.
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
No one will.
Really ? I must be the "no one" then.
If available, I like using two watchdogs: One to be controlled by, say, systemd, one to be controlled by the watchdog daemon. If I have three, I might find use for it as well: One more to be controlled by whatever application is running on the system.
IMO you're conflating a general system watchdog with the iTCO watchdog. They're two very different things.
Quoted 5 lines
Quoted 5 lines
Sure, that may be considered overkill, but declaring that "no one will use them" if more than one watchdog is available is just not correct. After all, there was a _reason_ for introducing the capability to support more than one watchdog into the watchdog subsystem.
I thought that was to get all the various watchdogs (NMI, softlockup, fs, etc) using the same functionality? But I do see your point.
Quoted 4 lines
Quoted 4 lines
Similar, if there are multiple LPCs with separate GPIO pins on each in the system, I don't entirely understand why the GPIO pins on the second chip would or should be declared to be unusable. Why ?
Hmm ... good question. I'll have to see whether or not ACPI, etc., can even distinguish between two.
Quoted 6 lines
I agree with Guenter - I'd like to support and use as many watchdogs and GPIOs as available. High reliability applications often have 2 watchdogs as a data point, and more GPIO is always nice!
Can you give more background on your hardware and firmware setup?
Unfortunately I cannot :( The system isn't "mine" per se. It is (as the dumps show) IBM's.
Are there
Quoted 2 lines
physically two ICH bridges, or just one that is showing up two times due to a firmware bug?
I can answer that. There are two physical ICH bridges, and according to Intel one should be masked off. We shouldn't run with two.
If there are two ICH bridges, how are they wired up to your CPU?
Again, not sure if I can answer that :/.
P.
Peter Tyser
maintainerQuoted 4 lines
Quoted 1 line
Can you give more background on your hardware and firmware setup?
Unfortunately I cannot :( The system isn't "mine" per se. It is (as the dumps show) IBM's.
Can you look at the IBM manual and see info about which chipsets are used, and how they are connected?
Quoted 7 lines
Are there
Quoted 2 lines
physically two ICH bridges, or just one that is showing up two times due to a firmware bug?
I can answer that. There are two physical ICH bridges, and according to Intel one should be masked off. We shouldn't run with two.
Interesting. The "normal" setup I'm familiar with is multiple CPUs wired up
to one IOH, and that IOH would be wired up to the ICH10. There'd only be one
ICH10 in this configuration though. An example is on page 30 of
http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/5520-5500-chipset-ioh-datasheet.pdf I'm not sure how it'd be possible to wire up 2 ICH10s to one CPU?
How are you determining the number of ICH10s? You could try running "lspci - v" and comparing the PCI BARs on the duplicate devices. If the duplicate PCI devices have the same BAR values, it would indicate that there is only one ICH10. Could you send the output of "lspci -v"?
Regards,
Peter
Quoted 13 lines · Peter Tyser
Quoted 4 lines
Quoted 1 line
Can you give more background on your hardware and firmware setup?
Unfortunately I cannot :( The system isn't "mine" per se. It is (as the dumps show) IBM's.
Can you look at the IBM manual and see info about which chipsets are used, and how they are connected?
Quoted 5 lines
Are there
Quoted 2 lines
physically two ICH bridges, or just one that is showing up two times due to a firmware bug?
Quoted 9 lines
Quoted 2 lines
I can answer that. There are two physical ICH bridges, and according to Intel one should be masked off. We shouldn't run with two.
Interesting. The "normal" setup I'm familiar with is multiple CPUs wired up
to one IOH, and that IOH would be wired up to the ICH10. There'd only be one
ICH10 in this configuration though. An example is on page 30 of
http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/5520-5500-chipset-ioh-datasheet.pdf I'm not sure how it'd be possible to wire up 2 ICH10s to one CPU?
Multiple ICHs connected to multiple CPUs, maybe ?
Guenter
Quoted 19 lines · Prarit Bhargava
Quoted 16 lines · Peter Tyser
Quoted 16 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Then why do they [have two devices specified]?
Because the vendor didn't/forgot to hide one from the kernel in BIOS -- hence
FW_BUG.Quoted 8 lines
Quoted 1 line
If only one is useful, why have the second one in the first place?
That's just it -- it shouldn't have been exposed (again, according to Intel).>
Quoted 2 lines
If the devices are present and we can see them, why not have 2? Some users might find a use for them.
No one will.
Really ? I must be the "no one" then.
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
If available, I like using two watchdogs: One to be controlled by, say, systemd, one to be controlled by the watchdog daemon. If I have three, I might find use for it as well: One more to be controlled by whatever application is running on the system.
IMO you're conflating a general system watchdog with the iTCO watchdog. They're two very different things.
The lpc driver instantiates iTCO watchdogs, so yes, this is the one I refer to. Please explain its difference to a 'system watchdog', and what your understanding of a system watchdog is if it is different to the iTCO watchdog.
Quoted 2 lines
This document talks about consistent device names, so guess I must be missing something.
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Sure, that may be considered overkill, but declaring that "no one will use them" if more than one watchdog is available is just not correct. After all, there was a _reason_ for introducing the capability to support more than one watchdog into the watchdog subsystem.
I thought that was to get all the various watchdogs (NMI, softlockup, fs, etc) using the same functionality? But I do see your point.
No. It lets you, for example, use a SuperIO based watchdog _and_ the iTCO watchdog in the same system at the same time. Plus, if you want, you can add a software watchdog as well.
Quoted 18 lines
Quoted 4 lines
Quoted 4 lines
Similar, if there are multiple LPCs with separate GPIO pins on each in the system, I don't entirely understand why the GPIO pins on the second chip would or should be declared to be unusable. Why ?
Hmm ... good question. I'll have to see whether or not ACPI, etc., can even distinguish between two.
Quoted 6 lines
I agree with Guenter - I'd like to support and use as many watchdogs and GPIOs as available. High reliability applications often have 2 watchdogs as a data point, and more GPIO is always nice!
Can you give more background on your hardware and firmware setup?
Unfortunately I cannot :( The system isn't "mine" per se. It is (as the dumps show) IBM's.
Quoted 7 lines
Are there
Quoted 2 lines
physically two ICH bridges, or just one that is showing up two times due to a firmware bug?
I can answer that. There are two physical ICH bridges, and according to Intel one should be masked off. We shouldn't run with two.
But if the second chip is not masked off, what prevents the system vendor from enabling the iTCO watchdog on both, and/or the GPIO pins on both ? Plus, even if only one of the ICHs is supposed to be used, but if both are enabled by the BIOS, how is the OS supposed to know which of the two chips is the one that is supposed to be active ? How does the OS know that or if it is the first chip it encounters and not the second one ?
Thanks,
Guenter