• Naga Chumbalkar's avatar
    PCI: Disable ASPM when _OSC control is not granted for PCIe services · eca67315
    Naga Chumbalkar authored
    v3 -> v2: Added text to describe the problem
    v2 -> v1: Split this patch from v1
    v1	: Part of: http://marc.info/?l=linux-pci&m=130042212003242&w=2
    
    Disable ASPM when no _OSC control for PCIe services is granted
    by the BIOS. This is to protect systems with a buggy BIOS that
    did not set the ACPI FADT "ASPM Controls" bit even though the
    underlying HW can't do ASPM.
    
    To turn "on" ASPM the minimum the BIOS needs to do:
    1. Clear the ACPI FADT "ASPM Controls" bit.
    2. Support _OSC appropriately
    
    There is no _OSC Control bit for ASPM. However, we expect the BIOS to
    support _OSC for a Root Bridge that originates a PCIe hierarchy. If this
    is not the case - we are better off not enabling ASPM on that server.
    
    Commit 852972ac (ACPI: Disable ASPM if the
    Platform won't provide _OSC control for PCIe) describes the above scenario.
    To quote verbatim from there:
    [The PCI SIG documentation for the _OSC OS/firmware handshaking interface
    states:
    
    "If the _OSC control method is absent from the scope of a host bridge
    device, then the operating system must not enable or attempt to use any
    features defined in this section for the hierarchy originated by the host
    bridge."
    
    The obvious interpretation of this is that the OS should not attempt to use
    PCIe hotplug, PME or AER - however, the specification also notes that an
    _OSC method is *required* for PCIe hierarchies, and experimental validation
    with An Alternative OS indicates that it doesn't use any PCIe functionality
    if the _OSC method is missing. That arguably means we shouldn't be using
    MSI or extended config space, but right now our problems seem to be limited
    to vendors being surprised when ASPM gets enabled on machines when other
    OSs refuse to do so. So, for now, let's just disable ASPM if the _OSC
    method doesn't exist or refuses to hand over PCIe capability control.]
    Signed-off-by: default avatarNaga Chumbalkar <nagananda.chumbalkar@hp.com>
    Cc: Rafael J. Wysocki <rjw@sisk.pl>
    Cc: Matthew Garrett <mjg59@srcf.ucam.org>
    Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    eca67315
pci_root.c 16.8 KB