[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8573bed-3517-bc9b-1e4a-c0107be9ea13@denx.de>
Date: Fri, 19 Jan 2018 15:19:09 +0100
From: Stefan Roese <sr@...x.de>
To: Oza Pawandeep <poza@...eaurora.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Philippe Ombredanne <pombredanne@...b.com>,
Thomas Gleixner <tglx@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kate Stewart <kstewart@...uxfoundation.org>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Dongdong Liu <liudongdong3@...wei.com>,
Keith Busch <keith.busch@...el.com>, Wei Zhang <wzhang@...com>,
Sinan Kaya <okaya@...eaurora.org>,
Timur Tabi <timur@...eaurora.org>
Subject: Re: [PATCH v6 7/7] PCI: Unify wait for link active into generic pci
On 19.01.2018 12:10, Oza Pawandeep wrote:
> Clients such as pciehp, dpc are using pcie_wait_link_active, which waits
> till the link becomes active or inactive.
>
> Made generic function and moved it to drivers/pci/pci.c
>
> Signed-off-by: Oza Pawandeep <poza@...eaurora.org>
>
> diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
> index 7bab060..26afeff 100644
> --- a/drivers/pci/hotplug/pciehp_hpc.c
> +++ b/drivers/pci/hotplug/pciehp_hpc.c
> @@ -245,25 +245,12 @@ bool pciehp_check_link_active(struct controller *ctrl)
> return ret;
> }
>
> -static void __pcie_wait_link_active(struct controller *ctrl, bool active)
> +static bool pcie_wait_link_active(struct controller *ctrl)
> {
> - int timeout = 1000;
> -
> - if (pciehp_check_link_active(ctrl) == active)
> - return;
> - while (timeout > 0) {
> - msleep(10);
> - timeout -= 10;
> - if (pciehp_check_link_active(ctrl) == active)
> - return;
> - }
> - ctrl_dbg(ctrl, "Data Link Layer Link Active not %s in 1000 msec\n",
> - active ? "set" : "cleared");
> -}
> + struct pci_dev *pdev = ctrl_dev(ctrl);
> + bool active = true;
>
> -static void pcie_wait_link_active(struct controller *ctrl)
> -{
> - __pcie_wait_link_active(ctrl, true);
> + return pci_wait_for_link(pdev, active);
> }
>
> static bool pci_bus_check_dev(struct pci_bus *bus, int devfn)
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 4a7c686..0de83ea 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -2805,7 +2805,7 @@ static void pci_std_enable_acs(struct pci_dev *dev)
> pci_read_config_word(dev, pos + PCI_ACS_CTRL, &ctrl);
>
> /* Source Validation */
> - ctrl |= (cap & PCI_ACS_SV);
> +// ctrl |= (cap & PCI_ACS_SV);
Could it be, that you missed to fix / clean something up here?
Thanks,
Stefan
Powered by blists - more mailing lists