Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>
To: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v9 1/1] drm/i915/pxp: Promote pxp subsystem to top-level of i915
Date: Tue, 6 Dec 2022 18:29:47 +0000	[thread overview]
Message-ID: <016146e00a5097da3007c72d74d4e1bf222336fd.camel@intel.com> (raw)
In-Reply-To: <e8305b0f-b59c-2406-92a4-58254d9b6701@intel.com>



On Mon, 2022-12-05 at 21:06 -0800, Ceraolo Spurio, Daniele wrote:
> 
> On 12/5/2022 4:03 PM, Alan Previn wrote:

Alan:[snip]

> > @@ -39,18 +45,26 @@
> >    * performed via the mei_pxp component module.
> >    */
> >   
> > -struct intel_gt *pxp_to_gt(const struct intel_pxp *pxp)
> > +bool intel_pxp_is_supported(const struct intel_pxp *pxp)
> >   {
> > -	return container_of(pxp, struct intel_gt, pxp);
> > +	if (!IS_ENABLED(CONFIG_DRM_I915_PXP))
> > +		return false;
> > +	else if (!pxp)
> > +		return false;
> 
> nit: this could be squashed in a single line:
> 
>      if (!IS_ENABLED(CONFIG_DRM_I915_PXP) || !pxp)
> 
> not a blocker
> 
> > +	return (INTEL_INFO(pxp->ctrl_gt->i915)->has_pxp && VDBOX_MASK(pxp->ctrl_gt));
> >   }
> >   
> >   bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
> >   {
> > +	if (!pxp)
> > +		return false;
> >   	return pxp->ce;
> 
> nit: this can be squashed as:
> 
> return pxp && pxp->ce;
> 
> same for the is_active below. not a blocker
> 
> >   }
> >   
> >   bool intel_pxp_is_active(const struct intel_pxp *pxp)
> >   {
> > +	if (!pxp)
> > +		return false;
> >   	return pxp->arb_is_valid;
> >   }
> > 
> > 

Alan: okay - will handle some of these nits since i need to re-rev anyway
Alan:[snip]

> 
> 
> This comment doesn't really explain why we exclude the case with 
> media_gt. I would have preferred a line to explain that the module only 
> works for pre-media_gt platforms. not a blocker.
> 
Alan: Okay will add a comment.
Alan:[snip]

> > @@ -18,7 +18,7 @@
> >   
> >   int intel_pxp_huc_load_and_auth(struct intel_pxp *pxp)
> >   {
> > -	struct intel_gt *gt = pxp_to_gt(pxp);
> > +	struct intel_gt *gt = pxp->ctrl_gt;
> 
> This is called from outside the PXP code, so we need to check the pxp 
> pointer before de-referencing it (see also pxp->pxp_component further 
> down this function). It does look like the stack it's kind of circular 
> so it should be safe (pxp bind -> huc load -> this function), but IMO 
> better stick to the rule that all functions called from outside need a 
> check.
> 
> With this fixed:
> 
> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> 
Alan:Thanks will do - will respin rev10
Alan:[snip]



  reply	other threads:[~2022-12-06 18:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06  0:03 [Intel-gfx] [PATCH v9 1/1] drm/i915/pxp: Promote pxp subsystem to top-level of i915 Alan Previn
2022-12-06  1:43 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [v9,1/1] " Patchwork
2022-12-06  2:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-06  4:32 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-12-06  5:06 ` [Intel-gfx] [PATCH v9 1/1] " Ceraolo Spurio, Daniele
2022-12-06 18:29   ` Teres Alexis, Alan Previn [this message]
2022-12-06 10:04 ` Tvrtko Ursulin
2022-12-06 18:26   ` Teres Alexis, Alan Previn
2022-12-07 10:10     ` Tvrtko Ursulin
2022-12-07 12:08       ` Teres Alexis, Alan Previn
2022-12-07 13:46         ` Tvrtko Ursulin
2022-12-07 22:37           ` Teres Alexis, Alan Previn
  -- strict thread matches above, loose matches on Subject: below --
2022-12-06 21:27 Alan Previn
2022-12-06 21:28 ` Teres Alexis, Alan Previn

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=016146e00a5097da3007c72d74d4e1bf222336fd.camel@intel.com \
    --to=alan.previn.teres.alexis@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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