AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Hawking Zhang <Hawking.Zhang@amd.com>,
	Tao Zhou <tao.zhou1@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Sasha Levin <sashal@kernel.org>,
	Felix.Kuehling@amd.com, christian.koenig@amd.com,
	Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.11 217/244] drm/amdkfd: Check int source id for utcl2 poison event
Date: Wed, 25 Sep 2024 07:27:18 -0400	[thread overview]
Message-ID: <20240925113641.1297102-217-sashal@kernel.org> (raw)
In-Reply-To: <20240925113641.1297102-1-sashal@kernel.org>

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

[ Upstream commit db6341a9168d2a24ded526277eeab29724d76e9d ]

Traditional utcl2 fault_status polling does not
work in SRIOV environment. The polling of fault
status register from guest side will be dropped
by hardware.

Driver should switch to check utcl2 interrupt
source id to identify utcl2 poison event. It is
set to 1 when poisoned data interrupts are
signaled.

v2: drop the unused local variable (Tao)

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../gpu/drm/amd/amdkfd/kfd_int_process_v9.c    | 18 +-----------------
 drivers/gpu/drm/amd/amdkfd/soc15_int.h         |  1 +
 2 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
index a9c3580be8c9b..fecdbbab98949 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
@@ -431,25 +431,9 @@ static void event_interrupt_wq_v9(struct kfd_node *dev,
 		   client_id == SOC15_IH_CLIENTID_UTCL2) {
 		struct kfd_vm_fault_info info = {0};
 		uint16_t ring_id = SOC15_RING_ID_FROM_IH_ENTRY(ih_ring_entry);
-		uint32_t node_id = SOC15_NODEID_FROM_IH_ENTRY(ih_ring_entry);
-		uint32_t vmid_type = SOC15_VMID_TYPE_FROM_IH_ENTRY(ih_ring_entry);
-		int hub_inst = 0;
 		struct kfd_hsa_memory_exception_data exception_data;
 
-		/* gfxhub */
-		if (!vmid_type && dev->adev->gfx.funcs->ih_node_to_logical_xcc) {
-			hub_inst = dev->adev->gfx.funcs->ih_node_to_logical_xcc(dev->adev,
-				node_id);
-			if (hub_inst < 0)
-				hub_inst = 0;
-		}
-
-		/* mmhub */
-		if (vmid_type && client_id == SOC15_IH_CLIENTID_VMC)
-			hub_inst = node_id / 4;
-
-		if (amdgpu_amdkfd_ras_query_utcl2_poison_status(dev->adev,
-					hub_inst, vmid_type)) {
+		if (source_id == SOC15_INTSRC_VMC_UTCL2_POISON) {
 			event_interrupt_poison_consumption_v9(dev, pasid, client_id);
 			return;
 		}
diff --git a/drivers/gpu/drm/amd/amdkfd/soc15_int.h b/drivers/gpu/drm/amd/amdkfd/soc15_int.h
index 10138676f27fd..e5c0205f26181 100644
--- a/drivers/gpu/drm/amd/amdkfd/soc15_int.h
+++ b/drivers/gpu/drm/amd/amdkfd/soc15_int.h
@@ -29,6 +29,7 @@
 #define SOC15_INTSRC_CP_BAD_OPCODE	183
 #define SOC15_INTSRC_SQ_INTERRUPT_MSG	239
 #define SOC15_INTSRC_VMC_FAULT		0
+#define SOC15_INTSRC_VMC_UTCL2_POISON	1
 #define SOC15_INTSRC_SDMA_TRAP		224
 #define SOC15_INTSRC_SDMA_ECC		220
 #define SOC21_INTSRC_SDMA_TRAP		49
-- 
2.43.0


  parent reply	other threads:[~2024-09-25 11:52 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240925113641.1297102-1-sashal@kernel.org>
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 130/244] drm/amd/display: Pass non-null to dcn20_validate_apply_pipe_split_flags Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 131/244] drm/amd/display: Check null pointers before using them Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 132/244] drm/amd/display: Check null pointers before used Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 133/244] drm/amd/display: Check null pointers before multiple uses Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 134/244] drm/amdgpu: disallow multiple BO_HANDLES chunks in one submit Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 135/244] drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 136/244] drm/amd/display: Add null check for head_pipe in dcn201_acquire_free_pipe_for_layer Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 137/244] drm/amd/display: Add null check for head_pipe in dcn32_acquire_idle_pipe_for_head_pipe_in_layer Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 138/244] drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn30_init_hw Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 139/244] drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn401_init_hw Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 140/244] drm/amd/display: Add NULL check for clk_mgr in dcn32_init_hw Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 142/244] drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 143/244] drm/amd/display: Add null check for top_pipe_to_program in commit_planes_for_stream Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 144/244] drm/amd/display: Use gpuvm_min_page_size_kbytes for DML2 surfaces Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 150/244] drm/amd/display: Underflow Seen on DCN401 eGPU Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 151/244] drm/amd/display: Handle null 'stream_status' in 'planes_changed_for_existing_stream' Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 152/244] drm/amd/display: Add NULL check for function pointer in dcn20_set_output_transfer_func Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 153/244] drm/amd/display: Add NULL check for function pointer in dcn401_set_output_transfer_func Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 154/244] drm/amd/display: Add NULL check for function pointer in dcn32_set_output_transfer_func Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 155/244] drm/amd/display: fix a UBSAN warning in DML2.1 Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 156/244] drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor (v2) Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 157/244] drm/amd/display: Check null pointers before using dc->clk_mgr Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 158/244] drm/amd/display: Check null pointer before try to access it Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 159/244] drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update (v2) Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 161/244] drm/amd/display: fix double free issue during amdgpu module unload Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 162/244] drm/amdgpu: add list empty check to avoid null pointer issue Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 170/244] drm/amdgpu: add raven1 gfxoff quirk Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 171/244] drm/amdgpu: enable gfxoff quirk on HP 705G4 Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 172/244] drm/amdkfd: Fix resource leak in criu restore queue Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 179/244] drm/amd/display: Initialize denominators' default to 1 Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 180/244] drm/amd/display: Check null-initialized variables Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 181/244] drm/amd/display: Check phantom_stream before it is used Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 182/244] drm/amd/display: Check stream before comparing them Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 183/244] drm/amd/display: Deallocate DML memory if allocation fails Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 184/244] drm/amd/display: Check link_res->hpo_dp_link_enc before using it Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 185/244] drm/amd/display: Increase array size of dummy_boolean Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 186/244] drm/amd/display: Fix index out of bounds in DCN30 degamma hardware format translation Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 187/244] drm/amd/display: Fix index out of bounds in " Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 188/244] drm/amd/display: Implement bounds check for stream encoder creation in DCN401 Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 189/244] drm/amd/display: Fix index out of bounds in DCN30 color transformation Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 190/244] drm/amdgpu/gfx12: properly handle error ints on all pipes Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 191/244] drm/amdgpu/gfx9: " Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 192/244] drm/amd/display: Fix possible overflow in integer multiplication Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 193/244] drm/amd/display: Check stream_status before it is used Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 194/244] drm/amd/display: Avoid overflow assignment in link_dp_cts Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 195/244] drm/amd/display: Initialize get_bytes_per_element's default to 1 Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 202/244] drm/amd/display: Force enable 3DLUT DMA check for dcn401 in DML Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 203/244] drm/amdgpu: fix unchecked return value warning for amdgpu_gfx Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 204/244] drm/amdgpu: fix unchecked return value warning for amdgpu_atombios Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 207/244] drm/radeon/r100: Handle unknown family in r100_cp_init_microcode() Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 208/244] drm/amd/display: Unlock Pipes Based On DET Allocation Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 209/244] drm/amdgpu: fix ptr check warning in gfx9 ip_dump Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 210/244] drm/amdgpu: fix ptr check warning in gfx10 ip_dump Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 211/244] drm/amdgpu: fix ptr check warning in gfx11 ip_dump Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 212/244] drm/amdgpu: Block MMR_READ IOCTL in reset Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 213/244] drm/amdgpu/gfx9: use rlc safe mode for soft recovery Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 214/244] drm/amdgpu/gfx11: enter safe mode before touching CP_INT_CNTL Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 216/244] drm/amd/pm: ensure the fw_info is not null before using it Sasha Levin
2024-09-25 11:27 ` Sasha Levin [this message]
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 220/244] drm/amd/display: guard write a 0 post_divider value to HW Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 223/244] drm/amdgpu/gfx12: use rlc safe mode for soft recovery Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 224/244] drm/amdgpu/gfx11: " Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 225/244] drm/amdgpu/gfx10: " 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=20240925113641.1297102-217-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Felix.Kuehling@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tao.zhou1@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