aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/devices
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rapidio/devices')
-rw-r--r--drivers/rapidio/devices/tsi721.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 691b1ab1a3d0..30d2072f480b 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -410,13 +410,14 @@ static void tsi721_db_dpc(struct work_struct *work)
410 */ 410 */
411 mport = priv->mport; 411 mport = priv->mport;
412 412
413 wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE)); 413 wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
414 rd_ptr = ioread32(priv->regs + TSI721_IDQ_RP(IDB_QUEUE)); 414 rd_ptr = ioread32(priv->regs + TSI721_IDQ_RP(IDB_QUEUE)) % IDB_QSIZE;
415 415
416 while (wr_ptr != rd_ptr) { 416 while (wr_ptr != rd_ptr) {
417 idb_entry = (u64 *)(priv->idb_base + 417 idb_entry = (u64 *)(priv->idb_base +
418 (TSI721_IDB_ENTRY_SIZE * rd_ptr)); 418 (TSI721_IDB_ENTRY_SIZE * rd_ptr));
419 rd_ptr++; 419 rd_ptr++;
420 rd_ptr %= IDB_QSIZE;
420 idb.msg = *idb_entry; 421 idb.msg = *idb_entry;
421 *idb_entry = 0; 422 *idb_entry = 0;
422 423