[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <60704cf1854c539f514e859a1f8adc63@codeaurora.org>
Date: Fri, 19 Jan 2018 21:28:31 +0530
From: poza@...eaurora.org
To: Stefan Roese <sr@...x.de>
Cc: 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 2018-01-19 19:49, Stefan Roese wrote:
> 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
yes, will correct this and re-post.
Regards,
Oza.
Powered by blists - more mailing lists