* [PATCH] net/ethernet/jme: disable ASPM
@ 2012-10-08 19:02 Kevin Baradon
2012-10-08 19:24 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Kevin Baradon @ 2012-10-08 19:02 UTC (permalink / raw)
Cc: Kevin Baradon, Guo-Fu Tseng, Matthew Garrett, netdev
Based on patch from Matthew Garrett <mjg@redhat.com> (https://lkml.org/lkml/2011/11/11/168).
http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
disabled on the 250 and 260. Duplicate for sanity.
Fixes random RX engine hangs I experienced with JMC250 on Clevo W270HU.
Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Cc: Guo-Fu Tseng <cooldavid@cooldavid.org>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
---
drivers/net/ethernet/jme.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index c911d88..373df5a 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
+#include <linux/pci-aspm.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
@@ -2973,6 +2974,9 @@ jme_init_one(struct pci_dev *pdev,
/*
* set up PCI device basics
*/
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
rc = pci_enable_device(pdev);
if (rc) {
pr_err("Cannot enable PCI device\n");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] net/ethernet/jme: disable ASPM
2012-10-08 19:02 [PATCH] net/ethernet/jme: disable ASPM Kevin Baradon
@ 2012-10-08 19:24 ` David Miller
2012-10-08 19:33 ` Matthew Garrett
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2012-10-08 19:24 UTC (permalink / raw)
To: kevin.baradon; +Cc: cooldavid, mjg, netdev
From: Kevin Baradon <kevin.baradon@gmail.com>
Date: Mon, 8 Oct 2012 21:02:36 +0200
> Based on patch from Matthew Garrett <mjg@redhat.com> (https://lkml.org/lkml/2011/11/11/168).
>
> http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
> disabled on the 250 and 260. Duplicate for sanity.
>
> Fixes random RX engine hangs I experienced with JMC250 on Clevo W270HU.
>
> Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
This should be a PCI quirk shouldn't it?
Also:
> + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
> + PCIE_LINK_STATE_CLKPM);
This is terrible formatting, you must line up the "PCIE_LINK_STATE_CLKPM" on
the second line with the very first column after the openning parenthesis
on the first line.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/ethernet/jme: disable ASPM
2012-10-08 19:24 ` David Miller
@ 2012-10-08 19:33 ` Matthew Garrett
2012-10-08 19:39 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Matthew Garrett @ 2012-10-08 19:33 UTC (permalink / raw)
To: David Miller; +Cc: kevin.baradon, cooldavid, netdev
On Mon, Oct 08, 2012 at 03:24:26PM -0400, David Miller wrote:
> This should be a PCI quirk shouldn't it?
No, it's a driver-level policy decision.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/ethernet/jme: disable ASPM
2012-10-08 19:33 ` Matthew Garrett
@ 2012-10-08 19:39 ` David Miller
2012-10-10 20:50 ` Kevin Baradon
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2012-10-08 19:39 UTC (permalink / raw)
To: mjg59; +Cc: kevin.baradon, cooldavid, netdev
From: Matthew Garrett <mjg59@srcf.ucam.org>
Date: Mon, 8 Oct 2012 20:33:16 +0100
> On Mon, Oct 08, 2012 at 03:24:26PM -0400, David Miller wrote:
>
>> This should be a PCI quirk shouldn't it?
>
> No, it's a driver-level policy decision.
Then at a bare minimum this change should be using one of the ASPM
helpers provided by drivers/pci/pcie/aspm.c such as
pci_disable_link_state().
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/ethernet/jme: disable ASPM
2012-10-08 19:39 ` David Miller
@ 2012-10-10 20:50 ` Kevin Baradon
2012-10-11 19:20 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Kevin Baradon @ 2012-10-10 20:50 UTC (permalink / raw)
To: David Miller; +Cc: mjg59, cooldavid, netdev
Le Mon, 08 Oct 2012 15:39:53 -0400 (EDT),
David Miller <davem@davemloft.net> a écrit :
> From: Matthew Garrett <mjg59@srcf.ucam.org>
> Date: Mon, 8 Oct 2012 20:33:16 +0100
>
> > On Mon, Oct 08, 2012 at 03:24:26PM -0400, David Miller wrote:
> >
> >> This should be a PCI quirk shouldn't it?
> >
> > No, it's a driver-level policy decision.
>
> Then at a bare minimum this change should be using one of the ASPM
> helpers provided by drivers/pci/pcie/aspm.c such as
> pci_disable_link_state().
pci_disable_link_state() is already used in this patch.
Am I missing something else?
Below you will find updated patch with corrected indentation.
-- >8 --
Subject: [PATCH] net/ethernet/jme: disable ASPM
Based on patch from Matthew Garrett <mjg@redhat.com> (https://lkml.org/lkml/2011/11/11/168).
http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
disabled on the 250 and 260. Duplicate for sanity.
Fixes random RX engine hangs I experienced with JMC250 on Clevo W270HU.
Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Cc: Guo-Fu Tseng <cooldavid@cooldavid.org>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
---
drivers/net/ethernet/jme.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index c911d88..f8064df 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
+#include <linux/pci-aspm.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
@@ -2973,6 +2974,9 @@ jme_init_one(struct pci_dev *pdev,
/*
* set up PCI device basics
*/
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
rc = pci_enable_device(pdev);
if (rc) {
pr_err("Cannot enable PCI device\n");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] net/ethernet/jme: disable ASPM
2012-10-10 20:50 ` Kevin Baradon
@ 2012-10-11 19:20 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-10-11 19:20 UTC (permalink / raw)
To: kevin.baradon; +Cc: mjg59, cooldavid, netdev
From: Kevin Baradon <kevin.baradon@gmail.com>
Date: Wed, 10 Oct 2012 22:50:49 +0200
> Subject: [PATCH] net/ethernet/jme: disable ASPM
>
> Based on patch from Matthew Garrett <mjg@redhat.com> (https://lkml.org/lkml/2011/11/11/168).
>
> http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
> disabled on the 250 and 260. Duplicate for sanity.
>
> Fixes random RX engine hangs I experienced with JMC250 on Clevo W270HU.
>
> Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-10-11 19:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-08 19:02 [PATCH] net/ethernet/jme: disable ASPM Kevin Baradon
2012-10-08 19:24 ` David Miller
2012-10-08 19:33 ` Matthew Garrett
2012-10-08 19:39 ` David Miller
2012-10-10 20:50 ` Kevin Baradon
2012-10-11 19:20 ` 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).