From: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: piotr.piorkowski@intel.com, lukasz.laguna@intel.com,
jakub1.kolakowski@intel.com,
Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>,
Jan Sokolowski <jan.sokolowski@intel.com>
Subject: [PATCH i-g-t 2/6] lib/xe_mmio: Add init flag and helper to check initialization
Date: Thu, 6 Nov 2025 16:28:06 +0100 [thread overview]
Message-ID: <20251106152811.1997614-3-marcin.bernatowicz@linux.intel.com> (raw)
In-Reply-To: <20251106152811.1997614-1-marcin.bernatowicz@linux.intel.com>
From: Piotr Piórkowski <piotr.piorkowski@intel.com>
Track MMIO initialization state via a new `init` flag and expose it
through xe_mmio_is_initialized().
Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Reviewed-by: Jan Sokolowski <jan.sokolowski@intel.com>
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
lib/xe/xe_mmio.c | 14 ++++++++++++++
lib/xe/xe_mmio.h | 2 ++
2 files changed, 16 insertions(+)
diff --git a/lib/xe/xe_mmio.c b/lib/xe/xe_mmio.c
index b52e90dba..94e516417 100644
--- a/lib/xe/xe_mmio.c
+++ b/lib/xe/xe_mmio.c
@@ -25,6 +25,7 @@ void xe_mmio_vf_access_init(int pf_fd, int vf_id, struct xe_mmio *mmio)
intel_register_access_init(&mmio->intel_mmio, pci_dev, false);
mmio->fd = pf_fd;
+ mmio->init = true;
}
/**
@@ -39,6 +40,18 @@ void xe_mmio_access_init(int pf_fd, struct xe_mmio *mmio)
xe_mmio_vf_access_init(pf_fd, 0, mmio);
}
+/**
+ * xe_mmio_is_initialized:
+ * @mmio: xe mmio structure for IO operations
+ *
+ * Returns:
+ * Non-zero if the xe mmio structure is initialized.
+ */
+bool xe_mmio_is_initialized(const struct xe_mmio *mmio)
+{
+ return mmio->init;
+}
+
/**
* xe_mmio_access_fini:
* @mmio: xe mmio structure for IO operations
@@ -49,6 +62,7 @@ void xe_mmio_access_init(int pf_fd, struct xe_mmio *mmio)
void xe_mmio_access_fini(struct xe_mmio *mmio)
{
intel_register_access_fini(&mmio->intel_mmio);
+ mmio->init = false;
}
/**
diff --git a/lib/xe/xe_mmio.h b/lib/xe/xe_mmio.h
index 35cafa448..030c50a2e 100644
--- a/lib/xe/xe_mmio.h
+++ b/lib/xe/xe_mmio.h
@@ -16,11 +16,13 @@ typedef uint64_t xe_ggtt_pte_t;
struct xe_mmio {
int fd;
+ bool init;
struct intel_mmio_data intel_mmio;
};
void xe_mmio_vf_access_init(int pf_fd, int vf_id, struct xe_mmio *mmio);
void xe_mmio_access_init(int pf_fd, struct xe_mmio *mmio);
+bool xe_mmio_is_initialized(const struct xe_mmio *mmio);
void xe_mmio_access_fini(struct xe_mmio *mmio);
uint32_t xe_mmio_read32(struct xe_mmio *mmio, uint32_t offset);
--
2.43.0
next prev parent reply other threads:[~2025-11-06 15:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 15:28 [PATCH i-g-t 0/6] Multi-tile support for xe_sriov_flr and related MMIO improvements Marcin Bernatowicz
2025-11-06 15:28 ` [PATCH i-g-t 1/6] lib/xe_mmio: Introduce tile-level XE MMIO access helpers Marcin Bernatowicz
2025-11-07 8:53 ` Laguna, Lukasz
2025-11-06 15:28 ` Marcin Bernatowicz [this message]
2025-11-06 15:28 ` [PATCH i-g-t 3/6] lib/xe/xe_query: Add tile helpers and iteration macro Marcin Bernatowicz
2025-11-06 15:28 ` [PATCH i-g-t 4/6] tests/intel/xe_sriov_flr: Make subchecks Tile aware Marcin Bernatowicz
2025-11-07 9:17 ` Piotr Piórkowski
2025-11-06 15:28 ` [PATCH i-g-t 5/6] tests/intel/xe_sriov_flr: Use global MMIO context initialized in verify_flr Marcin Bernatowicz
2025-11-06 15:28 ` [PATCH i-g-t 6/6] tests/intel/xe_sriov_flr: Do not ignore failed prerequisites Marcin Bernatowicz
2025-11-06 22:49 ` ✓ Xe.CI.BAT: success for Multi-tile support for xe_sriov_flr and related MMIO improvements (rev2) Patchwork
2025-11-06 23:13 ` ✓ i915.CI.BAT: " Patchwork
2025-11-07 17:02 ` ✗ i915.CI.Full: failure " Patchwork
2025-11-07 21:47 ` ✗ Xe.CI.Full: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-10-31 12:56 [PATCH i-g-t 0/6] Multi-tile support for xe_sriov_flr and related MMIO improvements Marcin Bernatowicz
2025-10-31 12:56 ` [PATCH i-g-t 2/6] lib/xe_mmio: Add init flag and helper to check initialization Marcin Bernatowicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251106152811.1997614-3-marcin.bernatowicz@linux.intel.com \
--to=marcin.bernatowicz@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jakub1.kolakowski@intel.com \
--cc=jan.sokolowski@intel.com \
--cc=lukasz.laguna@intel.com \
--cc=piotr.piorkowski@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox