Commit d33dc1dc authored by Matt Roper's avatar Matt Roper Committed by Rodrigo Vivi

drm/xe: Fix xe_mmio_rmw32 operation

xe_mmio_rmw32 was failing to invert the passed in mask, resulting in a
register update that wasn't the expected RMW operation.  Fortunately the
impact of this mistake was limited, since this function isn't heavily
used in Xe right now; this will mostly fix some GuC PM interrupt
unmasking.

v2:
 - Rename parameters as 'clr' and 'set' to clarify semantics.  (Lucas)

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20230421145006.10940-1-matthew.d.roper@intel.comSigned-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 7500477d
......@@ -42,13 +42,13 @@ static inline u32 xe_mmio_read32(struct xe_gt *gt, u32 reg)
return readl(gt->mmio.regs + reg);
}
static inline u32 xe_mmio_rmw32(struct xe_gt *gt, u32 reg, u32 mask,
u32 val)
static inline u32 xe_mmio_rmw32(struct xe_gt *gt, u32 reg, u32 clr,
u32 set)
{
u32 old, reg_val;
old = xe_mmio_read32(gt, reg);
reg_val = (old & mask) | val;
reg_val = (old & ~clr) | set;
xe_mmio_write32(gt, reg, reg_val);
return old;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment