Skip to content

i2c: smbus: Handle stuck alerts

Guenter Roeck linux-i2c lkml 1 version Applied

Status from this message: Applied to for-current (with the minor changes mentioned before),

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 16 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2i2c: smbus: Improve handling of stuck alertsdrivers/i2c/i2c-smbus.c+24 -62 replies
2/2i2c: smbus: Send alert notifications to all devices if source not founddrivers/i2c/i2c-smbus.c+36 -28 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] i2c: smbus: Handle stuck alerts

While playing with SMBus alert functionality, I noticed the following messages if alert was active on more than once device.

smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0 smbus_alert 3-000c: no driver alert()!

or:

smbus_alert 3-000c: SMBALERT# from dev 0x28, flag 0

This is seen if multiple devices assert alert at the same time and at least one of them does not or not correctly implement SMBus arbitration.

Once it starts, this message repeats forever at high rate. Worst case, the problem turn resulted in system crashes after a while.

The following two patches fix the problem for me. The first patch aborts the endless loop in smbus_alert() if no handler is found for an alert address. The second patch sends alerts to all devices with alert handler if that situation is observed.

I split the changes into two patches since I figured that the first patch might be easier to accept. However, both patches are really needed to fix the problem for good.

Note that there is one situation which is not addressed by this set of
patches: If the corrupted address points to yet another device with alert handler on the same bus, the alert handler of that device will be called. If it is not a source of the alert, we are back to the original problem. I do not know how to address this case.

----------------------------------------------------------------
Guenter Roeck (2):
i2c: smbus: Improve handling of stuck alerts
i2c: smbus: Send alert notifications to all devices if source not found

 drivers/i2c/i2c-smbus.c | 64 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 58 insertions(+), 6 deletions(-)