linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rapidio/tsi721: fix bug in inbound doorbell handler
@ 2012-03-05 20:33 Alexandre Bounine
  2012-03-05 20:37 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Bounine @ 2012-03-05 20:33 UTC (permalink / raw)
  To: akpm, linux-kernel, linuxppc-dev; +Cc: Alexandre Bounine, Chul Kim, Matt Porter

Fixes queue wrapping bug in Inbound Doorbell handling routine.

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Chul Kim <chul.kim@idt.com>
Cc: Matt Porter <mporter@kernel.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rapidio/tsi721: fix bug in inbound doorbell handler
  2012-03-05 20:33 [PATCH] rapidio/tsi721: fix bug in inbound doorbell handler Alexandre Bounine
@ 2012-03-05 20:37 ` Andrew Morton
  2012-03-05 20:53   ` Bounine, Alexandre
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2012-03-05 20:37 UTC (permalink / raw)
  To: Alexandre Bounine; +Cc: linux-kernel, linuxppc-dev, Chul Kim, Matt Porter

On Mon,  5 Mar 2012 15:33:05 -0500
Alexandre Bounine <alexandre.bounine@idt.com> wrote:

> Fixes queue wrapping bug in Inbound Doorbell handling routine.

The changelog doesn't describe the user-visible impact of the bug. 
Please always include this so that people know whether to backport the
fix into their kernels, and so they can determine whether the patch
will fix a problem which they are observing.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] rapidio/tsi721: fix bug in inbound doorbell handler
  2012-03-05 20:37 ` Andrew Morton
@ 2012-03-05 20:53   ` Bounine, Alexandre
  0 siblings, 0 replies; 3+ messages in thread
From: Bounine, Alexandre @ 2012-03-05 20:53 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linuxppc-dev, Kim, Chul, Matt Porter

On Mon, March 05, 2012 3:37 PM Andrew Morton wrote:
> Alexandre Bounine <alexandre.bounine@idt.com> wrote:
> 
> > Fixes queue wrapping bug in Inbound Doorbell handling routine.
> 
> The changelog doesn't describe the user-visible impact of the bug.
> Please always include this so that people know whether to backport the
> fix into their kernels, and so they can determine whether the patch
> will fix a problem which they are observing.

This patch fixes the bug that causes kernel panic when number of received
doorbells is larger than number of entries in the inbound doorbell
queue (current default value = 512).
Another possible indication for this bug is large number of spurious
doorbells reported by tsi721 driver after reaching the queue size maximum.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-05 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-05 20:33 [PATCH] rapidio/tsi721: fix bug in inbound doorbell handler Alexandre Bounine
2012-03-05 20:37 ` Andrew Morton
2012-03-05 20:53   ` Bounine, Alexandre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).