[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1330979585-29429-1-git-send-email-alexandre.bounine@idt.com>
Date: Mon, 5 Mar 2012 15:33:05 -0500
From: Alexandre Bounine <alexandre.bounine@....com>
To: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org
Cc: Alexandre Bounine <alexandre.bounine@....com>,
Chul Kim <chul.kim@....com>,
Matt Porter <mporter@...nel.crashing.org>
Subject: [PATCH] rapidio/tsi721: fix bug in inbound doorbell handler
Fixes queue wrapping bug in Inbound Doorbell handling routine.
Signed-off-by: Alexandre Bounine <alexandre.bounine@....com>
Cc: Chul Kim <chul.kim@....com>
Cc: Matt Porter <mporter@...nel.crashing.org>
---
This patch is applicable to kernel version 3.2 and after.
drivers/rapidio/devices/tsi721.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index babbede..c746e26 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -406,13 +406,14 @@ static void tsi721_db_dpc(struct work_struct *work)
*/
mport = priv->mport;
- wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE));
- rd_ptr = ioread32(priv->regs + TSI721_IDQ_RP(IDB_QUEUE));
+ wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
+ rd_ptr = ioread32(priv->regs + TSI721_IDQ_RP(IDB_QUEUE)) % IDB_QSIZE;
while (wr_ptr != rd_ptr) {
idb_entry = (u64 *)(priv->idb_base +
(TSI721_IDB_ENTRY_SIZE * rd_ptr));
rd_ptr++;
+ rd_ptr %= IDB_QSIZE;
idb.msg = *idb_entry;
*idb_entry = 0;
--
1.7.8.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists