• Jiang Liu's avatar
    PCI / ACPI: Use boot-time resource allocation rules during hotplug · d66ecb72
    Jiang Liu authored
    On x86 platforms, the kernel respects PCI resource assignments from
    the BIOS and only reassigns resources for unassigned BARs at boot
    time.  However, with the ACPI-based hotplug (acpiphp), it ignores the
    BIOS' PCI resource assignments completely and reassigns all resources
    by itself.  This causes differences in PCI resource allocation
    between boot time and runtime hotplug to occur, which is generally
    undesirable and sometimes actively breaks things.
    
    Namely, if there are enough resources, reassigning all PCI resources
    during runtime hotplug should work, but it may fail if the resources
    are constrained.  This may happen, for instance, when some PCI
    devices with huge MMIO BARs are involved in the runtime hotplug
    operations, because the current PCI MMIO alignment algorithm may
    waste huge chunks of MMIO address space in those cases.
    
    On the Alexander's Sony VAIO VPCZ23A4R the BIOS allocates limited
    MMIO resources for the dock station which contains a device
    (graphics adapter) with a 256MB MMIO BAR.  An attempt to reassign
    that during runtime hotplug causes the dock station MMIO window to be
    exhausted and acpiphp fails to allocate resources for the majority
    of devices on the dock station as a result.
    
    To prevent that from happening, modify acpiphp to follow the boot
    time resources allocation behavior so that the BIOS' resource
    assignments are respected during runtime hotplug too.
    
    [rjw: Changelog]
    References: https://bugzilla.kernel.org/show_bug.cgi?id=56531Reported-and-tested-by: default avatarAlexander E. Patrakov <patrakov@gmail.com>
    Tested-by: default avatarIllya Klymov <xanf@xanf.me>
    Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
    Acked-by: default avatarYinghai Lu <yinghai@kernel.org>
    Cc: 3.9+ <stable@vger.kernel.org>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    d66ecb72
pci.h 9.98 KB