From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
intel-gfx@lists.freedesktop.org,
Alexander Usyskin <alexander.usyskin@intel.com>,
dri-devel@lists.freedesktop.org,
Tomas Winkler <tomas.winkler@intel.com>,
Vivi@freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v7 2/6] drm/i915/pxp: add device link between i915 and mei_pxp
Date: Wed, 25 Jan 2023 10:53:21 -0500 [thread overview]
Message-ID: <Y9FQcS6jyHCB2YMt@intel.com> (raw)
In-Reply-To: <20230125082637.118970-3-alan.previn.teres.alexis@intel.com>
On Wed, Jan 25, 2023 at 12:26:33AM -0800, Alan Previn wrote:
> From: Alexander Usyskin <alexander.usyskin@intel.com>
>
> Add device link with i915 as consumer and mei_pxp as supplier
> to ensure proper ordering of power flows.
>
> V2: condition on absence of heci_pxp to filter out DG
>
> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
> ---
> drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 11 +++++++++++
> drivers/gpu/drm/i915/pxp/intel_pxp_types.h | 3 +++
> 2 files changed, 14 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
> index 73aa8015f828..b5bc0b87a1d0 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
> @@ -127,6 +127,12 @@ static int i915_pxp_tee_component_bind(struct device *i915_kdev,
> intel_wakeref_t wakeref;
> int ret = 0;
>
> + if (!HAS_HECI_PXP(i915)) {
> + pxp->dev_link = device_link_add(i915_kdev, tee_kdev, DL_FLAG_STATELESS);
> + if (drm_WARN_ON(&i915->drm, !pxp->dev_link))
> + return -ENODEV;
> + }
> +
> mutex_lock(&pxp->tee_mutex);
> pxp->pxp_component = data;
> pxp->pxp_component->tee_dev = tee_kdev;
> @@ -169,6 +175,11 @@ static void i915_pxp_tee_component_unbind(struct device *i915_kdev,
> mutex_lock(&pxp->tee_mutex);
> pxp->pxp_component = NULL;
> mutex_unlock(&pxp->tee_mutex);
> +
> + if (pxp->dev_link) {
> + device_link_del(pxp->dev_link);
> + pxp->dev_link = NULL;
since no one else is doing the null assignment I thought this was taken care
by the core function, but it doesn't do that indeed.
Maybe in the most used case, folks are sure that this won't be hit without
having running the device_link_add previously, what may or may not be our case.
Anyway better safe than sorry, so let's keep it.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> + }
> }
>
> static const struct component_ops i915_pxp_tee_component_ops = {
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_types.h b/drivers/gpu/drm/i915/pxp/intel_pxp_types.h
> index 7dc5f08d1583..007de49e1ea4 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_types.h
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_types.h
> @@ -32,6 +32,9 @@ struct intel_pxp {
> * which are protected by &tee_mutex.
> */
> struct i915_pxp_component *pxp_component;
> +
> + /* @dev_link: Enforce module relationship for power management ordering. */
> + struct device_link *dev_link;
> /**
> * @pxp_component_added: track if the pxp component has been added.
> * Set and cleared in tee init and fini functions respectively.
> --
> 2.39.0
>
next prev parent reply other threads:[~2023-01-25 15:53 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 8:26 [Intel-gfx] [PATCH v7 0/6] drm/i915/pxp: Add missing cleanup steps for PXP global-teardown Alan Previn
2023-01-25 8:26 ` Alan Previn
2023-01-25 8:26 ` [Intel-gfx] [PATCH v7 1/6] mei: mei-me: resume device in prepare Alan Previn
2023-01-25 8:26 ` Alan Previn
2023-01-27 9:08 ` [Intel-gfx] " Greg Kroah-Hartman
2023-01-27 9:08 ` Greg Kroah-Hartman
2023-01-25 8:26 ` [Intel-gfx] [PATCH v7 2/6] drm/i915/pxp: add device link between i915 and mei_pxp Alan Previn
2023-01-25 8:26 ` Alan Previn
2023-01-25 15:53 ` Rodrigo Vivi [this message]
2023-01-25 8:26 ` [Intel-gfx] [PATCH v7 3/6] mei: clean pending read with vtag on bus Alan Previn
2023-01-25 8:26 ` Alan Previn
2023-01-25 17:28 ` [Intel-gfx] " Rodrigo Vivi
2023-01-25 17:28 ` Rodrigo Vivi
2023-01-25 18:01 ` [Intel-gfx] " Greg Kroah-Hartman
2023-01-25 18:01 ` Greg Kroah-Hartman
2023-01-27 9:09 ` [Intel-gfx] " Greg Kroah-Hartman
2023-01-27 9:09 ` Greg Kroah-Hartman
2023-01-27 19:07 ` [Intel-gfx] " Teres Alexis, Alan Previn
2023-01-27 19:07 ` Teres Alexis, Alan Previn
2023-01-27 20:26 ` [Intel-gfx] " Rodrigo Vivi
2023-01-27 20:26 ` Rodrigo Vivi
2023-01-27 9:08 ` [Intel-gfx] " Greg Kroah-Hartman
2023-01-27 9:08 ` Greg Kroah-Hartman
2023-01-25 8:26 ` [Intel-gfx] [PATCH v7 4/6] drm/i915/pxp: Invalidate all PXP fw sessions during teardown Alan Previn
2023-01-25 8:26 ` Alan Previn
2023-01-25 8:26 ` [Intel-gfx] [PATCH v7 5/6] drm/i915/pxp: Trigger the global teardown for before suspending Alan Previn
2023-01-25 8:26 ` Alan Previn
2023-01-25 8:26 ` [Intel-gfx] [PATCH v7 6/6] drm/i915/pxp: Pxp hw init should be in resume_complete Alan Previn
2023-01-25 8:26 ` Alan Previn
2023-01-25 9:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pxp: Add missing cleanup steps for PXP global-teardown Patchwork
2023-01-25 15:11 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=Y9FQcS6jyHCB2YMt@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=Vivi@freedesktop.org \
--cc=alan.previn.teres.alexis@intel.com \
--cc=alexander.usyskin@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tomas.winkler@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.