public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI / PCIe: Introduce command line option to disable ARI
@ 2012-02-29 22:09 Rafael J. Wysocki
  2012-02-29 22:33 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2012-02-29 22:09 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: LKML, linux-pci

From: Rafael J. Wysocki <rjw@sisk.pl>

There are PCIe devices on the market that report ARI support but
then fail to initialize correctly when ARI is actually used.  This
leads to situations in which kernels 2.6.34 and newer fail to handle
systems where the previous kernels worked without any apparent
problems.  Unfortunately, it is currently unknown how many such
devices are there.

For this reason, introduce a new kernel command line option,
pci=noari, allowing users to disable PCIe ARI altogether if they
see problems with PCIe device initialization.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/pci/pci.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: linux/drivers/pci/pci.c
===================================================================
--- linux.orig/drivers/pci/pci.c
+++ linux/drivers/pci/pci.c
@@ -94,6 +94,9 @@ u8 pci_cache_line_size;
  */
 unsigned int pcibios_max_latency = 255;
 
+/* If set, the PCIe ARI capability will not be used. */
+static bool pcie_ari_disabled;
+
 /**
  * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
  * @bus: pointer to PCI bus structure to search
@@ -1922,7 +1925,7 @@ void pci_enable_ari(struct pci_dev *dev)
 	u16 flags, ctrl;
 	struct pci_dev *bridge;
 
-	if (!pci_is_pcie(dev) || dev->devfn)
+	if (pcie_ari_disabled || !pci_is_pcie(dev) || dev->devfn)
 		return;
 
 	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI);
@@ -3718,6 +3721,8 @@ static int __init pci_setup(char *str)
 				pci_realloc();
 			} else if (!strcmp(str, "nodomains")) {
 				pci_no_domains();
+			} else if (!strncmp(str, "noari", 5)) {
+				pcie_ari_disabled = true;
 			} else if (!strncmp(str, "cbiosize=", 9)) {
 				pci_cardbus_io_size = memparse(str + 9, &str);
 			} else if (!strncmp(str, "cbmemsize=", 10)) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI / PCIe: Introduce command line option to disable ARI
  2012-02-29 22:09 [PATCH] PCI / PCIe: Introduce command line option to disable ARI Rafael J. Wysocki
@ 2012-02-29 22:33 ` Randy Dunlap
  2012-02-29 23:06   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2012-02-29 22:33 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Jesse Barnes, LKML, linux-pci

On 02/29/2012 02:09 PM, Rafael J. Wysocki wrote:

> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> There are PCIe devices on the market that report ARI support but
> then fail to initialize correctly when ARI is actually used.  This
> leads to situations in which kernels 2.6.34 and newer fail to handle
> systems where the previous kernels worked without any apparent
> problems.  Unfortunately, it is currently unknown how many such
> devices are there.
> 
> For this reason, introduce a new kernel command line option,
> pci=noari, allowing users to disable PCIe ARI altogether if they
> see problems with PCIe device initialization.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
>  drivers/pci/pci.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> Index: linux/drivers/pci/pci.c
> ===================================================================
> --- linux.orig/drivers/pci/pci.c
> +++ linux/drivers/pci/pci.c
> @@ -94,6 +94,9 @@ u8 pci_cache_line_size;
>   */
>  unsigned int pcibios_max_latency = 255;
>  
> +/* If set, the PCIe ARI capability will not be used. */
> +static bool pcie_ari_disabled;


Please update Documentation/kernel-parameters.txt .

-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI / PCIe: Introduce command line option to disable ARI
  2012-02-29 22:33 ` Randy Dunlap
@ 2012-02-29 23:06   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2012-02-29 23:06 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Jesse Barnes, LKML, linux-pci

On Wednesday, February 29, 2012, Randy Dunlap wrote:
> On 02/29/2012 02:09 PM, Rafael J. Wysocki wrote:
> 
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > There are PCIe devices on the market that report ARI support but
> > then fail to initialize correctly when ARI is actually used.  This
> > leads to situations in which kernels 2.6.34 and newer fail to handle
> > systems where the previous kernels worked without any apparent
> > problems.  Unfortunately, it is currently unknown how many such
> > devices are there.
> > 
> > For this reason, introduce a new kernel command line option,
> > pci=noari, allowing users to disable PCIe ARI altogether if they
> > see problems with PCIe device initialization.
> > 
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > ---
> >  drivers/pci/pci.c |    7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > Index: linux/drivers/pci/pci.c
> > ===================================================================
> > --- linux.orig/drivers/pci/pci.c
> > +++ linux/drivers/pci/pci.c
> > @@ -94,6 +94,9 @@ u8 pci_cache_line_size;
> >   */
> >  unsigned int pcibios_max_latency = 255;
> >  
> > +/* If set, the PCIe ARI capability will not be used. */
> > +static bool pcie_ari_disabled;
> 
> 
> Please update Documentation/kernel-parameters.txt .

Ah, sorry for the omission, updated patch follows.

Thanks,
Rafael

---
From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: PCI / PCIe: Introduce command line option to disable ARI

There are PCIe devices on the market that report ARI support but
then fail to initialize correctly when ARI is actually used.  This
leads to situations in which kernels 2.6.34 and newer fail to handle
systems where the previous kernels worked without any apparent
problems.  Unfortunately, it is currently unknown how many such
devices are there.

For this reason, introduce a new kernel command line option,
pci=noari, allowing users to disable PCIe ARI altogether if they
see problems with PCIe device initialization.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 Documentation/kernel-parameters.txt |    1 +
 drivers/pci/pci.c                   |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Index: linux/drivers/pci/pci.c
===================================================================
--- linux.orig/drivers/pci/pci.c
+++ linux/drivers/pci/pci.c
@@ -94,6 +94,9 @@ u8 pci_cache_line_size;
  */
 unsigned int pcibios_max_latency = 255;
 
+/* If set, the PCIe ARI capability will not be used. */
+static bool pcie_ari_disabled;
+
 /**
  * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
  * @bus: pointer to PCI bus structure to search
@@ -1922,7 +1925,7 @@ void pci_enable_ari(struct pci_dev *dev)
 	u16 flags, ctrl;
 	struct pci_dev *bridge;
 
-	if (!pci_is_pcie(dev) || dev->devfn)
+	if (pcie_ari_disabled || !pci_is_pcie(dev) || dev->devfn)
 		return;
 
 	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI);
@@ -3718,6 +3721,8 @@ static int __init pci_setup(char *str)
 				pci_realloc();
 			} else if (!strcmp(str, "nodomains")) {
 				pci_no_domains();
+			} else if (!strncmp(str, "noari", 5)) {
+				pcie_ari_disabled = true;
 			} else if (!strncmp(str, "cbiosize=", 9)) {
 				pci_cardbus_io_size = memparse(str + 9, &str);
 			} else if (!strncmp(str, "cbmemsize=", 10)) {
Index: linux/Documentation/kernel-parameters.txt
===================================================================
--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -2111,6 +2111,7 @@ bytes respectively. Such letter suffixes
 				on: Turn ECRC on.
 		realloc		reallocate PCI resources if allocations done by BIOS
 				are erroneous.
+		noari		do not use PCIe ARI.
 
 	pcie_aspm=	[PCIE] Forcibly enable or disable PCIe Active State Power
 			Management.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-29 23:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-29 22:09 [PATCH] PCI / PCIe: Introduce command line option to disable ARI Rafael J. Wysocki
2012-02-29 22:33 ` Randy Dunlap
2012-02-29 23:06   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox