From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>,
Lucas De Marchi <lucas.demarchi@intel.com>
Subject: [PATCH 8/8] drm/xe/vf: Don't support MCR registers if VF
Date: Fri, 12 Jan 2024 16:26:49 +0100 [thread overview]
Message-ID: <20240112152649.849-9-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20240112152649.849-1-michal.wajdeczko@intel.com>
VF drivers can't operate on MCR registers. Make sure that driver
is not trying to read nor write using any of MCR register.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
---
drivers/gpu/drm/xe/xe_gt_mcr.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_gt_mcr.c b/drivers/gpu/drm/xe/xe_gt_mcr.c
index 77925b35cf8d..4e088a273535 100644
--- a/drivers/gpu/drm/xe/xe_gt_mcr.c
+++ b/drivers/gpu/drm/xe/xe_gt_mcr.c
@@ -10,6 +10,7 @@
#include "xe_gt_topology.h"
#include "xe_gt_types.h"
#include "xe_mmio.h"
+#include "xe_sriov.h"
/**
* DOC: GT Multicast/Replicated (MCR) Register Support
@@ -38,6 +39,8 @@
* ``init_steering_*()`` functions is to apply the platform-specific rules for
* each MCR register type to identify a steering target that will select a
* non-terminated instance.
+ *
+ * MCR registers are not available on Virtual Function (VF).
*/
#define STEER_SEMAPHORE XE_REG(0xFD0)
@@ -352,6 +355,9 @@ void xe_gt_mcr_init(struct xe_gt *gt)
BUILD_BUG_ON(IMPLICIT_STEERING + 1 != NUM_STEERING_TYPES);
BUILD_BUG_ON(ARRAY_SIZE(xe_steering_types) != NUM_STEERING_TYPES);
+ if (IS_SRIOV_VF(xe))
+ return;
+
spin_lock_init(>->mcr_lock);
if (gt->info.type == XE_GT_TYPE_MEDIA) {
@@ -405,6 +411,9 @@ void xe_gt_mcr_set_implicit_defaults(struct xe_gt *gt)
{
struct xe_device *xe = gt_to_xe(gt);
+ if (IS_SRIOV_VF(xe))
+ return;
+
if (xe->info.platform == XE_DG2) {
u32 steer_val = REG_FIELD_PREP(MCR_SLICE_MASK, 0) |
REG_FIELD_PREP(MCR_SUBSLICE_MASK, 2);
@@ -588,6 +597,8 @@ u32 xe_gt_mcr_unicast_read_any(struct xe_gt *gt, struct xe_reg_mcr reg_mcr)
u32 val;
bool steer;
+ xe_gt_assert(gt, !IS_SRIOV_VF(gt_to_xe(gt)));
+
steer = xe_gt_mcr_get_nonterminated_steering(gt, reg_mcr,
&group, &instance);
@@ -619,6 +630,8 @@ u32 xe_gt_mcr_unicast_read(struct xe_gt *gt,
{
u32 val;
+ xe_gt_assert(gt, !IS_SRIOV_VF(gt_to_xe(gt)));
+
mcr_lock(gt);
val = rw_with_mcr_steering(gt, reg_mcr, MCR_OP_READ, group, instance, 0);
mcr_unlock(gt);
@@ -640,6 +653,8 @@ u32 xe_gt_mcr_unicast_read(struct xe_gt *gt,
void xe_gt_mcr_unicast_write(struct xe_gt *gt, struct xe_reg_mcr reg_mcr,
u32 value, int group, int instance)
{
+ xe_gt_assert(gt, !IS_SRIOV_VF(gt_to_xe(gt)));
+
mcr_lock(gt);
rw_with_mcr_steering(gt, reg_mcr, MCR_OP_WRITE, group, instance, value);
mcr_unlock(gt);
@@ -658,6 +673,8 @@ void xe_gt_mcr_multicast_write(struct xe_gt *gt, struct xe_reg_mcr reg_mcr,
{
struct xe_reg reg = to_xe_reg(reg_mcr);
+ xe_gt_assert(gt, !IS_SRIOV_VF(gt_to_xe(gt)));
+
/*
* Synchronize with any unicast operations. Once we have exclusive
* access, the MULTICAST bit should already be set, so there's no need
--
2.25.1
next prev parent reply other threads:[~2024-01-12 15:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 15:26 [PATCH 0/8] VF Tweaks Michal Wajdeczko
2024-01-12 15:26 ` [PATCH 1/8] drm/xe/vf: Assume fixed GSM size if VF Michal Wajdeczko
2024-01-13 1:13 ` Matt Roper
2024-01-12 15:26 ` [PATCH 2/8] drm/xe/vf: Don't try to capture engine data unavailable to VF Michal Wajdeczko
2024-01-12 21:15 ` Rodrigo Vivi
2024-01-12 15:26 ` [PATCH 3/8] drm/xe/vf: Don't program MOCS if VF Michal Wajdeczko
2024-01-13 0:54 ` Matt Roper
2024-01-12 15:26 ` [PATCH 4/8] drm/xe/vf: Don't initialize stolen memory manager " Michal Wajdeczko
2024-02-06 17:47 ` Matt Roper
2024-01-12 15:26 ` [PATCH 5/8] drm/xe/vf: Don't check if LMEM is initialized " Michal Wajdeczko
2024-01-13 4:37 ` Matt Roper
2024-01-12 15:26 ` [PATCH 6/8] drm/xe/vf: Don't enable hwmon " Michal Wajdeczko
2024-01-16 20:04 ` Nilawar, Badal
2024-01-12 15:26 ` [PATCH 7/8] drm/xe/vf: Don't program PAT " Michal Wajdeczko
2024-01-13 0:56 ` Matt Roper
2024-01-12 15:26 ` Michal Wajdeczko [this message]
2024-01-13 1:11 ` [PATCH 8/8] drm/xe/vf: Don't support MCR registers " Matt Roper
2024-01-12 15:30 ` ✓ CI.Patch_applied: success for VF Tweaks Patchwork
2024-01-12 15:30 ` ✓ CI.checkpatch: " Patchwork
2024-01-12 15:31 ` ✓ CI.KUnit: " Patchwork
2024-01-12 15:38 ` ✓ CI.Build: " Patchwork
2024-01-12 15:38 ` ✓ CI.Hooks: " Patchwork
2024-01-12 15:40 ` ✓ CI.checksparse: " Patchwork
2024-01-12 16:03 ` ✓ CI.BAT: " Patchwork
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=20240112152649.849-9-michal.wajdeczko@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.d.roper@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