[2/2] PCI: Don't touch ASPM if forcibly disabled

Submitted by Joe Lawrence on Jan. 18, 2013, 6:24 p.m.

Details

Message ID alpine.DEB.2.02.1301181324010.31163@jlaw-desktop.mno.stratus.com
State Accepted
Headers show

Commit Message

Joe Lawrence Jan. 18, 2013, 6:24 p.m.
From 108cca7bee5b04f45d9712507d14b5f3fbc22c29 Mon Sep 17 00:00:00 2001
From: Joe Lawrence <joe.lawrence@stratus.com>
Date: Tue, 15 Jan 2013 15:31:28 -0500
Subject: [PATCH 2/2] PCI: Don't touch ASPM if forcibly disabled

Don't allocate and track PCIe ASPM state when "pcie_aspm=off" is specified on
the kernel parameter list.

Based-on-patch-from: Matthew Garrett <mjg59@srcf.ucam.org>
Reviewed-by: David Bulkow <david.bulkow@stratus.com>
Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
---
 drivers/pci/pcie/aspm.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Myron Stowe Jan. 18, 2013, 10:54 p.m.
On Fri, 2013-01-18 at 13:24 -0500, Joe Lawrence wrote:
> From 108cca7bee5b04f45d9712507d14b5f3fbc22c29 Mon Sep 17 00:00:00 2001
> From: Joe Lawrence <joe.lawrence@stratus.com>
> Date: Tue, 15 Jan 2013 15:31:28 -0500
> Subject: [PATCH 2/2] PCI: Don't touch ASPM if forcibly disabled
> 
> Don't allocate and track PCIe ASPM state when "pcie_aspm=off" is specified on
> the kernel parameter list.
> 
> Based-on-patch-from: Matthew Garrett <mjg59@srcf.ucam.org>
> Reviewed-by: David Bulkow <david.bulkow@stratus.com>
> Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
> ---
>  drivers/pci/pcie/aspm.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> index 6122447..f912a93 100644
> --- a/drivers/pci/pcie/aspm.c
> +++ b/drivers/pci/pcie/aspm.c
> @@ -556,6 +556,9 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
>  	struct pcie_link_state *link;
>  	int blacklist = !!pcie_aspm_sanity_check(pdev);
>  
> +	if (!aspm_support_enabled)
> +		return;
> +
>  	if (!pci_is_pcie(pdev) || pdev->link_state)
>  		return;
>  	if (pci_pcie_type(pdev) != PCI_EXP_TYPE_ROOT_PORT &&

I was considering whether putting in a similar check in the
pcie_aspm_exit_link_state() would be best in order to "short circuit"
all the unnecessary processing that still occurs with ASPM turned off
and also for symmetry.  Bjorn suggested just sticking with the fix in
pcie_aspm_init_link_state() since adding something similar in
pcie_aspm_exit_link_state() may create other issues and does not help
with simplifying ASPM's implementation.

Acked-by: Myron Stowe <myron.stowe@redhat.com>


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Feb. 1, 2013, 10:32 p.m.
On Fri, Jan 18, 2013 at 3:54 PM, Myron Stowe <mstowe@redhat.com> wrote:
> On Fri, 2013-01-18 at 13:24 -0500, Joe Lawrence wrote:
>> From 108cca7bee5b04f45d9712507d14b5f3fbc22c29 Mon Sep 17 00:00:00 2001
>> From: Joe Lawrence <joe.lawrence@stratus.com>
>> Date: Tue, 15 Jan 2013 15:31:28 -0500
>> Subject: [PATCH 2/2] PCI: Don't touch ASPM if forcibly disabled
>>
>> Don't allocate and track PCIe ASPM state when "pcie_aspm=off" is specified on
>> the kernel parameter list.
>>
>> Based-on-patch-from: Matthew Garrett <mjg59@srcf.ucam.org>
>> Reviewed-by: David Bulkow <david.bulkow@stratus.com>
>> Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
>> ---
>>  drivers/pci/pcie/aspm.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
>> index 6122447..f912a93 100644
>> --- a/drivers/pci/pcie/aspm.c
>> +++ b/drivers/pci/pcie/aspm.c
>> @@ -556,6 +556,9 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
>>       struct pcie_link_state *link;
>>       int blacklist = !!pcie_aspm_sanity_check(pdev);
>>
>> +     if (!aspm_support_enabled)
>> +             return;
>> +
>>       if (!pci_is_pcie(pdev) || pdev->link_state)
>>               return;
>>       if (pci_pcie_type(pdev) != PCI_EXP_TYPE_ROOT_PORT &&
>
> I was considering whether putting in a similar check in the
> pcie_aspm_exit_link_state() would be best in order to "short circuit"
> all the unnecessary processing that still occurs with ASPM turned off
> and also for symmetry.  Bjorn suggested just sticking with the fix in
> pcie_aspm_init_link_state() since adding something similar in
> pcie_aspm_exit_link_state() may create other issues and does not help
> with simplifying ASPM's implementation.
>
> Acked-by: Myron Stowe <myron.stowe@redhat.com>

I applied this to pci/joe-aspm for v3.9.  Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 6122447..f912a93 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -556,6 +556,9 @@  void pcie_aspm_init_link_state(struct pci_dev *pdev)
 	struct pcie_link_state *link;
 	int blacklist = !!pcie_aspm_sanity_check(pdev);
 
+	if (!aspm_support_enabled)
+		return;
+
 	if (!pci_is_pcie(pdev) || pdev->link_state)
 		return;
 	if (pci_pcie_type(pdev) != PCI_EXP_TYPE_ROOT_PORT &&