WSL2-Linux-Kernel/drivers/i2c
Guenter Roeck 87b834b6a5 i2c: smbus: Send alert notifications to all devices if source not found
[ Upstream commit f6c29f710c1ff2590109f83be3e212b86c01e0f3 ]

If a SMBus alert is received and the originating device is not found,
the reason may be that the address reported on the SMBus alert address
is corrupted, for example because multiple devices asserted alert and
do not correctly implement SMBus arbitration.

If this happens, call alert handlers on all devices connected to the
given I2C bus, in the hope that this cleans up the situation.

This change reliably fixed the problem on a system with multiple devices
on a single bus. Example log where the device on address 0x18 (ADM1021)
and on address 0x4c (ADT7461A) both had the alert line asserted:

smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0
smbus_alert 3-000c: no driver alert()!
smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0
smbus_alert 3-000c: no driver alert()!
lm90 3-0018: temp1 out of range, please check!
lm90 3-0018: Disabling ALERT#
lm90 3-0029: Everything OK
lm90 3-002a: Everything OK
lm90 3-004c: temp1 out of range, please check!
lm90 3-004c: temp2 out of range, please check!
lm90 3-004c: Disabling ALERT#

Fixes: b5527a7766 ("i2c: Add SMBus alert support")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[wsa: fixed a typo in the commit message]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-19 05:45:42 +02:00
..
algos
busses i2c: rcar: fix error code in probe() 2024-07-18 13:07:45 +02:00
muxes i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-11-08 17:26:40 +01:00
Kconfig
Makefile
i2c-boardinfo.c
i2c-core-acpi.c i2c: acpi: Unbind mux adapters before delete 2024-07-05 09:14:13 +02:00
i2c-core-base.c i2c: mark HostNotify target address as used 2024-07-18 13:07:44 +02:00
i2c-core-of.c i2c: add fwnode APIs 2024-07-05 09:14:12 +02:00
i2c-core-slave.c
i2c-core-smbus.c
i2c-core.h i2c: core: Fix atomic xfer check for non-preempt config 2024-01-15 18:51:22 +01:00
i2c-dev.c i2c: dev: copy userspace array safely 2023-11-28 16:56:20 +00:00
i2c-mux.c i2c: mux: Avoid potential false error message in i2c_mux_add_adapter 2023-10-25 11:58:59 +02:00
i2c-slave-eeprom.c
i2c-slave-testunit.c i2c: testunit: avoid re-issued work after read message 2024-07-18 13:07:44 +02:00
i2c-smbus.c i2c: smbus: Send alert notifications to all devices if source not found 2024-08-19 05:45:42 +02:00
i2c-stub.c