diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2013-04-10 14:54:50 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:07:53 -0700 |
commit | 8d61dc8a7bcfe5688a4efd8c0215cd9700bfe85d (patch) | |
tree | 4a6dd621af98c84dc742f689179dca510d726fc4 /drivers/i2c | |
parent | 93f1f073ec34c38cc4fca0edf5e53381785cc40d (diff) |
i2c: tegra: move error prints from isr to caller context
To reduce the interrupt processing time in the isr, moving
the warning/error prints from isr context to caller context
as the status of errors are already saved.
bug 1243783
Change-Id: Ib99801d47658af509948d56780bbf612267ec0c4
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/218169
Reviewed-by: Chaitanya Bandi <bandik@nvidia.com>
Reviewed-by: Antti Miettinen <amiettinen@nvidia.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-tegra.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 25cd44fdf2ee..6c820ebf1530 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -629,7 +629,7 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id) status = i2c_readl(i2c_dev, I2C_INT_STATUS); if (status == 0) { - dev_warn(i2c_dev->dev, "unknown interrupt Add 0x%02x\n", + dev_dbg(i2c_dev->dev, "unknown interrupt Add 0x%02x\n", i2c_dev->msg_add); i2c_dev->msg_err |= I2C_ERR_UNKNOWN_INTERRUPT; @@ -644,7 +644,7 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id) dev_dbg(i2c_dev->dev, "I2c error status 0x%08x\n", status); if (status & I2C_INT_NO_ACK) { i2c_dev->msg_err |= I2C_ERR_NO_ACK; - dev_warn(i2c_dev->dev, "no acknowledge from address" + dev_dbg(i2c_dev->dev, "no acknowledge from address" " 0x%x\n", i2c_dev->msg_add); dev_dbg(i2c_dev->dev, "Packet status 0x%08x\n", i2c_readl(i2c_dev, I2C_PACKET_TRANSFER_STATUS)); @@ -652,7 +652,7 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id) if (status & I2C_INT_ARBITRATION_LOST) { i2c_dev->msg_err |= I2C_ERR_ARBITRATION_LOST; - dev_warn(i2c_dev->dev, "arbitration lost during " + dev_dbg(i2c_dev->dev, "arbitration lost during " " communicate to add 0x%x\n", i2c_dev->msg_add); dev_dbg(i2c_dev->dev, "Packet status 0x%08x\n", i2c_readl(i2c_dev, I2C_PACKET_TRANSFER_STATUS)); @@ -660,7 +660,7 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id) if (status & I2C_INT_TX_FIFO_OVERFLOW) { i2c_dev->msg_err |= I2C_INT_TX_FIFO_OVERFLOW; - dev_warn(i2c_dev->dev, "Tx fifo overflow during " + dev_dbg(i2c_dev->dev, "Tx fifo overflow during " " communicate to add 0x%x\n", i2c_dev->msg_add); dev_dbg(i2c_dev->dev, "Packet status 0x%08x\n", i2c_readl(i2c_dev, I2C_PACKET_TRANSFER_STATUS)); @@ -676,7 +676,7 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id) && (status == I2C_INT_TX_FIFO_DATA_REQ) && i2c_dev->msg_read && i2c_dev->msg_buf_remaining)) { - dev_warn(i2c_dev->dev, "unexpected status\n"); + dev_dbg(i2c_dev->dev, "unexpected status\n"); i2c_dev->msg_err |= I2C_ERR_UNEXPECTED_STATUS; if (!i2c_dev->irq_disabled) { @@ -937,6 +937,23 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, if (likely(i2c_dev->msg_err == I2C_ERR_NONE)) return 0; + /* Prints errors */ + if (i2c_dev->msg_err & I2C_ERR_UNKNOWN_INTERRUPT) + dev_warn(i2c_dev->dev, "unknown interrupt Add 0x%02x\n", + i2c_dev->msg_add); + if (i2c_dev->msg_err & I2C_ERR_NO_ACK) + dev_warn(i2c_dev->dev, "no acknowledge from address 0x%x\n", + i2c_dev->msg_add); + if (i2c_dev->msg_err & I2C_ERR_ARBITRATION_LOST) + dev_warn(i2c_dev->dev, "arb lost in communicate to add 0x%x\n", + i2c_dev->msg_add); + if (i2c_dev->msg_err & I2C_INT_TX_FIFO_OVERFLOW) + dev_warn(i2c_dev->dev, "Tx fifo overflow to add 0x%x\n", + i2c_dev->msg_add); + if (i2c_dev->msg_err & I2C_ERR_UNEXPECTED_STATUS) + dev_warn(i2c_dev->dev, "unexpected status to add 0x%x\n", + i2c_dev->msg_add); + if ((i2c_dev->chipdata->timeout_irq_occurs_before_bus_inactive) && (i2c_dev->msg_err == I2C_ERR_NO_ACK)) { /* |