dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Monk Liu <monk.liu@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: [PATCH AUTOSEL 5.6 023/149] drm/amdgpu: check GFX RAS capability before reset counters
Date: Sat, 11 Apr 2020 19:01:40 -0400	[thread overview]
Message-ID: <20200411230347.22371-23-sashal@kernel.org> (raw)
In-Reply-To: <20200411230347.22371-1-sashal@kernel.org>

From: Hawking Zhang <Hawking.Zhang@amd.com>

[ Upstream commit 06dcd7eb83ee65382305ce48686e3dadaad42088 ]

disallow the logical to be enabled on platforms that
don't support gfx ras at this stage, like sriov skus,
dgpu with legacy ras.etc

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 +++
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 889154a78c4a8..beba9c596c493 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -6326,6 +6326,9 @@ static void gfx_v9_0_clear_ras_edc_counter(struct amdgpu_device *adev)
 {
 	int i, j, k;
 
+	if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX))
+		return;
+
 	/* read back registers to clear the counters */
 	mutex_lock(&adev->grbm_idx_mutex);
 	for (i = 0; i < ARRAY_SIZE(gfx_v9_0_edc_counter_regs); i++) {
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c
index f099f13d7f1e9..9955532345ec0 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c
@@ -897,6 +897,9 @@ void gfx_v9_4_clear_ras_edc_counter(struct amdgpu_device *adev)
 {
 	int i, j, k;
 
+	if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX))
+		return;
+
 	mutex_lock(&adev->grbm_idx_mutex);
 	for (i = 0; i < ARRAY_SIZE(gfx_v9_4_edc_counter_regs); i++) {
 		for (j = 0; j < gfx_v9_4_edc_counter_regs[i].se_num; j++) {
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-04-11 23:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200411230347.22371-1-sashal@kernel.org>
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 010/149] drm/amd/display: differentiate vsc sdp colorimetry use criteria between MST and SST Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 015/149] drm/amd/display: Explicitly disable triplebuffer flips Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 016/149] drm/amd/display: Fix test pattern color space inconsistency for Linux Sasha Levin
2020-04-11 23:01 ` Sasha Levin [this message]
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 031/149] drm/tegra: dc: Release PM and RGB output when client's registration fails Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 033/149] drm/amd/display: Stop if retimer is not available Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 036/149] drm/amd/display: writing stereo polarity register if swapped Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 039/149] drm/amd/display: Fix default logger mask definition Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 046/149] drm/amd/display: Only round InfoFrame refresh rates Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 047/149] drm/amd/display: Fix HDMI repeater authentication Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 049/149] drm/panel: simple: fix osd070t1718_19ts sync drive edge Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 059/149] drm/sun4i: dsi: Use NULL to signify "no panel" Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 065/149] drm/amdgpu: Fix missing error check in suspend Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 068/149] drm/amd/display: always apply T7/T9 delay logic Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 069/149] drm/omap: fix possible object reference leak Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 072/149] drm/stm: ltdc: check crtc state before enabling LIE Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 073/149] fbdev: potential information leak in do_fb_ioctl() Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 074/149] drm/crc: Actually allow to change the crc source Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 075/149] drm/amdgpu: fix parentheses in amdgpu_vm_update_ptes Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 076/149] drm/amd/display: dc_get_vmid_use_vector() crashes when get called Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 087/149] drm/amd/display: dal_ddc_i2c_payloads_create can fail causing panic Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 088/149] drm/amd/display: System crashes when add_ptb_to_table() gets called Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 089/149] drm/omap: dss: Cleanup DSS ports on initialisation failure Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 090/149] drm/amdkfd: Fix a memory leak in queue creation error handling Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 095/149] drm/amd/display: Fix dmub_psr_destroy() Sasha Levin
2020-04-11 23:03 ` [PATCH AUTOSEL 5.6 105/149] drm/msm: fix leaks if initialization fails Sasha Levin
2020-04-11 23:03 ` [PATCH AUTOSEL 5.6 106/149] drm/msm/a5xx: Always set an OPP supported hardware value Sasha Levin
2020-04-11 23:03 ` [PATCH AUTOSEL 5.6 149/149] PCI: Use ioremap(), not phys_to_virt() for platform ROM 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=20200411230347.22371-23-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Hawking.Zhang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monk.liu@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;
as well as URLs for NNTP newsgroup(s).