diff mbox

[net,v2,2/7] e1000: prevent oops when adapter is being closed and reset simultaneously

Message ID 529C57CE.1040801@windriver.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

yzhu1 Dec. 2, 2013, 9:50 a.m. UTC
On 12/01/2013 12:37 AM, Sergei Shtylyov wrote:
> Hello.
>
> On 30-11-2013 13:20, Jeff Kirsher wrote:
>
>> From: yzhu1 <yanjun.zhu@windriver.com>
>
>> This change is based on a similar change made to e1000e support in
>> commit bb9e44d0d0f4 ("e1000e: prevent oops when adapter is being closed
>> and reset simultaneously").  The same issue has also been observed
>> on the older e1000 cards.
>
>> Here, we have increased the RESET_COUNT value to 50 because there are 
>> too
>> many accesses to e1000 nic on stress tests to e1000 nic, it is not 
>> enough
>> to set RESET_COUT 25. Experimentation has shown that it is enough to set
>> RESET_COUNT 50.
>
>> Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
>
>    Jeff, why are you accepting patches without real name in the 
> sign-off line?
>
>> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
> WBR, Sergei
>
>
Hi,

Thanks for the advice from Sergei. I made a new patch with the name 
"yanjun.zhu".

Best Regards!
Zhu Yanjun

Comments

David Miller Dec. 2, 2013, 4:12 p.m. UTC | #1
From: yzhu1 <Yanjun.Zhu@windriver.com>
Date: Mon, 2 Dec 2013 17:50:06 +0800

> Thanks for the advice from Sergei. I made a new patch with the name
> "yanjun.zhu".

That's not a properly formatted real name either, it should be something
like Yanjun Zhu.

How do you write your name on paper when it needs to be romanized?

Do you write "yanjun.zhu"?  I doubt that you do :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
yzhu1 Dec. 3, 2013, 2:02 a.m. UTC | #2
On 12/03/2013 12:12 AM, David Miller wrote:
> From: yzhu1 <Yanjun.Zhu@windriver.com>
> Date: Mon, 2 Dec 2013 17:50:06 +0800
>
>> Thanks for the advice from Sergei. I made a new patch with the name
>> "yanjun.zhu".
> That's not a properly formatted real name either, it should be something
> like Yanjun Zhu.
>
> How do you write your name on paper when it needs to be romanized?
>
> Do you write "yanjun.zhu"?  I doubt that you do :-)
Hi, David

According to the tradition and the regulations, my name should be "Zhu 
Yanjun" or "yanjun.zhu".

Thanks for your advice.
Zhu Yanjun
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kirsher, Jeffrey T Dec. 3, 2013, 2:22 a.m. UTC | #3
On Tue, 2013-12-03 at 10:02 +0800, yzhu1 wrote:
> On 12/03/2013 12:12 AM, David Miller wrote:
> > From: yzhu1 <Yanjun.Zhu@windriver.com>
> > Date: Mon, 2 Dec 2013 17:50:06 +0800
> >
> >> Thanks for the advice from Sergei. I made a new patch with the name
> >> "yanjun.zhu".
> > That's not a properly formatted real name either, it should be something
> > like Yanjun Zhu.
> >
> > How do you write your name on paper when it needs to be romanized?
> >
> > Do you write "yanjun.zhu"?  I doubt that you do :-)
> Hi, David
> 
> According to the tradition and the regulations, my name should be "Zhu 
> Yanjun" or "yanjun.zhu".
> 
> Thanks for your advice.
> Zhu Yanjun

So before the next time you send a kernel patch, make sure
your .gitconfig has the following information:

[user]
	email = yanjun.zhu@windriver.com
	name = Zhu Yanjun
