From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Mukul Joshi" <mukul.joshi@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Felix Kuehling" <Felix.Kuehling@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Sasha Levin" <sashal@kernel.org>,
Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch,
Philip.Yang@amd.com, Hawking.Zhang@amd.com,
chi.minghao@zte.com.cn, evan.quan@amd.com,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 5.19 30/38] drm/amdgpu: Fix interrupt handling on ih_soft ring
Date: Wed, 24 Aug 2022 21:33:53 -0400 [thread overview]
Message-ID: <20220825013401.22096-30-sashal@kernel.org> (raw)
In-Reply-To: <20220825013401.22096-1-sashal@kernel.org>
From: Mukul Joshi <mukul.joshi@amd.com>
[ Upstream commit de8341ee3ce7316883e836a2c4e9bf01ab651e0f ]
There are no backing hardware registers for ih_soft ring.
As a result, don't try to access hardware registers for read
and write pointers when processing interrupts on the IH soft
ring.
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 7 ++++++-
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 7 ++++++-
drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 7 ++++++-
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
index 4b5396d3e60f..eec13cb5bf75 100644
--- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
@@ -409,9 +409,11 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev,
u32 wptr, tmp;
struct amdgpu_ih_regs *ih_regs;
- if (ih == &adev->irq.ih) {
+ if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
/* Only ring0 supports writeback. On other rings fall back
* to register-based code with overflow checking below.
+ * ih_soft ring doesn't have any backing hardware registers,
+ * update wptr and return.
*/
wptr = le32_to_cpu(*ih->wptr_cpu);
@@ -483,6 +485,9 @@ static void navi10_ih_set_rptr(struct amdgpu_device *adev,
{
struct amdgpu_ih_regs *ih_regs;
+ if (ih == &adev->irq.ih_soft)
+ return;
+
if (ih->use_doorbell) {
/* XXX check if swapping is necessary on BE */
*ih->rptr_cpu = ih->rptr;
diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
index cdd599a08125..03b7066471f9 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
@@ -334,9 +334,11 @@ static u32 vega10_ih_get_wptr(struct amdgpu_device *adev,
u32 wptr, tmp;
struct amdgpu_ih_regs *ih_regs;
- if (ih == &adev->irq.ih) {
+ if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
/* Only ring0 supports writeback. On other rings fall back
* to register-based code with overflow checking below.
+ * ih_soft ring doesn't have any backing hardware registers,
+ * update wptr and return.
*/
wptr = le32_to_cpu(*ih->wptr_cpu);
@@ -409,6 +411,9 @@ static void vega10_ih_set_rptr(struct amdgpu_device *adev,
{
struct amdgpu_ih_regs *ih_regs;
+ if (ih == &adev->irq.ih_soft)
+ return;
+
if (ih->use_doorbell) {
/* XXX check if swapping is necessary on BE */
*ih->rptr_cpu = ih->rptr;
diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
index 3b4eb8285943..2022ffbb8dba 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
@@ -385,9 +385,11 @@ static u32 vega20_ih_get_wptr(struct amdgpu_device *adev,
u32 wptr, tmp;
struct amdgpu_ih_regs *ih_regs;
- if (ih == &adev->irq.ih) {
+ if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
/* Only ring0 supports writeback. On other rings fall back
* to register-based code with overflow checking below.
+ * ih_soft ring doesn't have any backing hardware registers,
+ * update wptr and return.
*/
wptr = le32_to_cpu(*ih->wptr_cpu);
@@ -461,6 +463,9 @@ static void vega20_ih_set_rptr(struct amdgpu_device *adev,
{
struct amdgpu_ih_regs *ih_regs;
+ if (ih == &adev->irq.ih_soft)
+ return;
+
if (ih->use_doorbell) {
/* XXX check if swapping is necessary on BE */
*ih->rptr_cpu = ih->rptr;
--
2.35.1
next prev parent reply other threads:[~2022-08-25 1:39 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 1:33 [PATCH AUTOSEL 5.19 01/38] fs/ntfs3: Fix work with fragmented xattr Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 02/38] ASoC: sh: rz-ssi: Improve error handling in rz_ssi_probe() error path Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 03/38] ASoC: rt5640: Fix the JD voltage dropping issue Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 04/38] rtla: Fix tracer name Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 05/38] drm/amd/display: Add a missing register field for HPO DP stream encoder Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 06/38] drm/amd/display: Device flash garbage before get in OS Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 07/38] drm/amd/display: Avoid MPC infinite loop Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 08/38] drm/amd/display: Fix HDMI VSIF V3 incorrect issue Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 09/38] drm/amd/display: For stereo keep "FLIP_ANY_FRAME" Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 10/38] drm/amd/display: clear optc underflow before turn off odm clock Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 11/38] drm/amd/display: Fix TDR eDP and USB4 display light up issue Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 12/38] drm/amd/pm: skip pptable override for smu_v13_0_7 Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 13/38] drm/amdkfd: Handle restart of kfd_ioctl_wait_events Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 14/38] drm/amd/pm: Fix a potential gpu_metrics_table memory leak Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 15/38] ksmbd: return STATUS_BAD_NETWORK_NAME error status if share is not configured Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 16/38] net: lan966x: fix checking for return value of platform_get_irq_byname() Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 17/38] neigh: fix possible DoS due to net iface start/stop loop Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 18/38] ALSA: hda/realtek: Add quirks for ASUS Zenbooks using CS35L41 Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 19/38] s390/hypfs: avoid error message under KVM Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 20/38] ksmbd: don't remove dos attribute xattr on O_TRUNC open Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 21/38] drm/amdgpu: disable 3DCGCG/CGLS temporarily due to stability issue Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 22/38] drm/amd/pm: add missing ->fini_microcode interface for Sienna Cichlid Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 23/38] drm/amd/pm: add missing ->fini_xxxx interfaces for some SMU13 asics Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 24/38] drm/amd/display: Fix pixel clock programming Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 25/38] drm/amdgpu: Increase tlb flush timeout for sriov Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 26/38] drm/amd/display: Fix plug/unplug external monitor will hang while playback MPO video Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 27/38] drm/amd/display: avoid doing vm_init multiple time Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 28/38] drm/amdgpu: Add decode_iv_ts helper for ih_v6 block Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 29/38] drm/amdgpu: Add secure display TA load for Renoir Sasha Levin
2022-08-25 1:33 ` Sasha Levin [this message]
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 31/38] netfilter: conntrack: NF_CONNTRACK_PROCFS should no longer default to y Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 32/38] testing: selftests: nft_flowtable.sh: use random netns names Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 33/38] platform/x86: serial-multi-instantiate: Add CLSA0101 Laptop Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 34/38] ALSA: hda/cs8409: Support new Dolphin Variants Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 35/38] btrfs: move lockdep class helpers to locking.c Sasha Levin
2022-08-25 1:33 ` [PATCH AUTOSEL 5.19 36/38] btrfs: fix lockdep splat with reloc root extent buffers Sasha Levin
2022-08-25 1:34 ` [PATCH AUTOSEL 5.19 37/38] btrfs: tree-checker: check for overlapping extent items Sasha Levin
2022-08-25 1:34 ` [PATCH AUTOSEL 5.19 38/38] ftrace: Fix NULL pointer dereference in is_ftrace_trampoline when ftrace is dead Sasha Levin
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=20220825013401.22096-30-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Felix.Kuehling@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Philip.Yang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=chi.minghao@zte.com.cn \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=evan.quan@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mukul.joshi@amd.com \
--cc=stable@vger.kernel.org \
/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