linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci: update pcie_ports 'auto' behavior for non-ACPI platforms
@ 2013-10-26 17:23 Andrew Murray
  2013-11-01 15:27 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Murray @ 2013-10-26 17:23 UTC (permalink / raw)
  To: linux-pci; +Cc: bhelgaas, m-karicheri2, Andrew Murray

The pcie_ports parameter, which defaults to 'auto', allows a user
to specify if PCIe port services are disabled ('compat'), always
enabled ('native'), or only used when allowed by the BIOS
('auto').

Where CONFIG_ACPI isn't enabled, as is often the case for non
x86/ia64 platforms, the 'auto' behavior results in that of
'compat'. Thus in order to use port services on these platforms
'pcie_ports=native' must be added to the kernel command line.

This patch results in the 'native' behavior being followed where
'auto' is selected and ACPI is not enabled.

Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk>
---
 drivers/pci/pcie/portdrv_core.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 31063ac..08d131f 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -260,13 +260,14 @@ static int get_port_device_capability(struct pci_dev *dev)
 	if (pcie_ports_disabled)
 		return 0;
 
-	err = pcie_port_platform_notify(dev, &cap_mask);
-	if (!pcie_ports_auto) {
-		cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP
-				| PCIE_PORT_SERVICE_VC;
-		if (pci_aer_available())
-			cap_mask |= PCIE_PORT_SERVICE_AER;
-	} else if (err) {
+	cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP
+			| PCIE_PORT_SERVICE_VC;
+	if (pci_aer_available())
+		cap_mask |= PCIE_PORT_SERVICE_AER;
+
+	if (pcie_ports_auto) {
+		err = pcie_port_platform_notify(dev, &cap_mask);
+		if (err)
 			return 0;
 	}
 
-- 
1.8.1.2


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

* Re: [PATCH] pci: update pcie_ports 'auto' behavior for non-ACPI platforms
  2013-10-26 17:23 [PATCH] pci: update pcie_ports 'auto' behavior for non-ACPI platforms Andrew Murray
@ 2013-11-01 15:27 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2013-11-01 15:27 UTC (permalink / raw)
  To: Andrew Murray; +Cc: linux-pci@vger.kernel.org, Karicheri, Muralidharan

On Sat, Oct 26, 2013 at 11:23 AM, Andrew Murray
<amurray@embedded-bits.co.uk> wrote:
> The pcie_ports parameter, which defaults to 'auto', allows a user
> to specify if PCIe port services are disabled ('compat'), always
> enabled ('native'), or only used when allowed by the BIOS
> ('auto').
>
> Where CONFIG_ACPI isn't enabled, as is often the case for non
> x86/ia64 platforms, the 'auto' behavior results in that of
> 'compat'. Thus in order to use port services on these platforms
> 'pcie_ports=native' must be added to the kernel command line.
>
> This patch results in the 'native' behavior being followed where
> 'auto' is selected and ACPI is not enabled.
>
> Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk>

Applied to pci/misc.  I'll probably include this in the v3.13 pull
request.  Thanks!

Bjorn

> ---
>  drivers/pci/pcie/portdrv_core.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
> index 31063ac..08d131f 100644
> --- a/drivers/pci/pcie/portdrv_core.c
> +++ b/drivers/pci/pcie/portdrv_core.c
> @@ -260,13 +260,14 @@ static int get_port_device_capability(struct pci_dev *dev)
>         if (pcie_ports_disabled)
>                 return 0;
>
> -       err = pcie_port_platform_notify(dev, &cap_mask);
> -       if (!pcie_ports_auto) {
> -               cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP
> -                               | PCIE_PORT_SERVICE_VC;
> -               if (pci_aer_available())
> -                       cap_mask |= PCIE_PORT_SERVICE_AER;
> -       } else if (err) {
> +       cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP
> +                       | PCIE_PORT_SERVICE_VC;
> +       if (pci_aer_available())
> +               cap_mask |= PCIE_PORT_SERVICE_AER;
> +
> +       if (pcie_ports_auto) {
> +               err = pcie_port_platform_notify(dev, &cap_mask);
> +               if (err)
>                         return 0;
>         }
>
> --
> 1.8.1.2
>

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

end of thread, other threads:[~2013-11-01 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-26 17:23 [PATCH] pci: update pcie_ports 'auto' behavior for non-ACPI platforms Andrew Murray
2013-11-01 15:27 ` Bjorn Helgaas

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).