public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/7] call _OSC support during root bridge discovery
@ 2008-11-05  5:29 Andrew Patterson
  2008-11-05  5:29 ` [PATCH 1/7] PCI, ACPI: include missing acpi.h file in pci-acpi.h Andrew Patterson
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Andrew Patterson @ 2008-11-05  5:29 UTC (permalink / raw)
  To: linux-pci, linux-acpi
  Cc: andrew.patterson, matthew, kaneshige.kenji, bjorn.helgaas

This is v3 of the "call _OSC support during root bridge discovery"
patchset.  

Kenji Kaneshige noted that OSC_EXT_PCI_CONFIG_SUPPORT should only be
set if we really can access PCI extended config space (offset greater
than 0xff). The only time this is not true is if CONFIG_PCI_MMCONFIG
is set and pci=nommconf is included on the kernel command-line. I
added a patch that introduces the pci_ext_cfg_avail function which
checks for this condition.

Matthew Wilcox has signed off on the first two patches.


I recently reported a problem where a machine with close to a 100 PCIe
root bridges was taking half an hour to just call _OSC.  The root
cause is the AER code calling:

        pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);

for each bridge.  The pcie_osc_support_set() function also iterates
over each bridge, so _OSC is called a quadratic number of times.

One solution to this problem would be to just move the call to
pcie_osc_support_set() to aer_service_init(), so _OSC support is only
called on each bridge once.

Matthew Wilcox came up with a better solution.  He says "Why should a
driver be calling pcie_osc_support_set() anyway?  This is something
the PCI core should be taking care of for it."

Matthew provided a patch for this solution that I massaged into the
following patch series.

It creates a new function (pci_acpi_osc_support()) which is called
from pci_root.c before we call any other methods on the device (as
recommended by the ACPI spec).  Since we know what capabilities the
system supports, individual modules do not now need to inform the core
of their support for various capabilities.

Some work that still needs to be done (provided by Matthew with some of
my additions): 

o All the existing _OSC code should be moved from pci-acpi.c to
  pci_root.c.  I also think the acpi_osc_data should be made part of
  the acpi_pci_root struct, eliminating a separate allocation.

o We could also use an interface that iterates over all existing
  busses calling _OSC with new flags.  Shouldn't be hard, once it's
  integrated into pci_root.c. We need this to handle when
  configuration changes are made after root bridge discovery such as in
  quirk_disable_all_msi.

o Further ahead, we don't actually check that the bits we asked for
  (in 'control') were actually granted to us.  The PCI firmware spec
  is quite explicit about interdependencies amongst the bits.

o We also need to re-evaluate _OSC when coming out of S4.

This patch series duplicates currently functionality while removing
our quadratic problem.  I believe that it can be applied now while the
above new functionality can be implemented some time in the future.

This patch series applies to the linux-next branch of pci-2.6 git
repository.  I expect it will also work with linux-next.

Diff stats:

 arch/x86/pci/common.c              |    1 +
 drivers/acpi/pci_root.c            |   12 +++++++++++
 drivers/pci/msi.c                  |   31 ++++++++++-------------------
 drivers/pci/pci-acpi.c             |   37 ++++++++++++-----------------------
 drivers/pci/pci.c                  |   28 +++++++++++++++++++++++++-
 drivers/pci/pci.h                  |    2 -
 drivers/pci/pcie/aer/aerdrv_acpi.c |    1 -
 drivers/pci/pcie/aspm.c            |   27 ++++++++-----------------
 include/linux/pci-acpi.h           |   14 ++----------
 include/linux/pci.h                |   18 +++++++++++++++++
 10 files changed, 93 insertions(+), 78 deletions(-)

Commits:

  - Include missing acpi.h file in pci-acpi.h.
  - Call _OSC support during root bridge discovery.
  - PCI extended config _OSC support called when root bridge added.
  - PCIe ASPM _OSC support capabilities called when root bridge added.
  - PCIe AER _OSC support capabilities called when root bridge added.
  - PCI MSI _OSC support capabilities called when root bridge added.
  - Remove obsolete _OSC capability support functions.

-- 
Andrew Patterson

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH v4 0/7] call _OSC support during root bridge discovery
@ 2008-11-10 22:30 Andrew Patterson
  2008-11-10 22:31 ` [PATCH 6/7] ACPI, PCI: PCI MSI _OSC support capabilities called when root bridge added Andrew Patterson
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Patterson @ 2008-11-10 22:30 UTC (permalink / raw)
  To: linux-kernel, linux-pci, linux-acpi
  Cc: andrew.patterson, matthew, kaneshige.kenji, bjorn.helgaas

This is v4 of the "call _OSC support during root bridge discovery"
patchset.  

