diff options
author | Satanand Burla <satananda.burla@cavium.com> | 2017-01-31 13:04:42 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-01 12:25:40 -0500 |
commit | cdb478e5e413864df73096ef4f0e5d518395a92b (patch) | |
tree | 4ebd2ed508b7a6aa5a5aba99f35308d0226fc1cf /drivers/net/ethernet/cavium/liquidio/octeon_device.c | |
parent | net: ipv6: add NLM_F_APPEND in notifications when applicable (diff) | |
download | linux-dev-cdb478e5e413864df73096ef4f0e5d518395a92b.tar.xz linux-dev-cdb478e5e413864df73096ef4f0e5d518395a92b.zip |
liquidio: fix for iq and droq cnts going negative
Flush the mmio writes before releasing spin locks.
if the maintained counts get too high > 2M force
writeback of the counts to clear them
Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/octeon_device.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c b/drivers/net/ethernet/cavium/liquidio/octeon_device.c index a8df493a5012..9675ffbf25e6 100644 --- a/drivers/net/ethernet/cavium/liquidio/octeon_device.c +++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c @@ -1361,6 +1361,8 @@ void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq) spin_lock_bh(&droq->lock); writel(droq->pkt_count, droq->pkts_sent_reg); droq->pkt_count = 0; + /* this write needs to be flushed before we release the lock */ + mmiowb(); spin_unlock_bh(&droq->lock); oct = droq->oct_dev; } @@ -1368,6 +1370,8 @@ void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq) spin_lock_bh(&iq->lock); writel(iq->pkt_in_done, iq->inst_cnt_reg); iq->pkt_in_done = 0; + /* this write needs to be flushed before we release the lock */ + mmiowb(); spin_unlock_bh(&iq->lock); oct = iq->oct_dev; } |