summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanchayan Maity <maitysanchayan@gmail.com>2015-04-29 19:07:36 +0530
committerStefan Agner <stefan.agner@toradex.com>2015-05-04 16:11:53 +0200
commitff73aabd871910b44bea051e41c5024584b1061b (patch)
tree36645cdb7f3ec86c8793d74c6e4a3847e3d07bdb
parentfeb85c154f0a457e17c8b74e9eb2938207a76090 (diff)
drivers: w1: tegra_w1: Improve IRQ detection
On Tegra30, on a high CPU load or operating at maximum frequency results in continous interrupt generation, with the following log spewout: (tegra_w1_irq: line 236) spurious interrupt, status = 0x800 (tegra_w1_irq: line 236) spurious interrupt, status = 0x800 (tegra_w1_irq: line 236) spurious interrupt, status = 0x800 (tegra_w1_irq: line 236) spurious interrupt, status = 0x800 which shows the TX_FIFO_DATA_REQ to be somehow continously being set. To circumvent this specifically detect the bit transfer and presence done IRQ's only, for generating a "completion" signal on which the core logic waits. We anyhow only wait for these interrupts in particular. While at it, also change the error message to be printed only if it is conditionally enabled instead of all the time, which floods the serial console and allows a wrong interpretation of the one wire device not working at all. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--drivers/w1/masters/tegra_w1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/w1/masters/tegra_w1.c b/drivers/w1/masters/tegra_w1.c
index 85eefd4d7eb5..e5781abbea53 100644
--- a/drivers/w1/masters/tegra_w1.c
+++ b/drivers/w1/masters/tegra_w1.c
@@ -227,12 +227,13 @@ static irqreturn_t tegra_w1_irq(int irq, void *cookie)
spin_lock_irqsave(&dev->spinlock, irq_flags);
- if (likely(dev->transfer_completion)) {
+ if (likely(dev->transfer_completion) &&
+ ((status & OI_BIT_XFER_DONE) || (status & OI_PRESENCE_DONE))) {
dev->intr_status = status;
w1_writel(dev, status, OWR_INTR_STATUS);
complete(dev->transfer_completion);
} else {
- W1_ERR("spurious interrupt, status = 0x%lx\n", status);
+ pr_debug("spurious interrupt, status = 0x%lx\n", status);
}
spin_unlock_irqrestore(&dev->spinlock, irq_flags);