]> err.no Git - linux-2.6/commitdiff
i2c-i801: Properly report bus arbitration loss
authorJean Delvare <khali@linux-fr.org>
Mon, 14 Jul 2008 20:38:32 +0000 (22:38 +0200)
committerJean Delvare <khali@mahadeva.delvare>
Mon, 14 Jul 2008 20:38:32 +0000 (22:38 +0200)
Bit BUS_ERR of the status register means that the ICH host controller
lost the arbitration. Report this event as such.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/busses/i2c-i801.c

index 965905fb5d56220992d4f97a7e248916fe1e1b2f..614c9e4ffba3f7f03e2273cf4d6904df7ea30845 100644 (file)
@@ -179,10 +179,8 @@ static int i801_transaction(int xact)
        }
 
        if (temp & SMBHSTSTS_BUS_ERR) {
-               result = -EIO;
-               dev_err(&I801_dev->dev, "Bus collision! SMBus may be locked "
-                       "until next hard reset. (sorry!)\n");
-               /* Clock stops and slave is stuck in mid-transmission */
+               result = -EAGAIN;
+               dev_dbg(&I801_dev->dev, "Lost arbitration\n");
        }
 
        if (temp & SMBHSTSTS_DEV_ERR) {
@@ -339,8 +337,8 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
                        dev_dbg(&I801_dev->dev,
                                "Error: Failed bus transaction\n");
                } else if (temp & SMBHSTSTS_BUS_ERR) {
-                       result = -EIO;
-                       dev_err(&I801_dev->dev, "Bus collision!\n");
+                       result = -EAGAIN;
+                       dev_dbg(&I801_dev->dev, "Lost arbitration\n");
                } else if (temp & SMBHSTSTS_DEV_ERR) {
                        result = -ENXIO;
                        dev_dbg(&I801_dev->dev, "Error: no response!\n");