yzhu1 Dec. 3, 2013, 2:25 a.m. UTC | #4
On 12/03/2013 10:22 AM, Jeff Kirsher wrote:
> On Tue, 2013-12-03 at 10:02 +0800, yzhu1 wrote:
>> On 12/03/2013 12:12 AM, David Miller wrote:
>>> From: yzhu1 <Yanjun.Zhu@windriver.com>
>>> Date: Mon, 2 Dec 2013 17:50:06 +0800
>>>
>>>> Thanks for the advice from Sergei. I made a new patch with the name
>>>> "yanjun.zhu".
>>> That's not a properly formatted real name either, it should be something
>>> like Yanjun Zhu.
>>>
>>> How do you write your name on paper when it needs to be romanized?
>>>
>>> Do you write "yanjun.zhu"?  I doubt that you do :-)
>> Hi, David
>>
>> According to the tradition and the regulations, my name should be "Zhu
>> Yanjun" or "yanjun.zhu".
>>
>> Thanks for your advice.
>> Zhu Yanjun
> So before the next time you send a kernel patch, make sure
> your .gitconfig has the following information:
>
> [user]
> 	email = yanjun.zhu@windriver.com
> 	name = Zhu Yanjun
>
OK. Thanks a lot.

Zhu Yanjun
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 3, 2013, 5:26 a.m. UTC | #5
From: yzhu1 <Yanjun.Zhu@windriver.com>
Date: Tue, 3 Dec 2013 10:02:40 +0800

> On 12/03/2013 12:12 AM, David Miller wrote:
>> From: yzhu1 <Yanjun.Zhu@windriver.com>
>> Date: Mon, 2 Dec 2013 17:50:06 +0800
>>
>>> Thanks for the advice from Sergei. I made a new patch with the name
>>> "yanjun.zhu".
>> That's not a properly formatted real name either, it should be
>> something
>> like Yanjun Zhu.
>>
>> How do you write your name on paper when it needs to be romanized?
>>
>> Do you write "yanjun.zhu"?  I doubt that you do :-)
> Hi, David
> 
> According to the tradition and the regulations, my name should be "Zhu
> Yanjun"

This form is fine.

> or "yanjun.zhu".

Whereas you would never write this form by hand in a document, ever.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From 54e9e48a9f878eb45f0cc6322415244d7a9f1598 Mon Sep 17 00:00:00 2001
From: yzhu1 <yanjun.zhu@windriver.com>
Date: Fri, 22 Nov 2013 15:46:48 +0800
Subject: [PATCH 1/1] e1000: prevent oops when adapter is being closed and
 reset simultaneously

This change is based on a similar change made to e1000e support in
commit bb9e44d0d0f4 ("e1000e: prevent oops when adapter is being closed
and reset simultaneously").  The same issue has also been observed
on the older e1000 cards.

Here, we have increased the RESET_COUNT value to 50 because there are too
many accesses to e1000 nic on stress tests to e1000 nic, it is not enough
to set RESET_COUT 25. Experimentation has shown that it is enough to set
RESET_COUNT 50.

Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
---
 drivers/net/ethernet/intel/e1000/e1000.h      |    5 +++++
 drivers/net/ethernet/intel/e1000/e1000_main.c |    9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000/e1000.h b/drivers/net/ethernet/intel/e1000/e1000.h
index 58c1472..0af4a8e 100644
--- a/drivers/net/ethernet/intel/e1000/e1000.h
+++ b/drivers/net/ethernet/intel/e1000/e1000.h
@@ -83,6 +83,11 @@  struct e1000_adapter;
 
 #define E1000_MAX_INTR			10
 
+/*
+ * Count for polling __E1000_RESET condition every 10-20msec.
+ */
+#define E1000_CHECK_RESET_COUNT         50
+
 /* TX/RX descriptor defines */
 #define E1000_DEFAULT_TXD		256
 #define E1000_MAX_TXD			256
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index e386228..c0f5217 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1440,6 +1440,10 @@  static int e1000_close(struct net_device *netdev)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 	struct e1000_hw *hw = &adapter->hw;
+	int count = E1000_CHECK_RESET_COUNT;
+
+	while (test_bit(__E1000_RESETTING, &adapter->flags) && count--)
+		usleep_range(10000, 20000);
 
 	WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
 	e1000_down(adapter);
@@ -4963,6 +4967,11 @@  static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
 	netif_device_detach(netdev);
 
 	if (netif_running(netdev)) {
+		int count = E1000_CHECK_RESET_COUNT;
+
+		while (test_bit(__E1000_RESETTING, &adapter->flags) && count--)
+			usleep_range(10000, 20000);
+
 		WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
 		e1000_down(adapter);
 	}
-- 
1.7.9.5