• Guenter Roeck's avatar
    i2c: smbus: Send alert notifications to all devices if source not found · f6c29f71
    Guenter Roeck authored
    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: b5527a77 ("i2c: Add SMBus alert support")
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    [wsa: fixed a typo in the commit message]
    Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
    f6c29f71
i2c-smbus.c 11.9 KB