• Bjorn Helgaas's avatar
    PCI/ASPM: Remove pcie_aspm_enabled() unnecessary locking · 5e0c21c7
    Bjorn Helgaas authored
    The lifetime of the link_state structure (bridge->link_state) is not the
    same as the lifetime of "bridge" itself.  The link_state is allocated by
    pcie_aspm_init_link_state() after children of the bridge have been
    enumerated, and it is deallocated by pcie_aspm_exit_link_state() after all
    children of the bridge (but not the bridge itself) have been removed.
    
    Previously pcie_aspm_enabled() acquired aspm_lock to ensure that
    link_state was not deallocated while we're looking at it.  But the fact
    that the caller of pcie_aspm_enabled() holds a reference to @pdev means
    there's always at least one child of the bridge, which means link_state
    can't be deallocated.
    
    Remove the unnecessary locking in pcie_aspm_enabled().
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    5e0c21c7
aspm.c 38 KB