[Intel-xe] [PATCH v2 4/8] drm/xe: Fix xe_mmio_rmw32 operation

Jani Nikula jani.nikula at linux.intel.com
Thu Apr 13 12:38:49 UTC 2023


On Thu, 13 Apr 2023, Maarten Lankhorst <maarten.lankhorst at linux.intel.com> wrote:
> Hey,
>
> I thought this was on purpose, and xe_mmio_rmw32 specified which parts 
> to keep,
>
> as opposed to i915 which set a clear mask.

If this is intentionally different from i915 rmw functions, I think it's
a horrible idea, and will trip people over for years to come.

BR,
Jani.


>
> If this was not, can you also fix display/xe_de.h to no longer invert?
>
> Otherwise, you break the entirety of display.
>
> ~Maarten
>
> On 2023-04-13 00:52, Matt Roper wrote:
>> xe_mmio_rmw32 was failing to invert the passed in mask, resulting in a
>> register updated that wasn't the expected RMW operation.  Fortunately
>> the impact of this mistake was limited, since xe_mmio_rmw32() is only
>> used in two places to unmask certain GuC-related interrupts.
>>
>> Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
>> ---
>>   drivers/gpu/drm/xe/xe_mmio.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_mmio.h b/drivers/gpu/drm/xe/xe_mmio.h
>> index 388a633b438b..a3b7f9f5db67 100644
>> --- a/drivers/gpu/drm/xe/xe_mmio.h
>> +++ b/drivers/gpu/drm/xe/xe_mmio.h
>> @@ -40,7 +40,7 @@ static inline u32 xe_mmio_rmw32(struct xe_gt *gt, u32 reg, u32 mask,
>>   	u32 old, reg_val;
>>   
>>   	old = xe_mmio_read32(gt, reg);
>> -	reg_val = (old & mask) | val;
>> +	reg_val = (old & ~mask) | val;
>>   	xe_mmio_write32(gt, reg, reg_val);
>>   
>>   	return old;

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-xe mailing list