From: Bjorn Helgaas <helgaas@kernel.org>
To: Tom Seewald <tseewald@gmail.com>
Cc: "David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Tom Seewald" <tseewald@gmail.com>, "Stefan Roese" <sr@denx.de>,
"Kai-Heng Feng" <kai.heng.feng@canonical.com>,
regressions@lists.linux.dev, linux-pci@vger.kernel.org,
amd-gfx@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Xinhui Pan" <Xinhui.Pan@amd.com>,
"Lijo Lazar" <lijo.lazar@amd.com>
Subject: Re: [Bug 216373] New: Uncorrected errors reported for AMD GPU
Date: Fri, 19 Aug 2022 12:13:03 -0500 [thread overview]
Message-ID: <20220819171303.GA2491617@bhelgaas> (raw)
In-Reply-To: <20220818203812.GA2381243@bhelgaas>
On Thu, Aug 18, 2022 at 03:38:12PM -0500, Bjorn Helgaas wrote:
> [Adding amdgpu folks]
>
> On Wed, Aug 17, 2022 at 11:45:15PM +0000, bugzilla-daemon@kernel.org wrote:
> > https://bugzilla.kernel.org/show_bug.cgi?id=216373
> >
> > Bug ID: 216373
> > Summary: Uncorrected errors reported for AMD GPU
> > Kernel Version: v6.0-rc1
> > Regression: No
Tom, thanks for trying out "pci=noaer". Hopefully we won't need the
workaround for long.
Could I trouble you to try the debug patch below and see if we get any
stack trace clues in dmesg when the error happens? I'm sure the
experts would have a better approach, but I'm amdgpu-illiterate, so
this is all I can do :)
Bjorn
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index c4a6fe3070b6..fc34c66776bc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -130,6 +130,14 @@ const char *amdgpu_asic_name[] = {
"LAST",
};
+void check_write(uint32_t v, void __iomem *base, uint32_t offset)
+{
+ if (offset == 0x7f000) {
+ pr_err("** writing %#010x to %px\n", v, base + offset);
+ dump_stack();
+ }
+}
+
/**
* DOC: pcie_replay_count
*
@@ -512,9 +520,10 @@ void amdgpu_mm_wreg8(struct amdgpu_device *adev, uint32_t offset, uint8_t value)
if (amdgpu_device_skip_hw_access(adev))
return;
- if (offset < adev->rmmio_size)
+ if (offset < adev->rmmio_size) {
+ check_write(value, adev->rmmio, offset);
writeb(value, adev->rmmio + offset);
- else
+ } else
BUG();
}
@@ -542,6 +551,7 @@ void amdgpu_device_wreg(struct amdgpu_device *adev,
amdgpu_kiq_wreg(adev, reg, v);
up_read(&adev->reset_domain->sem);
} else {
+ check_write(v, adev->rmmio, reg * 4);
writel(v, ((void __iomem *)adev->rmmio) + (reg * 4));
}
} else {
@@ -574,6 +584,7 @@ void amdgpu_mm_wreg_mmio_rlc(struct amdgpu_device *adev,
} else if ((reg * 4) >= adev->rmmio_size) {
adev->pcie_wreg(adev, reg * 4, v);
} else {
+ check_write(v, adev->rmmio, reg * 4);
writel(v, ((void __iomem *)adev->rmmio) + (reg * 4));
}
}
@@ -689,6 +700,7 @@ u32 amdgpu_device_indirect_rreg(struct amdgpu_device *adev,
pcie_index_offset = (void __iomem *)adev->rmmio + pcie_index * 4;
pcie_data_offset = (void __iomem *)adev->rmmio + pcie_data * 4;
+ check_write(reg_addr, adev->rmmio, pcie_index * 4);
writel(reg_addr, pcie_index_offset);
readl(pcie_index_offset);
r = readl(pcie_data_offset);
@@ -721,10 +733,12 @@ u64 amdgpu_device_indirect_rreg64(struct amdgpu_device *adev,
pcie_data_offset = (void __iomem *)adev->rmmio + pcie_data * 4;
/* read low 32 bits */
+ check_write(reg_addr, adev->rmmio, pcie_index * 4);
writel(reg_addr, pcie_index_offset);
readl(pcie_index_offset);
r = readl(pcie_data_offset);
/* read high 32 bits */
+ check_write(reg_addr + 4, adev->rmmio, pcie_index * 4);
writel(reg_addr + 4, pcie_index_offset);
readl(pcie_index_offset);
r |= ((u64)readl(pcie_data_offset) << 32);
@@ -755,8 +769,10 @@ void amdgpu_device_indirect_wreg(struct amdgpu_device *adev,
pcie_index_offset = (void __iomem *)adev->rmmio + pcie_index * 4;
pcie_data_offset = (void __iomem *)adev->rmmio + pcie_data * 4;
+ check_write(reg_addr, adev->rmmio, pcie_index * 4);
writel(reg_addr, pcie_index_offset);
readl(pcie_index_offset);
+ check_write(reg_data, adev->rmmio, pcie_data * 4);
writel(reg_data, pcie_data_offset);
readl(pcie_data_offset);
spin_unlock_irqrestore(&adev->pcie_idx_lock, flags);
@@ -785,13 +801,17 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device *adev,
pcie_data_offset = (void __iomem *)adev->rmmio + pcie_data * 4;
/* write low 32 bits */
+ check_write(reg_addr, adev->rmmio, pcie_index * 4);
writel(reg_addr, pcie_index_offset);
readl(pcie_index_offset);
+ check_write((u32)(reg_data & 0xffffffffULL), adev->rmmio, pcie_data * 4);
writel((u32)(reg_data & 0xffffffffULL), pcie_data_offset);
readl(pcie_data_offset);
/* write high 32 bits */
+ check_write(reg_addr + 4, adev->rmmio, pcie_index * 4);
writel(reg_addr + 4, pcie_index_offset);
readl(pcie_index_offset);
+ check_write((u32)(reg_data >> 32), adev->rmmio, pcie_data * 4);
writel((u32)(reg_data >> 32), pcie_data_offset);
readl(pcie_data_offset);
spin_unlock_irqrestore(&adev->pcie_idx_lock, flags);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 9be57389301b..b552d7c27ec0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -36,6 +36,8 @@
#include "soc15.h"
#include "nv.h"
+extern void check_write(uint32_t v, void __iomem *base, uint32_t offset);
+
#define POPULATE_UCODE_INFO(vf2pf_info, ucode, ver) \
do { \
vf2pf_info->ucode_info[ucode].id = ucode; \
@@ -900,11 +902,15 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 v
if (offset == reg_access_ctrl->grbm_cntl) {
/* if the target reg offset is grbm_cntl, write to scratch_reg2 */
+ check_write(v, adev->rmmio, 4 * reg_access_ctrl->scratch_reg2);
writel(v, scratch_reg2);
+ check_write(v, adev->rmmio, offset * 4);
writel(v, ((void __iomem *)adev->rmmio) + (offset * 4));
} else if (offset == reg_access_ctrl->grbm_idx) {
/* if the target reg offset is grbm_idx, write to scratch_reg3 */
+ check_write(v, adev->rmmio, 4 * reg_access_ctrl->scratch_reg3);
writel(v, scratch_reg3);
+ check_write(v, adev->rmmio, offset * 4);
writel(v, ((void __iomem *)adev->rmmio) + (offset * 4));
} else {
/*
@@ -913,10 +919,14 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 v
* SCRATCH_REG1[19:0] = address in dword
* SCRATCH_REG1[26:24] = Error reporting
*/
+ check_write(v, adev->rmmio, 4 * reg_access_ctrl->scratch_reg0);
writel(v, scratch_reg0);
+ check_write(offset | flag, adev->rmmio, 4 * reg_access_ctrl->scratch_reg1);
writel((offset | flag), scratch_reg1);
- if (reg_access_ctrl->spare_int)
+ if (reg_access_ctrl->spare_int) {
+ check_write(1, adev->rmmio, 4 * reg_access_ctrl->spare_int);
writel(1, spare_int);
+ }
for (i = 0; i < timeout; i++) {
tmp = readl(scratch_reg1);
next prev parent reply other threads:[~2022-08-19 17:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-216373-41252@https.bugzilla.kernel.org/>
2022-08-18 20:38 ` [Bug 216373] New: Uncorrected errors reported for AMD GPU Bjorn Helgaas
2022-08-19 7:05 ` Christian König
2022-08-19 8:33 ` Lazar, Lijo
2022-08-19 11:04 ` Bjorn Helgaas
2022-08-19 17:13 ` Bjorn Helgaas [this message]
2022-08-19 19:07 ` Bjorn Helgaas
2022-08-20 7:52 ` Lazar, Lijo
2022-08-23 17:04 ` Tom Seewald
2022-08-24 5:10 ` Lazar, Lijo
2022-08-24 14:45 ` Tom Seewald
2022-08-25 6:40 ` Stefan Roese
2022-08-25 7:34 ` Christian König
2022-08-25 7:54 ` Lazar, Lijo
2022-08-25 8:18 ` Christian König
2022-08-25 17:48 ` Bjorn Helgaas
2022-08-26 7:10 ` Christian König
2022-08-25 15:05 ` Felix Kuehling
2022-08-23 16:01 ` [Bug 216373] New: Uncorrected errors reported for AMD GPU #forregzbot Thorsten Leemhuis
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=20220819171303.GA2491617@bhelgaas \
--to=helgaas@kernel.org \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=kai.heng.feng@canonical.com \
--cc=lijo.lazar@amd.com \
--cc=linux-pci@vger.kernel.org \
--cc=regressions@lists.linux.dev \
--cc=sr@denx.de \
--cc=tseewald@gmail.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).