mbox series

[v3,0/2] Sanitycheck PCI BARs

Message ID 20220805155959.1983584-1-piotr.piorkowski@intel.com (mailing list archive)
Headers show
Series Sanitycheck PCI BARs | expand

Message

Piotr Piórkowski Aug. 5, 2022, 3:59 p.m. UTC
From: Piotr Piórkowski <piotr.piorkowski@intel.com>

When initializing the i915, we want to be sure that the PCI
BARs have been properly initialized.
As part of this series, I have prepared two patches,
one that introduces BARs names to use in code instead of numbers,
and another that adds function to validate BARs before use.
This is an evolution of the concept I presented in the patch:
https://patchwork.freedesktop.org/patch/470184/?series=99094
The main difference between the original patch and what I have
prepared here is that previously I checked all BARs at the beginning
of i915 initialization, and now I only check BAR 0 at beginning.
This is due to the fact that I have noticed that it can happen that only
BAR 0 is available (I have observed this in the case of virtualization,
on some platforms).
Therefore, at the beginning, let's verify only BAR 0, and the others only
before the first use.

v2: Fix build
v3: replace header linux/pci.h to forward declaration for struct pci_dev

Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>


Piotr Piórkowski (2):
  drm/i915: Use of BARs names instead of numbers
  drm/i915: Sanitycheck PCI BARs

 .../gpu/drm/i915/display/intel_lpe_audio.c    |  5 ++--
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c    | 11 +++++---
 drivers/gpu/drm/i915/gt/intel_ggtt.c          | 16 +++++++++---
 drivers/gpu/drm/i915/gt/intel_gt.c            |  3 ++-
 drivers/gpu/drm/i915/gt/intel_region_lmem.c   | 17 +++++++------
 drivers/gpu/drm/i915/gvt/cfg_space.c          |  5 ++--
 drivers/gpu/drm/i915/i915_pci.c               | 25 +++++++++++++++++++
 drivers/gpu/drm/i915/i915_pci.h               |  6 +++++
 drivers/gpu/drm/i915/intel_pci_config.h       |  7 ++++++
 9 files changed, 76 insertions(+), 19 deletions(-)