* Re: [Intel-gfx] [PATCH] drm/i915: Skip pxp init if gt is wedged
2023-10-26 21:54 Zhanjun Dong
@ 2023-10-27 7:13 ` Jani Nikula
2023-10-31 21:38 ` Teres Alexis, Alan Previn
0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2023-10-27 7:13 UTC (permalink / raw)
To: Zhanjun Dong, intel-gfx, dri-devel
On Thu, 26 Oct 2023, Zhanjun Dong <zhanjun.dong@intel.com> wrote:
> gt wedged is fatal error, skip the pxp init on this situation.
More information is needed in the commit message. When do you encounter
this situation?
I'll note that nobody checks intel_pxp_init() return status, so this
silently skips PXP.
BR,
Jani.
>
> Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
> ---
> drivers/gpu/drm/i915/pxp/intel_pxp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c
> index dc327cf40b5a..923f233c91e1 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp.c
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c
> @@ -212,6 +212,9 @@ int intel_pxp_init(struct drm_i915_private *i915)
> if (!gt)
> return -ENODEV;
>
> + if (intel_gt_is_wedged(gt))
> + return -ENODEV;
> +
> /*
> * At this point, we will either enable full featured PXP capabilities
> * including session and object management, or we will init the backend tee
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: Skip pxp init if gt is wedged
2023-10-27 7:13 ` [Intel-gfx] " Jani Nikula
@ 2023-10-31 21:38 ` Teres Alexis, Alan Previn
2023-11-01 17:57 ` Dong, Zhanjun
0 siblings, 1 reply; 5+ messages in thread
From: Teres Alexis, Alan Previn @ 2023-10-31 21:38 UTC (permalink / raw)
To: Dong, Zhanjun, dri-devel@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com
On Fri, 2023-10-27 at 10:13 +0300, Jani Nikula wrote:
> On Thu, 26 Oct 2023, Zhanjun Dong <zhanjun.dong@intel.com> wrote:
>
alan:snip
> I'll note that nobody checks intel_pxp_init() return status, so this
> silently skips PXP.
>
> BR,
> Jani.
alan:snip
> > + if (intel_gt_is_wedged(gt))
> > + return -ENODEV;
> > +
alan: wondering if we can add a drm_dbg in the caller of intel_pxp_init and
use a unique return value for the case of gt_is_wedged (for example: -ENXIO.).
As we know gt being wedged at startup basically means all gt usage is dead
and therefore we cant enable PXP (along with everything else that needs submission/
guc/ etc). With a drm-debug in the caller that prints that return value, it
helps us to differentiate between gt-is-wedged vs platform config doesnt support
PXP. However, this would mean new drm-debug 'noise' for platforms that i915 just
doesn't support PXP on at all which would be okay if dont use drm_warn or drm_err
and use 'softer' message like "PXP skipped with %d".
Please treat above comment as a "nit" - i.e. existing patch is good enough for me...
(after addressing Jani's request for more commit message info). ...alan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: Skip pxp init if gt is wedged
2023-10-31 21:38 ` Teres Alexis, Alan Previn
@ 2023-11-01 17:57 ` Dong, Zhanjun
0 siblings, 0 replies; 5+ messages in thread
From: Dong, Zhanjun @ 2023-11-01 17:57 UTC (permalink / raw)
To: Teres Alexis, Alan Previn, dri-devel@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com
On 2023-10-31 5:38 p.m., Teres Alexis, Alan Previn wrote:
> On Fri, 2023-10-27 at 10:13 +0300, Jani Nikula wrote:
>> On Thu, 26 Oct 2023, Zhanjun Dong <zhanjun.dong@intel.com> wrote:
>>
> alan:snip
>> I'll note that nobody checks intel_pxp_init() return status, so this
>> silently skips PXP.
>>
>> BR,
>> Jani.
>
> alan:snip
>>> + if (intel_gt_is_wedged(gt))
>>> + return -ENODEV;
>>> +
>
> alan: wondering if we can add a drm_dbg in the caller of intel_pxp_init and
> use a unique return value for the case of gt_is_wedged (for example: -ENXIO.).
> As we know gt being wedged at startup basically means all gt usage is dead
> and therefore we cant enable PXP (along with everything else that needs submission/
> guc/ etc). With a drm-debug in the caller that prints that return value, it
> helps us to differentiate between gt-is-wedged vs platform config doesnt support
> PXP. However, this would mean new drm-debug 'noise' for platforms that i915 just
> doesn't support PXP on at all which would be okay if dont use drm_warn or drm_err
> and use 'softer' message like "PXP skipped with %d".
>
> Please treat above comment as a "nit" - i.e. existing patch is good enough for me...
> (after addressing Jani's request for more commit message info). ...alan
>
>
Thanks Alan.
I agree, add more drm-debug looks like add noise in case of
gt_is_wedged, existing code already output useful info.
If logs already let us know gt_wedged happens and we are not expect pxp
init running on gt wedged condition, then silently skip pxp_init looks
like match the expectation.
I will re-post with updated commit message later.
Regards,
Zhanjun
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] drm/i915: Skip pxp init if gt is wedged
@ 2023-11-01 21:44 Zhanjun Dong
2023-11-03 15:45 ` [Intel-gfx] " Rodrigo Vivi
0 siblings, 1 reply; 5+ messages in thread
From: Zhanjun Dong @ 2023-11-01 21:44 UTC (permalink / raw)
To: intel-gfx, dri-devel; +Cc: Zhanjun Dong
The gt wedged could be triggered by missing guc firmware file, HW not
working, etc. Once triggered, it means all gt usage is dead, therefore we
can't enable pxp under this fatal error condition.
v2: Updated commit message.
Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
---
drivers/gpu/drm/i915/pxp/intel_pxp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c
index dc327cf40b5a..923f233c91e1 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c
@@ -212,6 +212,9 @@ int intel_pxp_init(struct drm_i915_private *i915)
if (!gt)
return -ENODEV;
+ if (intel_gt_is_wedged(gt))
+ return -ENODEV;
+
/*
* At this point, we will either enable full featured PXP capabilities
* including session and object management, or we will init the backend tee
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: Skip pxp init if gt is wedged
2023-11-01 21:44 [PATCH] drm/i915: Skip pxp init if gt is wedged Zhanjun Dong
@ 2023-11-03 15:45 ` Rodrigo Vivi
0 siblings, 0 replies; 5+ messages in thread
From: Rodrigo Vivi @ 2023-11-03 15:45 UTC (permalink / raw)
To: Zhanjun Dong; +Cc: intel-gfx, dri-devel
On Wed, Nov 01, 2023 at 02:44:46PM -0700, Zhanjun Dong wrote:
> The gt wedged could be triggered by missing guc firmware file, HW not
> working, etc. Once triggered, it means all gt usage is dead, therefore we
> can't enable pxp under this fatal error condition.
>
> v2: Updated commit message.
>
> Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
> ---
> drivers/gpu/drm/i915/pxp/intel_pxp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c
> index dc327cf40b5a..923f233c91e1 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp.c
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c
> @@ -212,6 +212,9 @@ int intel_pxp_init(struct drm_i915_private *i915)
> if (!gt)
> return -ENODEV;
>
> + if (intel_gt_is_wedged(gt))
> + return -ENODEV;
we need some error message.
also we need to fix the fact that these returns are entirely ignored.
or you convert this function to void and then add a message here before
return; on this case.
Or you return some different error and at probe if error but error different
then ENODEV you print a message saying pxp init failed.
but we need some log/error information. I honestly would prefer to convert to
void and print the msg here.
with some changes like this you can count with my rv-b
> +
> /*
> * At this point, we will either enable full featured PXP capabilities
> * including session and object management, or we will init the backend tee
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-03 15:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-01 21:44 [PATCH] drm/i915: Skip pxp init if gt is wedged Zhanjun Dong
2023-11-03 15:45 ` [Intel-gfx] " Rodrigo Vivi
-- strict thread matches above, loose matches on Subject: below --
2023-10-26 21:54 Zhanjun Dong
2023-10-27 7:13 ` [Intel-gfx] " Jani Nikula
2023-10-31 21:38 ` Teres Alexis, Alan Previn
2023-11-01 17:57 ` Dong, Zhanjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox