lkml.org 
[lkml]   [2019]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/2] PCI: Add missing link delays required by the PCIe spec
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

\
 
 \ /
  Last update: 2019-11-09 15:49    [W:0.066 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site