On 03/24/2015 10:08 PM, Bjorn Helgaas wrote: > On Tue, Mar 24, 2015 at 05:04:58PM +0800, Aaron Lu wrote: >> @@ -575,6 +637,9 @@ static void pci_acpi_setup(struct device *dev) >> if (!adev) >> return; >> >> + if (pci_dev->pm_cap) >> + pci_acpi_delay_optimize(pci_dev, adev->handle); > > Is the "pm_cap" test really necessary? If we do it this way, we then have > to convince ourselves that pdev->d3cold_delay and pdev->d3_delay are only > needed when pdev has a pm_cap. > > If we *always* fill in the delay values, it's possible they won't be used, > but we don't have to prove any connection between them and a pm_cap, so > the code is easier to analyze. I remembered why I did the pm_cap test: the d3cold_delay and d3_delay is only filled when pm_cap is set in pci_pm_init - if the device doesn't have PCI_CAP_ID_PM set, its pm_cap will be 0 and d3cold_delay, d3_delay will not be assigned. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html