Skip to content

resource, PNPACPI: add bus number and window support

Bjorn Helgaas linux-acpi lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 2 repliesIn review
  2. v17 patches 1 replySuperseded

Changes in v2 from the cover letter

- Add close quote in vsprintf SPECIAL comment (Randy Dunlap).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7resource: expand IORESOURCE_TYPE_BITS to make room for bus resource typeinclude/linux/ioport.h+8 -80 replies
2/7vsprintf: clarify comments for printf_spec flagslib/vsprintf.c+2 -20 replies
3/7vsprintf: move %pR resource printf_specs off the stacklib/vsprintf.c+24 -210 replies
4/7resource: add bus number supportinclude/linux/ioport.h lib/vsprintf.c+10 -00 replies
5/7resource: add window supportinclude/linux/ioport.h lib/vsprintf.c+4 -10 replies
6/7PNPACPI: add window supportdrivers/pnp/interface.c drivers/pnp/pnpacpi/rsparser.c+24 -170 replies
7/7PNPACPI: add bus number supportdrivers/pnp/base.h drivers/pnp/interface.c drivers/pnp/pnpacpi/rsparser.c +2 more+47 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/7] resource, PNPACPI: add bus number and window support

These patches add a new resource type, IORESOURCE_BUS, a new resource flag, IORESOURCE_WINDOW, and PNPACPI support that uses them.

IORESOURCE_BUS is for PCI bus number ranges. For bridge devices, ACPI reports secondary bus number ranges in _CRS descriptors, but we currently ignore them. Adding this resource type will allow us to handle those descriptors in PNPACPI.

IORESOURCE_WINDOW is also for bridges: ACPI reports the regions that the bridge forwards to its secondary bus. We have _CRS parsing code in pci_root.c that handles these window descriptors, but PNPACPI currently ignores them. Adding this flag bit will allow PNPACPI to deal with the windows correctly.

No drivers use bus or window resources yet, but ultimately, I would like to drop the _CRS parsing code from pci_root.c and rely on PNPACPI to do it for us. The current effect of this series is to change /sys/bus/pnp/.../resources (and "lspnp -v" output) from this:

00:00 PNP0a03 PCI bus
state = active

to something like this:

    00:00 PNP0a03 PCI bus
	state = active
	    bus 0x0-0x0
	    io 0x0-0xcff window
	    io 0x0-0x2cfe window
	    io 0x3b0-0x3bb window
	    io 0x3c0-0x3df window
	    mem 0xf5d00000-0xf6ffffff window
	    mem disabled
	    mem 0xa0000-0xbffff window

Changes from v1 to v2:
- Add close quote in vsprintf SPECIAL comment (Randy Dunlap).

---

Bjorn Helgaas (7):
resource: expand IORESOURCE_TYPE_BITS to make room for bus resource type
vsprintf: clarify comments for printf_spec flags
vsprintf: move %pR resource printf_specs off the stack
resource: add bus number support
resource: add window support
PNPACPI: add window support
PNPACPI: add bus number support

 drivers/pnp/base.h             |    3 ++
 drivers/pnp/interface.c        |    7 +++--
 drivers/pnp/pnpacpi/rsparser.c |   49 ++++++++++++++++++++++----------
 drivers/pnp/resource.c         |   27 +++++++++++++++++
 drivers/pnp/support.c          |    4 ++-
 include/linux/ioport.h         |   18 ++++++------
 lib/vsprintf.c                 |   62 +++++++++++++++++++++++++---------------
 7 files changed, 119 insertions(+), 51 deletions(-)