Skip to content

PCI: Resource code fixes (supercedes earlier series) & cleanups

Ilpo Järvinen linux-pci lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 23 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23PCI: Fix bridge window alignment with optional resourcesdrivers/pci/setup-bus.c+6 -40 replies
2/23PCI: Rewrite bridge window head alignment functiondrivers/pci/setup-bus.c+44 -93 replies
3/23PCI: Stop over-estimating bridge window sizedrivers/pci/setup-bus.c+5 -922 replies
4/23resource: Increase MAX_IORES_LEVEL to 8kernel/resource.c+1 -10 replies
5/23PCI: Remove old_size limit from bridge window sizingdrivers/pci/setup-bus.c+3 -85 replies
6/23PCI: Push realloc check into pbus_size_mem()drivers/pci/setup-bus.c+12 -220 replies
7/23PCI: Pass bridge window resource to pbus_size_mem()drivers/pci/setup-bus.c+17 -180 replies
8/23PCI: Use res_to_dev_res() in reassign_resources_sorted()drivers/pci/setup-bus.c+1 -100 replies
9/23PCI: Fetch dev_res to local var in __assign_resources_sorted()drivers/pci/setup-bus.c+17 -160 replies
10/23PCI: Add pci_resource_is_bridge_win()drivers/pci/pci-sysfs.c drivers/pci/pci.h drivers/pci/setup-bus.c +1 more+10 -60 replies
11/23PCI: Log reset and restore of resourcesdrivers/pci/setup-bus.c+9 -10 replies
12/23PCI: Check invalid align earlier in pbus_size_mem()drivers/pci/setup-bus.c+12 -130 replies
13/23PCI: Add pbus_mem_size_optional() to handle optional sizesdrivers/pci/setup-bus.c+54 -2311 replies
14/23resource: Mark res given to resource_assigned() as constinclude/linux/ioport.h+1 -11 reply
15/23PCI: Use resource_assigned() in setup-bus.c algorithmdrivers/pci/setup-bus.c+33 -310 replies
16/23PCI: Properly prefix struct pci_dev_resource handling functionsdrivers/pci/setup-bus.c+61 -530 replies
17/23PCI: Separate cardbus setup & build it only with CONFIG_CARDBUSdrivers/pci/Makefile drivers/pci/pci.h drivers/pci/setup-bus.c +3 more+202 -1680 replies
18/23PCI: Handle CardBus specific params in setup-cardbus.cdrivers/pci/pci.c drivers/pci/pci.h drivers/pci/setup-cardbus.c+26 -130 replies
19/23PCI: Use scnprintf() instead of sprintf()drivers/pci/probe.c+4 -30 replies
20/23PCI: Add Bus Number + Secondary Latency Timer as dword fieldsinclude/uapi/linux/pci_regs.h+5 -00 replies
21/23PCI: Convert to use Bus Number field definesdrivers/pci/probe.c+13 -120 replies
22/23PCI: Add pbus_validate_busn() for Bus Number validationdrivers/pci/pci.h drivers/pci/probe.c+22 -120 replies
23/23PCI: Move scanbus bridge scanning to setup-cardbus.cdrivers/pci/pci.h drivers/pci/probe.c drivers/pci/setup-cardbus.c+149 -580 replies

Reviews trailers per patch

None of the 23 patches has a Reviewed-by or Acked-by.

PatchMalte Schröder
1/23T-b
2/23T-b
3/23T-b
4/23
5/23
6/23
7/23
8/23
9/23
10/23
11/23
12/23
13/23
14/23
15/23
16/23
17/23
18/23
19/23
20/23
21/23
22/23
23/23

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/23] PCI: Resource code fixes (supercedes earlier series) & cleanups

Hi all,

Here's the resource code fixes and cleanups series. The 6 patches (the first 5 + 1 cleanup) have been submitted earlier (not yet applied, I've closed the patchwork entries for them) but due to a number conflicts that could easily ensue if these are applied independently, I had to put all these into the same series.

The series consists of:

1. The first 5 are the most important changes as they relate to regressions. These may case shrinkage of bridge windows that previous had surplus space beyond the HP reservation size (due to sizes inherited from FW). In some HP scenarios the smaller bridge window could cause a regression, but this seems a case the pci=hpmm* parameters are meant to address.

2. Followed by cleanups (no functional change intended, excluding the extra debug logging added).

3. Introduction of pbus_mem_size_optional() to avoid the need to handle optional resource in a deeply nested loop (rebar awareness changes will have to add some code there). Doing all optional calculations in one place feels more logical and consistent anyway. There's a minor functional change in this change related to bridge windows with only optional resources (I don't expect issues because of it).

4. Separating CardBus bridge setup code to own file + compile it only when CONFIG_CARDBUS is set (I'd have wanted to send this separately but it seems impractical given that I need to rename the pci_dev_resource handling functions when exposing them to another file).

Any comments are welcome.

Ilpo Järvinen (23):
PCI: Fix bridge window alignment with optional resources
PCI: Rewrite bridge window head alignment function
PCI: Stop over-estimating bridge window size
resource: Increase MAX_IORES_LEVEL to 8
PCI: Remove old_size limit from bridge window sizing
PCI: Push realloc check into pbus_size_mem()
PCI: Pass bridge window resource to pbus_size_mem()
PCI: Use res_to_dev_res() in reassign_resources_sorted()
PCI: Fetch dev_res to local var in __assign_resources_sorted()
PCI: Add pci_resource_is_bridge_win()
PCI: Log reset and restore of resources
PCI: Check invalid align earlier in pbus_size_mem()
PCI: Add pbus_mem_size_optional() to handle optional sizes
resource: Mark res given to resource_assigned() as const
PCI: Use resource_assigned() in setup-bus.c algorithm
PCI: Properly prefix struct pci_dev_resource handling functions
PCI: Separate cardbus setup & build it only with CONFIG_CARDBUS
PCI: Handle CardBus specific params in setup-cardbus.c
PCI: Use scnprintf() instead of sprintf()
PCI: Add Bus Number + Secondary Latency Timer as dword fields
PCI: Convert to use Bus Number field defines
PCI: Add pbus_validate_busn() for Bus Number validation
PCI: Move scanbus bridge scanning to setup-cardbus.c

 drivers/pci/Makefile          |   1 +
 drivers/pci/pci-sysfs.c       |   2 +-
 drivers/pci/pci.c             |  14 +-
 drivers/pci/pci.h             |  49 ++-
 drivers/pci/probe.c           | 128 +++----
 drivers/pci/setup-bus.c       | 644 ++++++++++++----------------------
 drivers/pci/setup-cardbus.c   | 306 ++++++++++++++++
 drivers/pci/setup-res.c       |   2 +-
 drivers/pcmcia/yenta_socket.c |   2 +-
 include/linux/ioport.h        |   2 +-
 include/linux/pci.h           |   6 +-
 include/uapi/linux/pci_regs.h |   5 +
 kernel/resource.c             |   2 +-
 13 files changed, 648 insertions(+), 515 deletions(-)
 create mode 100644 drivers/pci/setup-cardbus.c

base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8

Signature · 1 line
2.39.5