Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/gsc: Add status check during gsc header readout
Date: Tue, 23 Jan 2024 20:19:32 +0200	[thread overview]
Message-ID: <878r4fnc97.fsf@intel.com> (raw)
In-Reply-To: <d32e4718-53a6-4ebb-87cb-3b50cfc283a6@intel.com>

On Tue, 23 Jan 2024, Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> wrote:
> On 1/22/2024 10:28 PM, Suraj Kandpal wrote:
>> Before checking if data is present in the message reply check the
>> status in header and see if it indicates any error.
>>
>> --v2
>> - Use drm_err() instead of drm_dbg_kms() [Daniele]
>>
>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
>> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> ---
>>   drivers/gpu/drm/xe/xe_gsc_submit.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gsc_submit.c b/drivers/gpu/drm/xe/xe_gsc_submit.c
>> index 9ecc1ead6844..3c402fe36026 100644
>> --- a/drivers/gpu/drm/xe/xe_gsc_submit.c
>> +++ b/drivers/gpu/drm/xe/xe_gsc_submit.c
>> @@ -125,11 +125,18 @@ int xe_gsc_read_out_header(struct xe_device *xe,
>>   {
>>   	u32 marker = mtl_gsc_header_rd(xe, map, offset, validity_marker);
>>   	u32 size = mtl_gsc_header_rd(xe, map, offset, message_size);
>> +	u32 status = mtl_gsc_header_rd(xe, map, offset, status);
>>   	u32 payload_size = size - GSC_HDR_SIZE;
>>   
>>   	if (marker != GSC_HECI_VALIDITY_MARKER)
>>   		return -EPROTO;
>>   
>> +	if (status != 0) {
>> +		drm_err(xe, "GSC header readout indicates error: %d\n",
>
> Sorry I didn't notice it in the first rev, but this should be &xe->drm 
> and not just xe. Note that since drm is the first thing inside the xe 
> structure, a pointer to the xe structure also points to xe->drm, so it 
> still works like this, but it isn't clean.

Does it actually build? There's no xe->dev member. See the definitions
of drm_err and __drm_printk.

Btw Suraj's messages didn't get through to the list, and thus CI wasn't
triggered.

BR,
Jani.



>
> Daniele
>
>> +			status);
>> +		return -EINVAL;
>> +	}
>> +
>>   	if (size < GSC_HDR_SIZE || payload_size < min_payload_size)
>>   		return -ENODATA;
>>   
>

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-01-23 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240123062846.577031-1-suraj.kandpal@intel.com>
2024-01-23 17:58 ` [PATCH] drm/xe/gsc: Add status check during gsc header readout Daniele Ceraolo Spurio
2024-01-23 18:19   ` Jani Nikula [this message]
2024-01-24  4:52 Suraj Kandpal
     [not found] <20240122063545.495082-1-suraj.kandpal@intel.com>
2024-01-22 21:54 ` Daniele Ceraolo Spurio

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=878r4fnc97.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=suraj.kandpal@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