Commit 8bf6edcd authored by Intiyaz Basha's avatar Intiyaz Basha Committed by David S. Miller

liquidio: Removed droq lock

With the changes in patch 1 and 2, droq lock is not required.
So removing droq lock.
Signed-off-by: default avatarIntiyaz Basha <intiyaz.basha@cavium.com>
Acked-by: default avatarDerek Chickles <derek.chickles@cavium.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b6e326b
...@@ -1440,12 +1440,8 @@ void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq) ...@@ -1440,12 +1440,8 @@ void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq)
/* the whole thing needs to be atomic, ideally */ /* the whole thing needs to be atomic, ideally */
if (droq) { if (droq) {
pkts_pend = (u32)atomic_read(&droq->pkts_pending); pkts_pend = (u32)atomic_read(&droq->pkts_pending);
spin_lock_bh(&droq->lock);
writel(droq->pkt_count - pkts_pend, droq->pkts_sent_reg); writel(droq->pkt_count - pkts_pend, droq->pkts_sent_reg);
droq->pkt_count = pkts_pend; droq->pkt_count = pkts_pend;
/* this write needs to be flushed before we release the lock */
mmiowb();
spin_unlock_bh(&droq->lock);
oct = droq->oct_dev; oct = droq->oct_dev;
} }
if (iq) { if (iq) {
......
...@@ -301,8 +301,6 @@ int octeon_init_droq(struct octeon_device *oct, ...@@ -301,8 +301,6 @@ int octeon_init_droq(struct octeon_device *oct,
dev_dbg(&oct->pci_dev->dev, "DROQ INIT: max_empty_descs: %d\n", dev_dbg(&oct->pci_dev->dev, "DROQ INIT: max_empty_descs: %d\n",
droq->max_empty_descs); droq->max_empty_descs);
spin_lock_init(&droq->lock);
INIT_LIST_HEAD(&droq->dispatch_list); INIT_LIST_HEAD(&droq->dispatch_list);
/* For 56xx Pass1, this function won't be called, so no checks. */ /* For 56xx Pass1, this function won't be called, so no checks. */
...@@ -506,7 +504,6 @@ int octeon_retry_droq_refill(struct octeon_droq *droq) ...@@ -506,7 +504,6 @@ int octeon_retry_droq_refill(struct octeon_droq *droq)
int desc_refilled, reschedule = 1; int desc_refilled, reschedule = 1;
u32 pkts_credit; u32 pkts_credit;
spin_lock_bh(&droq->lock);
pkts_credit = readl(droq->pkts_credit_reg); pkts_credit = readl(droq->pkts_credit_reg);
desc_refilled = octeon_droq_refill(oct, droq); desc_refilled = octeon_droq_refill(oct, droq);
if (desc_refilled) { if (desc_refilled) {
...@@ -522,7 +519,6 @@ int octeon_retry_droq_refill(struct octeon_droq *droq) ...@@ -522,7 +519,6 @@ int octeon_retry_droq_refill(struct octeon_droq *droq)
if (pkts_credit + desc_refilled >= CN23XX_SLI_DEF_BP) if (pkts_credit + desc_refilled >= CN23XX_SLI_DEF_BP)
reschedule = 0; reschedule = 0;
} }
spin_unlock_bh(&droq->lock);
return reschedule; return reschedule;
} }
...@@ -756,25 +752,17 @@ octeon_droq_process_packets(struct octeon_device *oct, ...@@ -756,25 +752,17 @@ octeon_droq_process_packets(struct octeon_device *oct,
u32 pkt_count = 0; u32 pkt_count = 0;
struct list_head *tmp, *tmp2; struct list_head *tmp, *tmp2;
/* Grab the droq lock */
spin_lock(&droq->lock);
octeon_droq_check_hw_for_pkts(droq); octeon_droq_check_hw_for_pkts(droq);
pkt_count = atomic_read(&droq->pkts_pending); pkt_count = atomic_read(&droq->pkts_pending);
if (!pkt_count) { if (!pkt_count)
spin_unlock(&droq->lock);
return 0; return 0;
}
if (pkt_count > budget) if (pkt_count > budget)
pkt_count = budget; pkt_count = budget;
octeon_droq_fast_process_packets(oct, droq, pkt_count); octeon_droq_fast_process_packets(oct, droq, pkt_count);
/* Release the spin lock */
spin_unlock(&droq->lock);
list_for_each_safe(tmp, tmp2, &droq->dispatch_list) { list_for_each_safe(tmp, tmp2, &droq->dispatch_list) {
struct __dispatch *rdisp = (struct __dispatch *)tmp; struct __dispatch *rdisp = (struct __dispatch *)tmp;
...@@ -809,8 +797,6 @@ octeon_droq_process_poll_pkts(struct octeon_device *oct, ...@@ -809,8 +797,6 @@ octeon_droq_process_poll_pkts(struct octeon_device *oct,
if (budget > droq->max_count) if (budget > droq->max_count)
budget = droq->max_count; budget = droq->max_count;
spin_lock(&droq->lock);
while (total_pkts_processed < budget) { while (total_pkts_processed < budget) {
octeon_droq_check_hw_for_pkts(droq); octeon_droq_check_hw_for_pkts(droq);
...@@ -827,8 +813,6 @@ octeon_droq_process_poll_pkts(struct octeon_device *oct, ...@@ -827,8 +813,6 @@ octeon_droq_process_poll_pkts(struct octeon_device *oct,
total_pkts_processed += pkts_processed; total_pkts_processed += pkts_processed;
} }
spin_unlock(&droq->lock);
list_for_each_safe(tmp, tmp2, &droq->dispatch_list) { list_for_each_safe(tmp, tmp2, &droq->dispatch_list) {
struct __dispatch *rdisp = (struct __dispatch *)tmp; struct __dispatch *rdisp = (struct __dispatch *)tmp;
...@@ -888,9 +872,8 @@ octeon_enable_irq(struct octeon_device *oct, u32 q_no) ...@@ -888,9 +872,8 @@ octeon_enable_irq(struct octeon_device *oct, u32 q_no)
int octeon_register_droq_ops(struct octeon_device *oct, u32 q_no, int octeon_register_droq_ops(struct octeon_device *oct, u32 q_no,
struct octeon_droq_ops *ops) struct octeon_droq_ops *ops)
{ {
struct octeon_droq *droq;
unsigned long flags;
struct octeon_config *oct_cfg = NULL; struct octeon_config *oct_cfg = NULL;
struct octeon_droq *droq;
oct_cfg = octeon_get_conf(oct); oct_cfg = octeon_get_conf(oct);
...@@ -910,21 +893,15 @@ int octeon_register_droq_ops(struct octeon_device *oct, u32 q_no, ...@@ -910,21 +893,15 @@ int octeon_register_droq_ops(struct octeon_device *oct, u32 q_no,
} }
droq = oct->droq[q_no]; droq = oct->droq[q_no];
spin_lock_irqsave(&droq->lock, flags);
memcpy(&droq->ops, ops, sizeof(struct octeon_droq_ops)); memcpy(&droq->ops, ops, sizeof(struct octeon_droq_ops));
spin_unlock_irqrestore(&droq->lock, flags);
return 0; return 0;
} }
int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no) int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no)
{ {
unsigned long flags;
struct octeon_droq *droq;
struct octeon_config *oct_cfg = NULL; struct octeon_config *oct_cfg = NULL;
struct octeon_droq *droq;
oct_cfg = octeon_get_conf(oct); oct_cfg = octeon_get_conf(oct);
...@@ -945,14 +922,10 @@ int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no) ...@@ -945,14 +922,10 @@ int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no)
return 0; return 0;
} }
spin_lock_irqsave(&droq->lock, flags);
droq->ops.fptr = NULL; droq->ops.fptr = NULL;
droq->ops.farg = NULL; droq->ops.farg = NULL;
droq->ops.drop_on_max = 0; droq->ops.drop_on_max = 0;
spin_unlock_irqrestore(&droq->lock, flags);
return 0; return 0;
} }
......
...@@ -245,9 +245,6 @@ struct octeon_droq_ops { ...@@ -245,9 +245,6 @@ struct octeon_droq_ops {
* Octeon DROQ. * Octeon DROQ.
*/ */
struct octeon_droq { struct octeon_droq {
/** A spinlock to protect access to this ring. */
spinlock_t lock;
u32 q_no; u32 q_no;
u32 pkt_count; u32 pkt_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment