mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: <ogabbay@kernel.org>, <quic_jhugo@quicinc.com>,
	<dri-devel@lists.freedesktop.org>
Cc: Lizhi Hou <lizhi.hou@amd.com>, <linux-kernel@vger.kernel.org>,
	<min.ma@amd.com>, <max.zhen@amd.com>, <sonal.santan@amd.com>,
	<king.tam@amd.com>, <mario.limonciello@amd.com>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH V1 4/7] accel/amdxdna: Use rcu_access_pointer for __rcu pointer
Date: Thu, 2 Jan 2025 13:22:41 -0800	[thread overview]
Message-ID: <20250102212244.1586340-4-lizhi.hou@amd.com> (raw)
In-Reply-To: <20250102212244.1586340-1-lizhi.hou@amd.com>

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


  parent reply	other threads:[~2025-01-02 21:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-01-02 21:22 ` [PATCH V1 5/7] accel/amdxdna: Declare force_cmdlist " 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

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=20250102212244.1586340-4-lizhi.hou@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=king.tam@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mario.limonciello@amd.com \
    --cc=max.zhen@amd.com \
    --cc=min.ma@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

all inboxes | Powered by JetHome®