We now call pci_acpi_osc_support() twice during
acpi_pci_root_add(). Once at the beginning with a default flag
OSC_PCI_SEGMENT_GROUPS_SUPPORT set since we need this to evaluate _SEG
and _BBN. And once again after the bus is scanned to set all the other
_OSC flags. The second call is performed after all PCI quirks are
finished.


I recently reported a problem where a machine with close to a 100 PCIe
root bridges was taking half an hour to just call _OSC.  The root
cause is the AER code calling:

        pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);

for each bridge.  The pcie_osc_support_set() function also iterates
over each bridge, so _OSC is called a quadratic number of times.

One solution to this problem would be to just move the call to
pcie_osc_support_set() to aer_service_init(), so _OSC support is only
called on each bridge once.

Matthew Wilcox came up with a better solution.  He says "Why should a
driver be calling pcie_osc_support_set() anyway?  This is something
the PCI core should be taking care of for it."

Matthew provided a patch for this solution that I massaged into the
following patch series.

It creates a new function (pci_acpi_osc_support()) which is called
from pci_root.c before we call any other methods on the device (as
recommended by the ACPI spec).  Since we know what capabilities the
system supports, individual modules do not now need to inform the core
of their support for various capabilities.

Some work that still needs to be done (provided by Matthew): 

o All the existing _OSC code should be moved from pci-acpi.c to
  pci_root.c.  I also think the acpi_osc_data should be made part of
  the acpi_pci_root struct, eliminating a separate allocation.

o We could also use an interface that iterates over all existing
  busses calling _OSC with new flags.  Shouldn't be hard, once it's
  integrated into pci_root.c.

o Further ahead, we don't actually check that the bits we asked for
  (in 'control') were actually granted to us.  The PCI firmware spec
  is quite explicit about interdependencies amongst the bits.

o We also need to re-evaluate _OSC when coming out of S4.

This patch series duplicates currently functionality while removing
our quadratic problem.  I believe that it can be applied now while the
above new functionality can be implemented some time in the future.

This patch series applies to the linux-next branch of pci-2.6 git
repository.  I expect it will also work with linux-next.

Diff stats:

 arch/x86/pci/common.c              |    8 +++++++
 drivers/acpi/pci_root.c            |   20 +++++++++++++++++++
 drivers/pci/msi.c                  |   31 ++++++++++-------------------
 drivers/pci/pci-acpi.c             |   37 ++++++++++++-----------------------
 drivers/pci/pci.c                  |   15 ++++++++++++-
 drivers/pci/pci.h                  |    2 -
 drivers/pci/pcie/aer/aerdrv_acpi.c |    1 -
 drivers/pci/pcie/aspm.c            |   27 ++++++++-----------------
 include/linux/pci-acpi.h           |   14 ++----------
 include/linux/pci.h                |   16 +++++++++++++++
 10 files changed, 93 insertions(+), 78 deletions(-)

Commits:

  - Include missing acpi.h file in pci-acpi.h.
  - Call _OSC support during root bridge discovery.
  - PCI extended config _OSC support called when root bridge added.
  - PCIe ASPM _OSC support capabilities called when root bridge added.
  - PCIe AER _OSC support capabilities called when root bridge added.
  - PCI MSI _OSC support capabilities called when root bridge added.
  - Remove obsolete _OSC capability support functions.

-- 
Andrew Patterson

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-11-10 22:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-05  5:29 [PATCH v3 0/7] call _OSC support during root bridge discovery Andrew Patterson
2008-11-05  5:29 ` [PATCH 1/7] PCI, ACPI: include missing acpi.h file in pci-acpi.h Andrew Patterson
2008-11-05  5:29 ` [PATCH 2/7] ACPI, PCI: call _OSC support during root bridge discovery Andrew Patterson
2008-11-05  5:29 ` [PATCH 3/7] ACPI, PCI: PCI extended config _OSC support called when root bridge added Andrew Patterson
2008-11-05  5:29 ` [PATCH 4/7] ACPI, PCI: PCIe ASPM _OSC support capabilities " Andrew Patterson
2008-11-05  5:30 ` [PATCH 5/7] ACPI, PCI: PCIe AER " Andrew Patterson
2008-11-05  5:30 ` [PATCH 6/7] ACPI, PCI: PCI MSI " Andrew Patterson
2008-11-05  5:30 ` [PATCH 7/7] PCI, ACPI: remove obsolete _OSC capability support functions Andrew Patterson
  -- strict thread matches above, loose matches on Subject: below --
2008-11-10 22:30 [PATCH v4 0/7] call _OSC support during root bridge discovery Andrew Patterson
2008-11-10 22:31 ` [PATCH 6/7] ACPI, PCI: PCI MSI _OSC support capabilities called when root bridge added Andrew Patterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox