Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: smbus: Don't filter out duplicate alerts

Getting the same alert twice in a row is legal and normal,
especially on a fast device (like running in qemu). Kind of
like interrupts. So don't report duplicate alerts, and deliver
them normally.

[JD: Fixed subject]

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Corey Minyard and committed by
Wolfram Sang
dca0dd28 790591f4

-7
-7
drivers/i2c/i2c-smbus.c
··· 66 66 { 67 67 struct i2c_smbus_alert *alert = d; 68 68 struct i2c_client *ara; 69 - unsigned short prev_addr = 0; /* Not a valid address */ 70 69 71 70 ara = alert->ara; 72 71 ··· 89 90 data.addr = status >> 1; 90 91 data.type = I2C_PROTOCOL_SMBUS_ALERT; 91 92 92 - if (data.addr == prev_addr) { 93 - dev_warn(&ara->dev, "Duplicate SMBALERT# from dev " 94 - "0x%02x, skipping\n", data.addr); 95 - break; 96 - } 97 93 dev_dbg(&ara->dev, "SMBALERT# from dev 0x%02x, flag %d\n", 98 94 data.addr, data.data); 99 95 100 96 /* Notify driver for the device which issued the alert */ 101 97 device_for_each_child(&ara->adapter->dev, &data, 102 98 smbus_do_alert); 103 - prev_addr = data.addr; 104 99 } 105 100 106 101 return IRQ_HANDLED;