]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Add managed partial-BAR request and map infrastructure
authorPhilipp Stanner <pstanner@redhat.com>
Thu, 13 Jun 2024 11:50:16 +0000 (13:50 +0200)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Wed, 10 Jul 2024 04:19:35 +0000 (04:19 +0000)
commitbbaff68bf4a404bee5f5e20e7b1e30301b26304a
tree88b1fe9f0ba361f38dd9efca4bdb2b9bc2feb5d4
parentd5fe8207d8786142061fb18c8fb671b34649f114
PCI: Add managed partial-BAR request and map infrastructure

The pcim_iomap_devres table tracks entire-BAR mappings, so we can't use it
to build a managed version of pci_iomap_range(), which maps partial BARs.

Add struct pcim_addr_devres, which can track request and mapping of both
entire BARs and partial BARs.

Add the following internal devres functions based on struct
pcim_addr_devres:

  pcim_iomap_region()               # request & map entire BAR
  pcim_iounmap_region()             # unmap & release entire BAR
  pcim_request_region()             # request entire BAR
  pcim_release_region()             # release entire BAR
  pcim_request_all_regions()        # request all entire BARs
  pcim_release_all_regions()        # release all entire BARs

Rework the following public interfaces using the new infrastructure
listed above:

  pcim_iomap()                      # map partial BAR
  pcim_iounmap()                    # unmap partial BAR
  pcim_iomap_regions()              # request & map specified BARs
  pcim_iomap_regions_request_all()  # request all BARs, map specified BARs
  pcim_iounmap_regions()            # unmap & release specified BARs

Link: https://lore.kernel.org/r/20240613115032.29098-4-pstanner@redhat.com
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/devres.c
drivers/pci/pci.c
drivers/pci/pci.h