Re: [PATCH v3 2/2] PCI: Add missing link delays required by the PCIe spec

From: Lukas Wunner
Date: Sat Nov 09 2019 - 09:49:30 EST


On Thu, Nov 07, 2019 at 03:18:47PM +0300, Mika Westerberg wrote:
> +static int pci_bus_max_d3cold_delay(const struct pci_bus *bus)
> +{
> + const struct pci_dev *pdev;
> + int min_delay = 100;
> + int max_delay = 0;
> +
> + list_for_each_entry(pdev, &bus->devices, bus_list) {
> + if (pdev->d3cold_delay < min_delay)
> + min_delay = pdev->d3cold_delay;
> + if (pdev->d3cold_delay > max_delay)
> + max_delay = pdev->d3cold_delay;
> + }

You need to hold pci_bus_sem when accessing the devices list.


> + if (!dev->subordinate || list_empty(&dev->subordinate->devices))
> + return;

Same here.


> + child = list_first_entry(&dev->subordinate->devices, struct pci_dev,
> + bus_list);

And again.


Thanks,

Lukas