mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables
@ 2025-01-02 21:22 Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 2/7] accel/amdxdna: Declare mailbox register base as __iomem pointer Lizhi Hou
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Lizhi Hou @ 2025-01-02 21:22 UTC (permalink / raw)
  To: ogabbay, quic_jhugo, dri-devel
  Cc: Lizhi Hou, linux-kernel, min.ma, max.zhen, sonal.santan,
	king.tam, mario.limonciello, kernel test robot

Declare the variables as static to fix the sparse warnings:
symbol 'npu5_dev_priv' was not declared. Should it be static?
symbol 'npu1_dev_priv' was not declared. Should it be static?
symbol 'npu4_dev_priv' was not declared. Should it be static?
symbol 'npu2_dev_priv' was not declared. Should it be static?

Fixes: 8c9ff1b181ba ("accel/amdxdna: Add a new driver for AMD AI Engine")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412310648.dtMHgGem-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/npu1_regs.c | 2 +-
 drivers/accel/amdxdna/npu2_regs.c | 2 +-
 drivers/accel/amdxdna/npu4_regs.c | 2 +-
 drivers/accel/amdxdna/npu5_regs.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/accel/amdxdna/npu1_regs.c b/drivers/accel/amdxdna/npu1_regs.c
index e408af57e378..e4f6dac7d00f 100644
--- a/drivers/accel/amdxdna/npu1_regs.c
+++ b/drivers/accel/amdxdna/npu1_regs.c
@@ -62,7 +62,7 @@ const struct dpm_clk_freq npu1_dpm_clk_table[] = {
 	{ 0 }
 };
 
