mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: David Zhang <yidong.zhang@amd.com>, <quic_jhugo@quicinc.com>,
	<karol.wachowski@linux.intel.com>, <max.zhen@amd.com>,
	<ogabbay@kernel.org>, <dri-devel@lists.freedesktop.org>,
	<linux-kernel@vger.kernel.org>
Cc: <sonal.santan@amd.com>, <mario.limonciello@amd.com>,
	Hayden Laccabue <hayden.laccabue@amd.com>
Subject: Re: [PATCH V4 06/19] accel/amdxdna: Add AIE version query to aie4_get_info
Date: Mon, 12 Oct 2026 13:55:57 -0700	[thread overview]
Message-ID: <d16aa986-2f98-97c4-fad9-5fca23f4bc95@amd.com> (raw)
In-Reply-To: <20261009225343.3079074-7-yidong.zhang@amd.com>


On 10/9/26 15:53, David Zhang wrote:
> Add AIE version query via DRM_AMDXDNA_GET_INFO. The NPU firmware
> version query already existed internally; it is now also exposed
> through this ioctl alongside the new AIE version query.
>
> These versions are mandatory once released, the firmware management
> interfaces must support those queries in their stable version.
> Propagating any failure to abort device initialization is intentional.
>
> Co-developed-by: Hayden Laccabue <hayden.laccabue@amd.com>
> Signed-off-by: Hayden Laccabue <hayden.laccabue@amd.com>
> Signed-off-by: David Zhang <yidong.zhang@amd.com>
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
> ---
>   drivers/accel/amdxdna/aie4_message.c  | 20 ++++++++++++++++++++
>   drivers/accel/amdxdna/aie4_msg_priv.h | 11 +++++++++++
>   drivers/accel/amdxdna/aie4_pci.c      | 10 ++++++++++
>   drivers/accel/amdxdna/aie4_pci.h      |  2 ++
>   4 files changed, 43 insertions(+)
>
> diff --git a/drivers/accel/amdxdna/aie4_message.c b/drivers/accel/amdxdna/aie4_message.c
> index f67aa8ba943c..c83f81a0e65b 100644
> --- a/drivers/accel/amdxdna/aie4_message.c
> +++ b/drivers/accel/amdxdna/aie4_message.c
> @@ -75,6 +75,26 @@ int aie4_query_aie_metadata(struct amdxdna_dev_hdl *ndev,
>   	return 0;
>   }
>   
> +int aie4_query_aie_version(struct amdxdna_dev_hdl *ndev,
> +			   struct amdxdna_drm_query_aie_version *version)
> +{
> +	DECLARE_AIE_MSG(aie4_msg_aie4_version_info, AIE4_MSG_OP_AIE_VERSION_INFO);
> +	struct amdxdna_dev *xdna = ndev->aie.xdna;
> +	int ret;
> +
> +	ret = aie_send_mgmt_msg_wait(&ndev->aie, &msg);
> +	if (ret)
> +		return ret;
> +
> +	XDNA_DBG(xdna, "Query AIE version - major: %u minor: %u",
> +		 resp.major, resp.minor);
> +
> +	version->major = resp.major;
> +	version->minor = resp.minor;
> +
> +	return 0;
> +}
> +
>   int aie4_query_npu_firmware_version(struct amdxdna_dev_hdl *ndev,
>   				    struct amdxdna_drm_query_firmware_version *fw_version)
>   {
> diff --git a/drivers/accel/amdxdna/aie4_msg_priv.h b/drivers/accel/amdxdna/aie4_msg_priv.h
> index b9f7c61f36e3..81842fa1d6ce 100644
> --- a/drivers/accel/amdxdna/aie4_msg_priv.h
> +++ b/drivers/accel/amdxdna/aie4_msg_priv.h
> @@ -22,6 +22,7 @@ enum aie4_msg_opcode {
>   	AIE4_MSG_OP_CREATE_HW_CONTEXT                = 0x30003,
>   	AIE4_MSG_OP_DESTROY_HW_CONTEXT               = 0x30004,
>   	AIE4_MSG_OP_AIE_TILE_INFO                    = 0x30006,
> +	AIE4_MSG_OP_AIE_VERSION_INFO                 = 0x30007,
>   
>   	AIE4_MSG_OP_ATTACH_WORK_BUFFER               = 0x40001,
>   };
> @@ -160,6 +161,16 @@ struct aie4_msg_aie4_tile_info_resp {
>   	struct aie4_tile_info info;
>   } __packed;
>   
> +struct aie4_msg_aie4_version_info_req {
> +	__u32 resvd;
> +} __packed;
> +
> +struct aie4_msg_aie4_version_info_resp {
> +	enum aie4_msg_status status;
> +	__u16 major;
> +	__u16 minor;
> +} __packed;
> +
>   struct aie4_msg_query_cert_firmware_version_req {
>   	__u32 resvd;
>   } __packed;
> diff --git a/drivers/accel/amdxdna/aie4_pci.c b/drivers/accel/amdxdna/aie4_pci.c
> index 1eeb1cb73b27..1cbd1665a28f 100644
> --- a/drivers/accel/amdxdna/aie4_pci.c
> +++ b/drivers/accel/amdxdna/aie4_pci.c
> @@ -289,6 +289,10 @@ static int aie4_query(struct amdxdna_dev_hdl *ndev)
>   	if (ret)
>   		return ret;
>   
> +	ret = aie4_query_aie_version(ndev, &ndev->aie.version);
> +	if (ret)
> +		return ret;
> +
>   	ret = aie4_query_aie_metadata(ndev, &ndev->aie.metadata);
>   	if (ret)
>   		return ret;
> @@ -595,6 +599,12 @@ static int aie4_get_info(struct amdxdna_client *client, struct amdxdna_drm_get_i
>   	case DRM_AMDXDNA_QUERY_AIE_METADATA:
>   		ret = amdxdna_get_metadata(&ndev->aie, client, args);
>   		break;
> +	case DRM_AMDXDNA_QUERY_AIE_VERSION:
> +		ret = amdxdna_get_aie_version(client, args, &ndev->aie.version);
> +		break;
> +	case DRM_AMDXDNA_QUERY_FIRMWARE_VERSION:
> +		ret = amdxdna_get_firmware_version(client, args, &xdna->fw_ver);
> +		break;
>   	default:
>   		XDNA_ERR(xdna, "Not supported request parameter %u", args->param);
>   		ret = -EOPNOTSUPP;
> diff --git a/drivers/accel/amdxdna/aie4_pci.h b/drivers/accel/amdxdna/aie4_pci.h
> index 940e67347d74..5ae5e8427a3b 100644
> --- a/drivers/accel/amdxdna/aie4_pci.h
> +++ b/drivers/accel/amdxdna/aie4_pci.h
> @@ -69,6 +69,8 @@ enum aie4_fw_feature {
>   /* aie4_message.c */
>   int aie4_query_aie_metadata(struct amdxdna_dev_hdl *ndev,
>   			    struct amdxdna_drm_query_aie_metadata *metadata);
> +int aie4_query_aie_version(struct amdxdna_dev_hdl *ndev,
> +			   struct amdxdna_drm_query_aie_version *version);
>   int aie4_suspend_fw(struct amdxdna_dev_hdl *ndev);
>   int aie4_attach_work_buffer(struct amdxdna_dev_hdl *ndev);
>   int aie4_query_npu_firmware_version(struct amdxdna_dev_hdl *ndev,

  reply	other threads:[~2026-10-12 20:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 22:53 [PATCH V4 00/19] accel/amdxdna: Kernel submission and PM for AIE4 David Zhang
2026-10-09 22:53 ` [PATCH V4 01/19] accel/amdxdna: Rename NPU3 firmware files David Zhang
2026-10-09 22:53 ` [PATCH V4 02/19] accel/amdxdna: Remove mmap for doorbell David Zhang
2026-10-12 20:37   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 03/19] accel/amdxdna: Add CERT firmware version support David Zhang
2026-10-12 20:39   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 04/19] accel/amdxdna: Support firmware 6.0 David Zhang
2026-10-12 20:41   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 05/19] accel/amdxdna: Add NPU3 classic device support David Zhang
2026-10-12 20:41   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 06/19] accel/amdxdna: Add AIE version query to aie4_get_info David Zhang
2026-10-12 20:55   ` Lizhi Hou [this message]
2026-10-09 22:53 ` [PATCH V4 07/19] accel/amdxdna: Add get and set power_mode for AIE4 David Zhang
2026-10-12 21:29   ` Lizhi Hou
2026-10-15 21:39     ` yidong Zhang
2026-10-09 22:53 ` [PATCH V4 08/19] accel/amdxdna: Add clock, DPM frequency, and resource info queries " David Zhang
2026-10-12 22:58   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 09/19] accel/amdxdna: Add context switch hysteresis with debugfs control David Zhang
2026-10-13 18:29   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 10/19] accel/amdxdna: Refactor AIE4 hardware initialization sequence David Zhang
2026-10-13 18:33   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 11/19] accel/amdxdna: Decouple AIE4 doorbell and MSI-X notify transport hooks David Zhang
2026-10-13 18:38   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 12/19] accel/amdxdna: Implement AIE4 kernel queue lifecycle and memory layout David Zhang
2026-10-13 18:41   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 13/19] accel/amdxdna: Prepare for AIE4 command submission David Zhang
2026-10-13 18:42   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 14/19] accel/amdxdna: Move HMM invalidate wait into common GEM code David Zhang
2026-10-13 18:45   ` Lizhi Hou
2026-10-15 16:53     ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 15/19] accel/amdxdna: Make populate_range common for AIE2 and AIE4 David Zhang
2026-10-14 18:10   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 16/19] accel/amdxdna: Implement AIE4 command packet building and submission David Zhang
2026-10-14 18:15   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 17/19] accel/amdxdna: Enable AIE4 firmware logging to DRAM David Zhang
2026-10-14 18:24   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 18/19] accel/amdxdna: Implement AIE4 suspend and resume David Zhang
2026-10-14 18:28   ` Lizhi Hou
2026-10-09 22:53 ` [PATCH V4 19/19] accel/amdxdna: Implement runtime suspend and resume support David Zhang
2026-10-14 18:36   ` Lizhi Hou
2026-10-15 21:54     ` yidong Zhang

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=d16aa986-2f98-97c4-fad9-5fca23f4bc95@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hayden.laccabue@amd.com \
    --cc=karol.wachowski@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=max.zhen@amd.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=sonal.santan@amd.com \
    --cc=yidong.zhang@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

all inboxes | Powered by JetHome®