* [PATCH net v2 0/2] qlcnic fixes
@ 2016-03-08 7:39 Rajesh Borundia
2016-03-08 7:39 ` [PATCH net v2 1/2] qlcnic: Remove unnecessary usage of atomic_t Rajesh Borundia
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Rajesh Borundia @ 2016-03-08 7:39 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept-HSGLinuxNICDev
Hi Dave,
This series adds following fixes.
o While processing mailbox if driver gets a spurious mailbox
interrupt it leads into premature completion of a next
mailbox request. Added a guard against this by checking current
state of mailbox and ignored spurious interrupt.
Added a stats counter to record this condition.
v2:
o Added patch that removes usage of atomic_t as we are not implemeting
atomicity by using atomic_t value.
Please apply these fixes to net.
Thanks,
Rajesh
Rajesh Borundia (2):
qlcnic: Remove unnecessary usage of atomic_t
qlcnic: Fix mailbox completion handling during spurious interrupt
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 3 ++-
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 24 ++++++++++++++--------
.../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 3 ++-
3 files changed, 19 insertions(+), 11 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net v2 1/2] qlcnic: Remove unnecessary usage of atomic_t
2016-03-08 7:39 [PATCH net v2 0/2] qlcnic fixes Rajesh Borundia
@ 2016-03-08 7:39 ` Rajesh Borundia
2016-03-08 7:39 ` [PATCH net v2 2/2] qlcnic: Fix mailbox completion handling during spurious interrupt Rajesh Borundia
2016-03-10 21:16 ` [PATCH net v2 0/2] qlcnic fixes David Miller
2 siblings, 0 replies; 6+ messages in thread
From: Rajesh Borundia @ 2016-03-08 7:39 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept-HSGLinuxNICDev
o atomic_t usage is incorrect as we are not implementing
any atomicity.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 2 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 46bbea8..d18667b 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1099,7 +1099,7 @@ struct qlcnic_mailbox {
unsigned long status;
spinlock_t queue_lock; /* Mailbox queue lock */
spinlock_t aen_lock; /* Mailbox response/AEN lock */
- atomic_t rsp_status;
+ u32 rsp_status;
u32 num_cmds;
};
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 37a731b..e3d1bb7 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -491,7 +491,7 @@ irqreturn_t qlcnic_83xx_clear_legacy_intr(struct qlcnic_adapter *adapter)
static inline void qlcnic_83xx_notify_mbx_response(struct qlcnic_mailbox *mbx)
{
- atomic_set(&mbx->rsp_status, QLC_83XX_MBX_RESPONSE_ARRIVED);
+ mbx->rsp_status = QLC_83XX_MBX_RESPONSE_ARRIVED;
complete(&mbx->completion);
}
@@ -510,7 +510,7 @@ static void qlcnic_83xx_poll_process_aen(struct qlcnic_adapter *adapter)
if (event & QLCNIC_MBX_ASYNC_EVENT) {
__qlcnic_83xx_process_aen(adapter);
} else {
- if (atomic_read(&mbx->rsp_status) != rsp_status)
+ if (mbx->rsp_status != rsp_status)
qlcnic_83xx_notify_mbx_response(mbx);
}
out:
@@ -1023,7 +1023,7 @@ static void qlcnic_83xx_process_aen(struct qlcnic_adapter *adapter)
if (event & QLCNIC_MBX_ASYNC_EVENT) {
__qlcnic_83xx_process_aen(adapter);
} else {
- if (atomic_read(&mbx->rsp_status) != rsp_status)
+ if (mbx->rsp_status != rsp_status)
qlcnic_83xx_notify_mbx_response(mbx);
}
}
@@ -4050,7 +4050,6 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
struct qlcnic_adapter *adapter = mbx->adapter;
const struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
struct device *dev = &adapter->pdev->dev;
- atomic_t *rsp_status = &mbx->rsp_status;
struct list_head *head = &mbx->cmd_q;
struct qlcnic_hardware_context *ahw;
struct qlcnic_cmd_args *cmd = NULL;
@@ -4063,7 +4062,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
return;
}
- atomic_set(rsp_status, QLC_83XX_MBX_RESPONSE_WAIT);
+ mbx->rsp_status = QLC_83XX_MBX_RESPONSE_WAIT;
spin_lock(&mbx->queue_lock);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net v2 2/2] qlcnic: Fix mailbox completion handling during spurious interrupt
2016-03-08 7:39 [PATCH net v2 0/2] qlcnic fixes Rajesh Borundia
2016-03-08 7:39 ` [PATCH net v2 1/2] qlcnic: Remove unnecessary usage of atomic_t Rajesh Borundia
@ 2016-03-08 7:39 ` Rajesh Borundia
2016-03-10 21:16 ` [PATCH net v2 0/2] qlcnic fixes David Miller
2 siblings, 0 replies; 6+ messages in thread
From: Rajesh Borundia @ 2016-03-08 7:39 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept-HSGLinuxNICDev
o While the driver is in the middle of a MB completion processing
and it receives a spurious MB interrupt, it is mistaken as a good MB
completion interrupt leading to premature completion of the next MB
request. Fix the driver to guard against this by checking the current
state of MB processing and ignore the spurious interrupt.
Also added a stats counter to record this condition.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 1 +
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 15 +++++++++++----
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 3 ++-
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index d18667b..55007f1 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -566,6 +566,7 @@ struct qlcnic_adapter_stats {
u64 tx_dma_map_error;
u64 spurious_intr;
u64 mac_filter_limit_overrun;
+ u64 mbx_spurious_intr;
};
/*
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index e3d1bb7..f9640d5ce 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -2338,9 +2338,9 @@ static void qlcnic_83xx_handle_link_aen(struct qlcnic_adapter *adapter,
static irqreturn_t qlcnic_83xx_handle_aen(int irq, void *data)
{
+ u32 mask, resp, event, rsp_status = QLC_83XX_MBX_RESPONSE_ARRIVED;
struct qlcnic_adapter *adapter = data;
struct qlcnic_mailbox *mbx;
- u32 mask, resp, event;
unsigned long flags;
mbx = adapter->ahw->mailbox;
@@ -2350,10 +2350,14 @@ static irqreturn_t qlcnic_83xx_handle_aen(int irq, void *data)
goto out;
event = readl(QLCNIC_MBX_FW(adapter->ahw, 0));
- if (event & QLCNIC_MBX_ASYNC_EVENT)
+ if (event & QLCNIC_MBX_ASYNC_EVENT) {
__qlcnic_83xx_process_aen(adapter);
- else
- qlcnic_83xx_notify_mbx_response(mbx);
+ } else {
+ if (mbx->rsp_status != rsp_status)
+ qlcnic_83xx_notify_mbx_response(mbx);
+ else
+ adapter->stats.mbx_spurious_intr++;
+ }
out:
mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK);
@@ -4053,6 +4057,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
struct list_head *head = &mbx->cmd_q;
struct qlcnic_hardware_context *ahw;
struct qlcnic_cmd_args *cmd = NULL;
+ unsigned long flags;
ahw = adapter->ahw;
@@ -4062,7 +4067,9 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
return;
}
+ spin_lock_irqsave(&mbx->aen_lock, flags);
mbx->rsp_status = QLC_83XX_MBX_RESPONSE_WAIT;
+ spin_unlock_irqrestore(&mbx->aen_lock, flags);
spin_lock(&mbx->queue_lock);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 494e810..0a2318c 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -59,7 +59,8 @@ static const struct qlcnic_stats qlcnic_gstrings_stats[] = {
QLC_OFF(stats.mac_filter_limit_overrun)},
{"spurious intr", QLC_SIZEOF(stats.spurious_intr),
QLC_OFF(stats.spurious_intr)},
-
+ {"mbx spurious intr", QLC_SIZEOF(stats.mbx_spurious_intr),
+ QLC_OFF(stats.mbx_spurious_intr)},
};
static const char qlcnic_device_gstrings_stats[][ETH_GSTRING_LEN] = {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net v2 0/2] qlcnic fixes
2016-03-08 7:39 [PATCH net v2 0/2] qlcnic fixes Rajesh Borundia
2016-03-08 7:39 ` [PATCH net v2 1/2] qlcnic: Remove unnecessary usage of atomic_t Rajesh Borundia
2016-03-08 7:39 ` [PATCH net v2 2/2] qlcnic: Fix mailbox completion handling during spurious interrupt Rajesh Borundia
@ 2016-03-10 21:16 ` David Miller
2016-03-11 6:40 ` Rajesh Borundia
2 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2016-03-10 21:16 UTC (permalink / raw)
To: rajesh.borundia; +Cc: netdev, Dept-HSGLinuxNICDev
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Tue, 8 Mar 2016 02:39:56 -0500
> This series adds following fixes.
>
> o While processing mailbox if driver gets a spurious mailbox
> interrupt it leads into premature completion of a next
> mailbox request. Added a guard against this by checking current
> state of mailbox and ignored spurious interrupt.
> Added a stats counter to record this condition.
>
> v2:
>
> o Added patch that removes usage of atomic_t as we are not implemeting
> atomicity by using atomic_t value.
>
> Please apply these fixes to net.
As explained in other list postings, 'net' is basically closed for this
release cycle, so I applied this series to 'net-next'.
Let me know if you'd like me to therefore queue these changes up for
-stable.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH net v2 0/2] qlcnic fixes
2016-03-10 21:16 ` [PATCH net v2 0/2] qlcnic fixes David Miller
@ 2016-03-11 6:40 ` Rajesh Borundia
2016-03-11 16:41 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Rajesh Borundia @ 2016-03-11 6:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Dept-GE Linux NIC Dev
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Friday, March 11, 2016 2:47 AM
>To: Rajesh Borundia <rajesh.borundia@qlogic.com>
>Cc: netdev <netdev@vger.kernel.org>; Dept-GE Linux NIC Dev <Dept-
>GELinuxNICDev@qlogic.com>
>Subject: Re: [PATCH net v2 0/2] qlcnic fixes
>
>From: Rajesh Borundia <rajesh.borundia@qlogic.com>
>Date: Tue, 8 Mar 2016 02:39:56 -0500
>
>> This series adds following fixes.
>>
>> o While processing mailbox if driver gets a spurious mailbox
>> interrupt it leads into premature completion of a next
>> mailbox request. Added a guard against this by checking current
>> state of mailbox and ignored spurious interrupt.
>> Added a stats counter to record this condition.
>>
>> v2:
>>
>> o Added patch that removes usage of atomic_t as we are not implemeting
>> atomicity by using atomic_t value.
>>
>> Please apply these fixes to net.
>
>As explained in other list postings, 'net' is basically closed for this release cycle,
>so I applied this series to 'net-next'.
>
Thanks.
>Let me know if you'd like me to therefore queue these changes up for -stable.
>
Please queue the changes for stable.
>Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net v2 0/2] qlcnic fixes
2016-03-11 6:40 ` Rajesh Borundia
@ 2016-03-11 16:41 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2016-03-11 16:41 UTC (permalink / raw)
To: rajesh.borundia; +Cc: netdev, Dept-GELinuxNICDev
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Fri, 11 Mar 2016 06:40:01 +0000
>>-----Original Message-----
>>From: David Miller [mailto:davem@davemloft.net]
>>Sent: Friday, March 11, 2016 2:47 AM
>>Let me know if you'd like me to therefore queue these changes up for -stable.
>>
> Please queue the changes for stable.
Done.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-11 16:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08 7:39 [PATCH net v2 0/2] qlcnic fixes Rajesh Borundia
2016-03-08 7:39 ` [PATCH net v2 1/2] qlcnic: Remove unnecessary usage of atomic_t Rajesh Borundia
2016-03-08 7:39 ` [PATCH net v2 2/2] qlcnic: Fix mailbox completion handling during spurious interrupt Rajesh Borundia
2016-03-10 21:16 ` [PATCH net v2 0/2] qlcnic fixes David Miller
2016-03-11 6:40 ` Rajesh Borundia
2016-03-11 16:41 ` David Miller
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).