PCI: Retry allocation of only the resource type that failed
authorYinghai Lu <yinghai@kernel.org>
Thu, 25 Jul 2013 13:31:38 +0000 (06:31 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 26 Jul 2013 13:32:20 +0000 (07:32 -0600)
commitaa914f5ec25e4371ba18b312971314be1b9b1076
tree318090c34fc438e39c59780bf98e705ce8c50d9e
parentc10cc483bf3f1d0e8f9f077ca36ecc053de9bbbc
PCI: Retry allocation of only the resource type that failed

Ben Herrenschmidt reported the following problem:

  - The bus has space for all desired MMIO resources, including optional
    space for SR-IOV devices
  - We attempt to allocate I/O port space, but it fails because the bus
    has no I/O space
  - Because of the I/O allocation failure, we retry MMIO allocation,
    requesting only the required space, without the optional SR-IOV space

This means we don't allocate the optional SR-IOV space, even though we
could.

This is related to 0c5be0cb0e ("PCI: Retry on IORESOURCE_IO type
allocations").

This patch changes how we handle allocation failures.  We will now retry
allocation of only the resource type that failed.  If MMIO allocation
fails, we'll retry only MMIO allocation.  If I/O port allocation fails,
we'll retry only I/O port allocation.

[bhelgaas: changelog]
Reference: https://lkml.kernel.org/r/1367712653.11982.19.camel@pasglop
Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org # v3.10+
drivers/pci/setup-bus.c
This page took 0.025429 seconds and 5 git commands to generate.