mbox series

[v3,0/5] PCI: VF resizable BAR

Message ID 20241010103203.382898-1-michal.winiarski@intel.com (mailing list archive)
Headers show
Series PCI: VF resizable BAR | expand

Message

Michał Winiarski Oct. 10, 2024, 10:31 a.m. UTC
Hi,

Resurrecting an old series [1], now that we have an in-tree user for it.

For regular BAR, drivers can use pci_resize_resource to resize it to the
desired size provided that it is supported by the hardware, which the
driver can query using pci_rebar_get_possible_sizes.
This series expands the API to work with IOV BAR as well.
It also adds the additional API to allow extending the VF BAR within the
original resource boundary.

Thanks,
-Michał

[1] https://lore.kernel.org/all/20211215141626.3090807-1-michal.winiarski@intel.com/

v1 -> v2:
- Add pci_iov_resource_extend() and usage in Xe driver
- Reduce the number of ifdefs (Christian)
- Drop patch 2/2 from v1 (Christian)
- Add a helper to avoid upsetting static analysis tools (Krzysztof)

v2 -> v3:
- Extract introducing pci_resource_is_iov to separate commit and
  use it elsewhere in PCI subsystem (Christian)
- Extract restoring VF rebar state to separate commit (Christian)
- Reorganize memory decoding check (Christian)
- Don't use dev_WARN (Ilpo)
- Fix build without CONFIG_PCI_IOV (CI)

Michał Winiarski (5):
  PCI/IOV: Restore VF resizable BAR state after reset
  PCI: Add a helper to identify IOV resources
  PCI: Allow IOV resources to be resized in pci_resize_resource
  PCI/IOV: Allow extending VF BAR within original resource boundary
  drm/xe/pf: Extend the VF LMEM BAR

 drivers/gpu/drm/xe/regs/xe_bars.h |   1 +
 drivers/gpu/drm/xe/xe_sriov_pf.c  |   8 ++
 drivers/pci/iov.c                 | 141 +++++++++++++++++++++++++++++-
 drivers/pci/pci.c                 |   9 +-
 drivers/pci/pci.h                 |  27 +++++-
 drivers/pci/setup-bus.c           |   5 +-
 drivers/pci/setup-res.c           |  37 ++++++--
 include/linux/pci.h               |   3 +
 include/uapi/linux/pci_regs.h     |   1 +
 9 files changed, 213 insertions(+), 19 deletions(-)