dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Lizhi Hou <lizhi.hou@amd.com>,
	ogabbay@kernel.org, quic_jhugo@quicinc.com,
	maciej.falkowski@linux.intel.com,
	dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, max.zhen@amd.com, sonal.santan@amd.com
Subject: Re: [PATCH] accel/amdxdna: Resume power for creating and destroying hardware context
Date: Wed, 8 Oct 2025 10:03:43 -0500	[thread overview]
Message-ID: <bb0e5610-2c59-4d74-9585-d9238e7143d6@kernel.org> (raw)
In-Reply-To: <20251008045324.4171807-1-lizhi.hou@amd.com>

On 10/7/25 11:53 PM, Lizhi Hou wrote:
> When the hardware is powered down by auto-suspend, creating or destroying
> a hardware context without resuming power will fail.
> Call amdxdna_pm_resume_get() before requesting the hardware to create or
> destroy a hardware context.
> 
> Fixes: 063db451832b ("accel/amdxdna: Enhance runtime power management")
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>

> ---
>   drivers/accel/amdxdna/aie2_ctx.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
> index 691fdb3b008f..ab4d66f1325d 100644
> --- a/drivers/accel/amdxdna/aie2_ctx.c
> +++ b/drivers/accel/amdxdna/aie2_ctx.c
> @@ -610,10 +610,14 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
>   		goto free_entity;
>   	}
>   
> +	ret = amdxdna_pm_resume_get(xdna);
> +	if (ret)
> +		goto free_col_list;
> +
>   	ret = aie2_alloc_resource(hwctx);
>   	if (ret) {
>   		XDNA_ERR(xdna, "Alloc hw resource failed, ret %d", ret);
> -		goto free_col_list;
> +		goto suspend_put;
>   	}
>   
>   	ret = aie2_map_host_buf(xdna->dev_handle, hwctx->fw_ctx_id,
> @@ -628,6 +632,7 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
>   		XDNA_ERR(xdna, "Create syncobj failed, ret %d", ret);
>   		goto release_resource;
>   	}
> +	amdxdna_pm_suspend_put(xdna);
>   
>   	hwctx->status = HWCTX_STAT_INIT;
>   	ndev = xdna->dev_handle;
> @@ -640,6 +645,8 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
>   
>   release_resource:
>   	aie2_release_resource(hwctx);
> +suspend_put:
> +	amdxdna_pm_suspend_put(xdna);
>   free_col_list:
>   	kfree(hwctx->col_list);
>   free_entity:


  reply	other threads:[~2025-10-08 15:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-08  4:53 [PATCH] accel/amdxdna: Resume power for creating and destroying hardware context Lizhi Hou
2025-10-08 15:03 ` Mario Limonciello [this message]
2025-10-08 15:39   ` Lizhi Hou

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=bb0e5610-2c59-4d74-9585-d9238e7143d6@kernel.org \
    --to=superm1@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=maciej.falkowski@linux.intel.com \
    --cc=max.zhen@amd.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=sonal.santan@amd.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;
as well as URLs for NNTP newsgroup(s).