[PATCH] drm/xe/pcode: Initialize data0 for pcode read routine
Summers, Stuart
stuart.summers at intel.com
Mon Aug 11 15:29:16 UTC 2025
On Sun, 2025-08-10 at 11:26 +0200, Raag Jadav wrote:
> On Fri, Aug 08, 2025 at 03:36:56PM +0000, stuartsummers wrote:
> > There are two registered filled in when reading data from
> > pcode besides the mailbox itself. Currently we allow a NULL
> > value for the second of these two (data1) and assume the first
> > is defined. However many of the routines that are calling
> > this function assume that pcode will ignore the value being
> > passed in and so leave that first value (data0) defined but
> > uninitialized. To be safe, make sure this value is always
> > initialized to something (0 generally) in the event pcode
> > behavior changes and starts using this value.
>
> I'm not particularly against it but let's say if/when this happens,
> can you guarantee the expected value to be 0?
You mean the expected response from pcode to be 0? I think the
expectation here will be command specific and most of the commands
impacted in this patch *should* be noop - i.e. the respective pcode
mbox command will likely not be using this. But given pcode is an
external interface not directly controlled by the driver, having some
well defined initial value IMO is safer. We don't need that to be 0
specifically, but I chose that here for consistency.
Thanks,
Stuart
>
> Raag
More information about the Intel-xe
mailing list