[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACK8Z6EfUTDjCM=fmdHfWeu8UV5GN+i6PX9fKkR1H8K90TXozg@mail.gmail.com>
Date: Wed, 12 Apr 2017 12:16:52 -0700
From: Rajat Jain <rajatja@...gle.com>
To: Sinan Kaya <okaya@...eaurora.org>
Cc: linux-pci@...r.kernel.org, timur@...eaurora.org,
"Patel, Mayurkumar" <mayurkumar.patel@...el.com>,
linux-arm-msm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Bjorn Helgaas <bhelgaas@...gle.com>,
Shawn Lin <shawn.lin@...k-chips.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
David Daney <david.daney@...ium.com>,
linux-kernel@...r.kernel.org, Rajat Jain <rajatxjain@...il.com>
Subject: Re: [PATCH V8 2/5] PCI/ASPM: split pci_aspm_init() into two
On Fri, Apr 7, 2017 at 9:55 PM, Sinan Kaya <okaya@...eaurora.org> wrote:
> Split pci_aspm_init() body into pci_aspm_init_upstream()
> and pci_aspm_init_downstream() for bridge and endpoint
> specific code behavior.
>
> Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=194895
> Signed-off-by: Sinan Kaya <okaya@...eaurora.org>
> ---
> drivers/pci/pcie/aspm.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> index dc36717..a80d64b 100644
> --- a/drivers/pci/pcie/aspm.c
> +++ b/drivers/pci/pcie/aspm.c
> @@ -826,6 +826,16 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev)
> return link;
> }
>
> +static int pci_aspm_init_downstream(struct pci_dev *pdev)
> +{
> + return 0;
> +}
> +
> +static int pci_aspm_init_upstream(struct pci_dev *pdev)
> +{
> + return 0;
> +}
> +
> /*
> * pci_aspm_init: Initiate PCI express link state.
> * It is called from device_add for every single pci device.
> @@ -833,7 +843,10 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev)
> */
> int pci_aspm_init(struct pci_dev *pdev)
> {
> - return 0;
> + if (!pdev->has_secondary_link)
> + return pci_aspm_init_downstream(pdev);
> +
> + return pci_aspm_init_upstream(pdev);
> }
Nit:
if (x_flag())
return x();
return y();
May be better than
if (!x_flag)
return y();
return x();
>
> /*
> --
> 1.9.1
>
Powered by blists - more mailing lists