• Mika Westerberg's avatar
    ACPI / hotplug / PCI: Don't scan for non-hotplug bridges if slot is not bridge · f188b99f
    Mika Westerberg authored
    HP 6730b laptop has an ethernet NIC connected to one of the PCIe root
    ports.  The root ports themselves are native PCIe hotplug capable.  Now,
    during boot after PCI devices are scanned the BIOS triggers ACPI bus check
    directly to the NIC:
    
      ACPI: \_SB_.PCI0.RP06.NIC_: Bus check in hotplug_event()
    
    It is not clear why it is sending bus check but regardless the ACPI hotplug
    notify handler calls enable_slot() directly (instead of going through
    acpiphp_check_bridge() as there is no bridge), which ends up handling
    special case for non-hotplug bridges with native PCIe hotplug.  This
    results a crash of some kind but the reporter only sees black screen so it
    is hard to figure out the exact spot and what actually happens.  Based on
    a few fix proposals it was tracked to crash somewhere inside
    pci_assign_unassigned_bridge_resources().
    
    In any case we should not really be in that special branch at all because
    the ACPI notify happened to a slot that is not a PCI bridge (it is just a
    regular PCI device).
    
    Fix this so that we only go to that special branch if we are calling
    enable_slot() for a bridge (e.g., the ACPI notification was for the
    bridge).
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=201127
    Fixes: 84c8b58e ("ACPI / hotplug / PCI: Don't scan bridges managed by native hotplug")
    Reported-by: default avatarPeter Anemone <peter.anemone@gmail.com>
    Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    CC: stable@vger.kernel.org	# v4.18+
    f188b99f
acpiphp_glue.c 26 KB