All of lore.kernel.org
 help / color / mirror / Atom feed
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, Vivi@intel.com,
	Alexander Usyskin <alexander.usyskin@intel.com>,
	dri-devel@lists.freedesktop.org,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: Re: [Intel-gfx] [PATCH v6 2/6] drm/i915/pxp: add device link between i915 and mei_pxp
Date: Tue, 24 Jan 2023 10:10:31 -0500	[thread overview]
Message-ID: <Y8/056lQW0dJpnYV@intel.com> (raw)
In-Reply-To: <20230124053150.3543928-3-alan.previn.teres.alexis@intel.com>

On Mon, Jan 23, 2023 at 09:31:46PM -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>
> ---
>  drivers/gpu/drm/i915/pxp/intel_pxp_tee.c   | 11 +++++++++++
>  drivers/gpu/drm/i915/pxp/intel_pxp_types.h |  6 ++++++
>  2 files changed, 17 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..cd5b86216506 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->component_dev_link = device_link_add(i915_kdev, tee_kdev, DL_FLAG_STATELESS);
> +		if (drm_WARN_ON(&i915->drm, !pxp->component_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->component_dev_link) {
> +		device_link_remove(i915_kdev, tee_kdev);
> +		pxp->component_dev_link = NULL;
> +	}

use the 'del' version instead of the 'remove' one.

if (pxp->dev_link)
	device_link_del(pxp->dev_link);

>  }
>  
>  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..efd2f3915abe 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_types.h
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_types.h
> @@ -32,6 +32,12 @@ struct intel_pxp {
>  	 * which are protected by &tee_mutex.
>  	 */
>  	struct i915_pxp_component *pxp_component;
> +
> +	/**
> +	 * @component_dev_link: device link of the pxp-component enforcing i915 as the
> +	 * consumer. This is needed for legacy platform (TGL/ADL) full-feature usage.

No need to add platform information here.

What about something shorter:

/* @dev_link: Enforce module relationship for power management ordering. */

> +	 */
> +	struct device_link *component_dev_link;

What about
     struct device_link *dev_link;

'component' is already part of the pxp struct.

>  	/**
>  	 * @pxp_component_added: track if the pxp component has been added.
>  	 * Set and cleared in tee init and fini functions respectively.
> -- 
> 2.39.0
> 

WARNING: multiple messages have this Message-ID (diff)
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, Vivi@intel.com,
	Alexander Usyskin <alexander.usyskin@intel.com>,
	dri-devel@lists.freedesktop.org,
	Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	Juston Li <justonli@chromium.org>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: Re: [PATCH v6 2/6] drm/i915/pxp: add device link between i915 and mei_pxp
Date: Tue, 24 Jan 2023 10:10:31 -0500	[thread overview]
Message-ID: <Y8/056lQW0dJpnYV@intel.com> (raw)
In-Reply-To: <20230124053150.3543928-3-alan.previn.teres.alexis@intel.com>

On Mon, Jan 23, 2023 at 09:31:46PM -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>
> ---
>  drivers/gpu/drm/i915/pxp/intel_pxp_tee.c   | 11 +++++++++++
>  drivers/gpu/drm/i915/pxp/intel_pxp_types.h |  6 ++++++
>  2 files changed, 17 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..cd5b86216506 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->component_dev_link = device_link_add(i915_kdev, tee_kdev, DL_FLAG_STATELESS);
> +		if (drm_WARN_ON(&i915->drm, !pxp->component_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->component_dev_link) {
> +		device_link_remove(i915_kdev, tee_kdev);
> +		pxp->component_dev_link = NULL;
> +	}

use the 'del' version instead of the 'remove' one.

if (pxp->dev_link)
	device_link_del(pxp->dev_link);

>  }
>  
>  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..efd2f3915abe 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_types.h
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_types.h
> @@ -32,6 +32,12 @@ struct intel_pxp {
>  	 * which are protected by &tee_mutex.
>  	 */
>  	struct i915_pxp_component *pxp_component;
> +
> +	/**
> +	 * @component_dev_link: device link of the pxp-component enforcing i915 as the
> +	 * consumer. This is needed for legacy platform (TGL/ADL) full-feature usage.

No need to add platform information here.

What about something shorter:

/* @dev_link: Enforce module relationship for power management ordering. */

> +	 */
> +	struct device_link *component_dev_link;

What about
     struct device_link *dev_link;

'component' is already part of the pxp struct.

>  	/**
>  	 * @pxp_component_added: track if the pxp component has been added.
>  	 * Set and cleared in tee init and fini functions respectively.
> -- 
> 2.39.0
> 

  reply	other threads:[~2023-01-24 15:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24  5:31 [Intel-gfx] [PATCH v6 0/6] drm/i915/pxp: Add missing cleanup steps for PXP global-teardown Alan Previn
2023-01-24  5:31 ` Alan Previn
2023-01-24  5:31 ` [Intel-gfx] [PATCH v6 1/6] mei: mei-me: resume device in prepare Alan Previn
2023-01-24  5:31   ` Alan Previn
2023-01-24  5:31 ` [Intel-gfx] [PATCH v6 2/6] drm/i915/pxp: add device link between i915 and mei_pxp Alan Previn
2023-01-24  5:31   ` Alan Previn
2023-01-24 15:10   ` Rodrigo Vivi [this message]
2023-01-24 15:10     ` Rodrigo Vivi
2023-01-25  4:11     ` [Intel-gfx] " Teres Alexis, Alan Previn
2023-01-25  4:11       ` Teres Alexis, Alan Previn
2023-01-24  5:31 ` [Intel-gfx] [PATCH v6 3/6] mei: clean pending read with vtag on bus Alan Previn
2023-01-24  5:31   ` Alan Previn
2023-01-24  5:31 ` [Intel-gfx] [PATCH v6 4/6] drm/i915/pxp: Invalidate all PXP fw sessions during teardown Alan Previn
2023-01-24  5:31   ` Alan Previn
2023-01-24  5:31 ` [Intel-gfx] [PATCH v6 5/6] drm/i915/pxp: Trigger the global teardown for before suspending Alan Previn
2023-01-24  5:31   ` Alan Previn
2023-01-24 15:17   ` [Intel-gfx] " Rodrigo Vivi
2023-01-24 15:17     ` Rodrigo Vivi
2023-01-24 18:08     ` [Intel-gfx] " Juston Li
2023-01-24 18:08       ` Juston Li
2023-01-24 18:43       ` [Intel-gfx] " Rodrigo Vivi
2023-01-25  4:10         ` Teres Alexis, Alan Previn
2023-01-24  5:31 ` [Intel-gfx] [PATCH v6 6/6] drm/i915/pxp: Pxp hw init should be in resume_complete Alan Previn
2023-01-24  5:31   ` Alan Previn
2023-01-24  6:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pxp: Add missing cleanup steps for PXP global-teardown Patchwork
2023-01-24  7:40 ` [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=Y8/056lQW0dJpnYV@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=Vivi@intel.com \
    --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.