-const struct amdxdna_dev_priv npu1_dev_priv = {
+static const struct amdxdna_dev_priv npu1_dev_priv = {
 	.fw_path        = "amdnpu/1502_00/npu.sbin",
 	.protocol_major = 0x5,
 	.protocol_minor = 0x7,
diff --git a/drivers/accel/amdxdna/npu2_regs.c b/drivers/accel/amdxdna/npu2_regs.c
index 286bd0d475e2..a081cac75ee0 100644
--- a/drivers/accel/amdxdna/npu2_regs.c
+++ b/drivers/accel/amdxdna/npu2_regs.c
@@ -61,7 +61,7 @@
 #define NPU2_SMU_BAR_BASE	MMNPU_APERTURE4_BASE
 #define NPU2_SRAM_BAR_BASE	MMNPU_APERTURE1_BASE
 
-const struct amdxdna_dev_priv npu2_dev_priv = {
+static const struct amdxdna_dev_priv npu2_dev_priv = {
 	.fw_path        = "amdnpu/17f0_00/npu.sbin",
 	.protocol_major = 0x6,
 	.protocol_minor = 0x6,
diff --git a/drivers/accel/amdxdna/npu4_regs.c b/drivers/accel/amdxdna/npu4_regs.c
index 00c52833ce89..9f2e33182ec6 100644
--- a/drivers/accel/amdxdna/npu4_regs.c
+++ b/drivers/accel/amdxdna/npu4_regs.c
@@ -82,7 +82,7 @@ const struct dpm_clk_freq npu4_dpm_clk_table[] = {
 	{ 0 }
 };
 
-const struct amdxdna_dev_priv npu4_dev_priv = {
+static const struct amdxdna_dev_priv npu4_dev_priv = {
 	.fw_path        = "amdnpu/17f0_10/npu.sbin",
 	.protocol_major = 0x6,
 	.protocol_minor = 12,
diff --git a/drivers/accel/amdxdna/npu5_regs.c b/drivers/accel/amdxdna/npu5_regs.c
index 118849272f27..5f1cf83461c4 100644
--- a/drivers/accel/amdxdna/npu5_regs.c
+++ b/drivers/accel/amdxdna/npu5_regs.c
@@ -61,7 +61,7 @@
 #define NPU5_SMU_BAR_BASE	MMNPU_APERTURE4_BASE
 #define NPU5_SRAM_BAR_BASE	MMNPU_APERTURE1_BASE
 
-const struct amdxdna_dev_priv npu5_dev_priv = {
+static const struct amdxdna_dev_priv npu5_dev_priv = {
 	.fw_path        = "amdnpu/17f0_11/npu.sbin",
 	.protocol_major = 0x6,
 	.protocol_minor = 12,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V1 2/7] accel/amdxdna: Declare mailbox register base as __iomem pointer
  2025-01-02 21:22 [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Lizhi Hou
@ 2025-01-02 21:22 ` Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 3/7] accel/amdxdna: Declare aie2_max_col as static Lizhi Hou
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lizhi Hou @ 2025-01-02 21:22 UTC (permalink / raw)
  To: ogabbay, quic_jhugo, dri-devel
  Cc: Lizhi Hou, linux-kernel, min.ma, max.zhen, sonal.santan,
	king.tam, mario.limonciello, kernel test robot

Declare mailbox ringbuf_base and mbox_base as 'void __iomem *' to fix
sparse warnings:
  cast removes address space '__iomem' of expression
  incorrect type in argument 2 (different address spaces)

Fixes: b87f920b9344 ("accel/amdxdna: Support hardware mailbox")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412310857.syD1sXXO-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/aie2_pci.c        |  4 ++--
 drivers/accel/amdxdna/amdxdna_mailbox.c | 24 ++++++++++++------------
 drivers/accel/amdxdna/amdxdna_mailbox.h |  4 ++--
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
index 8de8f3bd4987..8b273bc7db44 100644
--- a/drivers/accel/amdxdna/aie2_pci.c
+++ b/drivers/accel/amdxdna/aie2_pci.c
@@ -380,9 +380,9 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
 		goto stop_psp;
 	}
 
-	mbox_res.ringbuf_base = (u64)ndev->sram_base;
+	mbox_res.ringbuf_base = ndev->sram_base;
 	mbox_res.ringbuf_size = pci_resource_len(pdev, xdna->dev_info->sram_bar);
-	mbox_res.mbox_base = (u64)ndev->mbox_base;
+	mbox_res.mbox_base = ndev->mbox_base;
 	mbox_res.mbox_size = MBOX_SIZE(ndev);
 	mbox_res.name = "xdna_mailbox";
 	ndev->mbox = xdnam_mailbox_create(&xdna->ddev, &mbox_res);
diff --git a/drivers/accel/amdxdna/amdxdna_mailbox.c b/drivers/accel/amdxdna/amdxdna_mailbox.c
index 1afc8079e3d1..814b16bb1953 100644
--- a/drivers/accel/amdxdna/amdxdna_mailbox.c
+++ b/drivers/accel/amdxdna/amdxdna_mailbox.c
@@ -98,27 +98,27 @@ struct mailbox_msg {
 static void mailbox_reg_write(struct mailbox_channel *mb_chann, u32 mbox_reg, u32 data)
 {
 	struct xdna_mailbox_res *mb_res = &mb_chann->mb->res;
-	u64 ringbuf_addr = mb_res->mbox_base + mbox_reg;
+	void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg;
 
-	writel(data, (void *)ringbuf_addr);
+	writel(data, ringbuf_addr);
 }
 
 static u32 mailbox_reg_read(struct mailbox_channel *mb_chann, u32 mbox_reg)
 {
 	struct xdna_mailbox_res *mb_res = &mb_chann->mb->res;
-	u64 ringbuf_addr = mb_res->mbox_base + mbox_reg;
+	void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg;
 
-	return readl((void *)ringbuf_addr);
+	return readl(ringbuf_addr);
 }
 
 static int mailbox_reg_read_non_zero(struct mailbox_channel *mb_chann, u32 mbox_reg, u32 *val)
 {
 	struct xdna_mailbox_res *mb_res = &mb_chann->mb->res;
-	u64 ringbuf_addr = mb_res->mbox_base + mbox_reg;
+	void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg;
 	int ret, value;
 
 	/* Poll till value is not zero */
-	ret = readx_poll_timeout(readl, (void *)ringbuf_addr, value,
+	ret = readx_poll_timeout(readl, ringbuf_addr, value,
 				 value, 1 /* us */, 100);
 	if (ret < 0)
 		return ret;
@@ -200,10 +200,10 @@ static void mailbox_release_msg(struct mailbox_channel *mb_chann,
 static int
 mailbox_send_msg(struct mailbox_channel *mb_chann, struct mailbox_msg *mb_msg)
 {
+	void __iomem *write_addr;
 	u32 ringbuf_size;
 	u32 head, tail;
 	u32 start_addr;
-	u64 write_addr;
 	u32 tmp_tail;
 
 	head = mailbox_get_headptr(mb_chann, CHAN_RES_X2I);
@@ -221,14 +221,14 @@ mailbox_send_msg(struct mailbox_channel *mb_chann, struct mailbox_msg *mb_msg)
 
 	if (tail >= head && tmp_tail > ringbuf_size - sizeof(u32)) {
 		write_addr = mb_chann->mb->res.ringbuf_base + start_addr + tail;
-		writel(TOMBSTONE, (void *)write_addr);
+		writel(TOMBSTONE, write_addr);
 
 		/* tombstone is set. Write from the start of the ringbuf */
 		tail = 0;
 	}
 
 	write_addr = mb_chann->mb->res.ringbuf_base + start_addr + tail;
-	memcpy_toio((void *)write_addr, &mb_msg->pkg, mb_msg->pkg_size);
+	memcpy_toio(write_addr, &mb_msg->pkg, mb_msg->pkg_size);
 	mailbox_set_tailptr(mb_chann, tail + mb_msg->pkg_size);
 
 	trace_mbox_set_tail(MAILBOX_NAME, mb_chann->msix_irq,
@@ -275,11 +275,11 @@ mailbox_get_resp(struct mailbox_channel *mb_chann, struct xdna_msg_header *heade
 static int mailbox_get_msg(struct mailbox_channel *mb_chann)
 {
 	struct xdna_msg_header header;
+	void __iomem *read_addr;
 	u32 msg_size, rest;
 	u32 ringbuf_size;
 	u32 head, tail;
 	u32 start_addr;
-	u64 read_addr;
 	int ret;
 
 	if (mailbox_reg_read_non_zero(mb_chann, mb_chann->res[CHAN_RES_I2X].mb_tail_ptr_reg, &tail))
@@ -302,7 +302,7 @@ static int mailbox_get_msg(struct mailbox_channel *mb_chann)
 
 	/* Peek size of the message or TOMBSTONE */
 	read_addr = mb_chann->mb->res.ringbuf_base + start_addr + head;
-	header.total_size = readl((void *)read_addr);
+	header.total_size = readl(read_addr);
 	/* size is TOMBSTONE, set next read from 0 */
 	if (header.total_size == TOMBSTONE) {
 		if (head < tail) {
@@ -328,7 +328,7 @@ static int mailbox_get_msg(struct mailbox_channel *mb_chann)
 
 	rest = sizeof(header) - sizeof(u32);
 	read_addr += sizeof(u32);
-	memcpy_fromio((u32 *)&header + 1, (void *)read_addr, rest);
+	memcpy_fromio((u32 *)&header + 1, read_addr, rest);
 	read_addr += rest;
 
 	ret = mailbox_get_resp(mb_chann, &header, (u32 *)read_addr);
diff --git a/drivers/accel/amdxdna/amdxdna_mailbox.h b/drivers/accel/amdxdna/amdxdna_mailbox.h
index 6ab7f5424633..57954c303bdd 100644
--- a/drivers/accel/amdxdna/amdxdna_mailbox.h
+++ b/drivers/accel/amdxdna/amdxdna_mailbox.h
@@ -39,9 +39,9 @@ struct xdna_mailbox_msg {
  * @mbox_size:		mailbox size
  */
 struct xdna_mailbox_res {
-	u64		ringbuf_base;
+	void __iomem	*ringbuf_base;
 	size_t		ringbuf_size;
-	u64		mbox_base;
+	void __iomem	*mbox_base;
 	size_t		mbox_size;
 	const char	*name;
 };
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V1 3/7] accel/amdxdna: Declare aie2_max_col as static
  2025-01-02 21:22 [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 2/7] accel/amdxdna: Declare mailbox register base as __iomem pointer Lizhi Hou
@ 2025-01-02 21:22 ` Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 4/7] accel/amdxdna: Use rcu_access_pointer for __rcu pointer Lizhi Hou
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lizhi Hou @ 2025-01-02 21:22 UTC (permalink / raw)
  To: ogabbay, quic_jhugo, dri-devel
  Cc: Lizhi Hou, linux-kernel, min.ma, max.zhen, sonal.santan,
	king.tam, mario.limonciello, kernel test robot

Fix the sparse warning:
  symbol 'aie2_max_col' was not declared. Should it be static?

Fixes: c88d3325ae69 ("accel/amdxdna: Add hardware resource solver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412311028.x2UtcSHm-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/aie2_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
index 8b273bc7db44..5a058e565b01 100644
--- a/drivers/accel/amdxdna/aie2_pci.c
+++ b/drivers/accel/amdxdna/aie2_pci.c
@@ -25,7 +25,7 @@
 #include "amdxdna_mailbox.h"
 #include "amdxdna_pci_drv.h"
 
-int aie2_max_col = XRS_MAX_COL;
+static int aie2_max_col = XRS_MAX_COL;
 module_param(aie2_max_col, uint, 0600);
 MODULE_PARM_DESC(aie2_max_col, "Maximum column could be used");
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V1 4/7] accel/amdxdna: Use rcu_access_pointer for __rcu pointer
  2025-01-02 21:22 [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 2/7] accel/amdxdna: Declare mailbox register base as __iomem pointer Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 3/7] accel/amdxdna: Declare aie2_max_col as static Lizhi Hou
@ 2025-01-02 21:22 ` Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 5/7] accel/amdxdna: Declare force_cmdlist as static Lizhi Hou
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lizhi Hou @ 2025-01-02 21:22 UTC (permalink / raw)
  To: ogabbay, quic_jhugo, dri-devel
  Cc: Lizhi Hou, linux-kernel, min.ma, max.zhen, sonal.santan,
	king.tam, mario.limonciello, kernel test robot

Use rcu_access_pointer for pid in struct drm_file. This fixes sparse
warning.

Fixes: be462c97b7df ("accel/amdxdna: Add hardware context")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412311210.LfeHTzLw-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/amdxdna_pci_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c
index 194e44fc243d..97d4a032171f 100644
--- a/drivers/accel/amdxdna/amdxdna_pci_drv.c
+++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c
@@ -61,7 +61,7 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp)
 		goto put_rpm;
 	}
 
-	client->pid = pid_nr(filp->pid);
+	client->pid = pid_nr(rcu_access_pointer(filp->pid));
 	client->xdna = xdna;
 
 	client->sva = iommu_sva_bind_device(xdna->ddev.dev, current->mm);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V1 5/7] accel/amdxdna: Declare force_cmdlist as static
  2025-01-02 21:22 [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Lizhi Hou
                   ` (2 preceding siblings ...)
  2025-01-02 21:22 ` [PATCH V1 4/7] accel/amdxdna: Use rcu_access_pointer for __rcu pointer Lizhi Hou
@ 2025-01-02 21:22 ` Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 6/7] accel/amdxdna: Add __user to second parameter of aie2_query_status Lizhi Hou
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lizhi Hou @ 2025-01-02 21:22 UTC (permalink / raw)
  To: ogabbay, quic_jhugo, dri-devel
  Cc: Lizhi Hou, linux-kernel, min.ma, max.zhen, sonal.santan,
	king.tam, mario.limonciello, kernel test robot

Fix sparse warning:
  symbol 'force_cmdlist' was not declared. Should it be static?

Fixes: aac243092b70 ("accel/amdxdna: Add command execution")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412311448.GKQj7uPZ-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/aie2_ctx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index 9facf45818f9..5f43db02b240 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -22,7 +22,7 @@
 #include "amdxdna_mailbox.h"
 #include "amdxdna_pci_drv.h"
 
-bool force_cmdlist;
+static bool force_cmdlist;
 module_param(force_cmdlist, bool, 0600);
 MODULE_PARM_DESC(force_cmdlist, "Force use command list (Default false)");
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V1 6/7] accel/amdxdna: Add __user to second parameter of aie2_query_status
  2025-01-02 21:22 [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Lizhi Hou
                   ` (3 preceding siblings ...)
  2025-01-02 21:22 ` [PATCH V1 5/7] accel/amdxdna: Declare force_cmdlist as static Lizhi Hou
@ 2025-01-02 21:22 ` Lizhi Hou
  2025-01-02 21:22 ` [PATCH V1 7/7] accel/amdxdna: Declare npu6_dev_priv as static Lizhi Hou
  2025-01-04  5:41 ` [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Mario Limonciello
  6 siblings, 0 replies; 8+ messages in thread
From: Lizhi Hou @ 2025-01-02 21:22 UTC (permalink / raw)
  To: ogabbay, quic_jhugo, dri-devel
  Cc: Lizhi Hou, linux-kernel, min.ma, max.zhen, sonal.santan,
	king.tam, mario.limonciello, kernel test robot

The second parameter of aie2_query_status() is a userspace pointer.
Declaring it as 'char __user *' to fix sparse warning.

Fixes: 850d71f6bf4c ("accel/amdxdna: Add query functions")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412311655.YBvq2wJb-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/aie2_pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/amdxdna/aie2_pci.h b/drivers/accel/amdxdna/aie2_pci.h
index cc159cadff9f..f2d95531ddc2 100644
--- a/drivers/accel/amdxdna/aie2_pci.h
+++ b/drivers/accel/amdxdna/aie2_pci.h
@@ -269,7 +269,7 @@ int aie2_query_firmware_version(struct amdxdna_dev_hdl *ndev,
 int aie2_create_context(struct amdxdna_dev_hdl *ndev, struct amdxdna_hwctx *hwctx);
 int aie2_destroy_context(struct amdxdna_dev_hdl *ndev, struct amdxdna_hwctx *hwctx);
 int aie2_map_host_buf(struct amdxdna_dev_hdl *ndev, u32 context_id, u64 addr, u64 size);
-int aie2_query_status(struct amdxdna_dev_hdl *ndev, char *buf, u32 size, u32 *cols_filled);
+int aie2_query_status(struct amdxdna_dev_hdl *ndev, char __user *buf, u32 size, u32 *cols_filled);
 int aie2_register_asyn_event_msg(struct amdxdna_dev_hdl *ndev, dma_addr_t addr, u32 size,
 				 void *handle, int (*cb)(void*, const u32 *, size_t));
 int aie2_config_cu(struct amdxdna_hwctx *hwctx);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V1 7/7] accel/amdxdna: Declare npu6_dev_priv as static
  2025-01-02 21:22 [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Lizhi Hou
                   ` (4 preceding siblings ...)
  2025-01-02 21:22 ` [PATCH V1 6/7] accel/amdxdna: Add __user to second parameter of aie2_query_status Lizhi Hou
@ 2025-01-02 21:22 ` Lizhi Hou
  2025-01-04  5:41 ` [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Mario Limonciello
  6 siblings, 0 replies; 8+ messages in thread
From: Lizhi Hou @ 2025-01-02 21:22 UTC (permalink / raw)
  To: ogabbay, quic_jhugo, dri-devel
  Cc: Lizhi Hou, linux-kernel, min.ma, max.zhen, sonal.santan,
	king.tam, mario.limonciello, kernel test robot

Fix sparse warning:
  symbol 'npu6_dev_priv' was not declared. Should it be static?

Fixes: 273b5176ac17 ("accel/amdxdna: Add RyzenAI-npu6 support")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412311819.9mz11Uak-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/npu6_regs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/amdxdna/npu6_regs.c b/drivers/accel/amdxdna/npu6_regs.c
index f46c760cefc7..94a7005685a7 100644
--- a/drivers/accel/amdxdna/npu6_regs.c
+++ b/drivers/accel/amdxdna/npu6_regs.c
@@ -61,7 +61,7 @@
 #define NPU6_SMU_BAR_BASE	MMNPU_APERTURE4_BASE
 #define NPU6_SRAM_BAR_BASE	MMNPU_APERTURE1_BASE
 
-const struct amdxdna_dev_priv npu6_dev_priv = {
+static const struct amdxdna_dev_priv npu6_dev_priv = {
 	.fw_path        = "amdnpu/17f0_10/npu.sbin",
 	.protocol_major = 0x6,
 	.protocol_minor = 12,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables
  2025-01-02 21:22 [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Lizhi Hou
                   ` (5 preceding siblings ...)
  2025-01-02 21:22 ` [PATCH V1 7/7] accel/amdxdna: Declare npu6_dev_priv as static Lizhi Hou
@ 2025-01-04  5:41 ` Mario Limonciello
  6 siblings, 0 replies; 8+ messages in thread
From: Mario Limonciello @ 2025-01-04  5:41 UTC (permalink / raw)
  To: Lizhi Hou, ogabbay, quic_jhugo, dri-devel
  Cc: linux-kernel, min.ma, max.zhen, sonal.santan, king.tam,
	kernel test robot

Hi,

Thanks for the patches.  For the series:

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

I've committed them to drm-misc-next as well:

fee7aaee11f52 accel/amdxdna: Declare npu6_dev_priv as static
3b5bcf64a65b3 accel/amdxdna: Add __user to second parameter of 
aie2_query_status
72e487b47d249 accel/amdxdna: Declare force_cmdlist as static
1f74400529488 accel/amdxdna: Use rcu_access_pointer for __rcu pointer
c199310be29a0 accel/amdxdna: Declare aie2_max_col as static
3c8cfec3fcc4f accel/amdxdna: Declare mailbox register base as __iomem 
pointer
71486e48370e8 accel/amdxdna: Declare npu device profile as static variables

On 1/2/2025 15:22, Lizhi Hou wrote:
> Declare the variables as static to fix the sparse warnings:
> symbol 'npu5_dev_priv' was not declared. Should it be static?
> symbol 'npu1_dev_priv' was not declared. Should it be static?
> symbol 'npu4_dev_priv' was not declared. Should it be static?
> symbol 'npu2_dev_priv' was not declared. Should it be static?
> 
> Fixes: 8c9ff1b181ba ("accel/amdxdna: Add a new driver for AMD AI Engine")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202412310648.dtMHgGem-lkp@intel.com/
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
> ---
>   drivers/accel/amdxdna/npu1_regs.c | 2 +-
>   drivers/accel/amdxdna/npu2_regs.c | 2 +-
>   drivers/accel/amdxdna/npu4_regs.c | 2 +-
>   drivers/accel/amdxdna/npu5_regs.c | 2 +-
>   4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/accel/amdxdna/npu1_regs.c b/drivers/accel/amdxdna/npu1_regs.c
> index e408af57e378..e4f6dac7d00f 100644
> --- a/drivers/accel/amdxdna/npu1_regs.c
> +++ b/drivers/accel/amdxdna/npu1_regs.c
> @@ -62,7 +62,7 @@ const struct dpm_clk_freq npu1_dpm_clk_table[] = {
>   	{ 0 }
>   };
>   
> -const struct amdxdna_dev_priv npu1_dev_priv = {
> +static const struct amdxdna_dev_priv npu1_dev_priv = {
>   	.fw_path        = "amdnpu/1502_00/npu.sbin",
>   	.protocol_major = 0x5,
>   	.protocol_minor = 0x7,
> diff --git a/drivers/accel/amdxdna/npu2_regs.c b/drivers/accel/amdxdna/npu2_regs.c
> index 286bd0d475e2..a081cac75ee0 100644
> --- a/drivers/accel/amdxdna/npu2_regs.c
> +++ b/drivers/accel/amdxdna/npu2_regs.c
> @@ -61,7 +61,7 @@
>   #define NPU2_SMU_BAR_BASE	MMNPU_APERTURE4_BASE
>   #define NPU2_SRAM_BAR_BASE	MMNPU_APERTURE1_BASE
>   
> -const struct amdxdna_dev_priv npu2_dev_priv = {
> +static const struct amdxdna_dev_priv npu2_dev_priv = {
>   	.fw_path        = "amdnpu/17f0_00/npu.sbin",
>   	.protocol_major = 0x6,
>   	.protocol_minor = 0x6,
> diff --git a/drivers/accel/amdxdna/npu4_regs.c b/drivers/accel/amdxdna/npu4_regs.c
> index 00c52833ce89..9f2e33182ec6 100644
> --- a/drivers/accel/amdxdna/npu4_regs.c
> +++ b/drivers/accel/amdxdna/npu4_regs.c
> @@ -82,7 +82,7 @@ const struct dpm_clk_freq npu4_dpm_clk_table[] = {
>   	{ 0 }
>   };
>   
> -const struct amdxdna_dev_priv npu4_dev_priv = {
> +static const struct amdxdna_dev_priv npu4_dev_priv = {
>   	.fw_path        = "amdnpu/17f0_10/npu.sbin",
>   	.protocol_major = 0x6,
>   	.protocol_minor = 12,
> diff --git a/drivers/accel/amdxdna/npu5_regs.c b/drivers/accel/amdxdna/npu5_regs.c
> index 118849272f27..5f1cf83461c4 100644
> --- a/drivers/accel/amdxdna/npu5_regs.c
> +++ b/drivers/accel/amdxdna/npu5_regs.c
> @@ -61,7 +61,7 @@
>   #define NPU5_SMU_BAR_BASE	MMNPU_APERTURE4_BASE
>   #define NPU5_SRAM_BAR_BASE	MMNPU_APERTURE1_BASE
>   
> -const struct amdxdna_dev_priv npu5_dev_priv = {
> +static const struct amdxdna_dev_priv npu5_dev_priv = {
>   	.fw_path        = "amdnpu/17f0_11/npu.sbin",
>   	.protocol_major = 0x6,
>   	.protocol_minor = 12,


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-01-04  5:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-02 21:22 [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Lizhi Hou
2025-01-02 21:22 ` [PATCH V1 2/7] accel/amdxdna: Declare mailbox register base as __iomem pointer Lizhi Hou
2025-01-02 21:22 ` [PATCH V1 3/7] accel/amdxdna: Declare aie2_max_col as static Lizhi Hou
2025-01-02 21:22 ` [PATCH V1 4/7] accel/amdxdna: Use rcu_access_pointer for __rcu pointer Lizhi Hou
2025-01-02 21:22 ` [PATCH V1 5/7] accel/amdxdna: Declare force_cmdlist as static Lizhi Hou
2025-01-02 21:22 ` [PATCH V1 6/7] accel/amdxdna: Add __user to second parameter of aie2_query_status Lizhi Hou
2025-01-02 21:22 ` [PATCH V1 7/7] accel/amdxdna: Declare npu6_dev_priv as static Lizhi Hou
2025-01-04  5:41 ` [PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables Mario Limonciello

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®