Skip to contentSkip to conversation

drm/amdgpu: remove pasid_src field from IV entry

PATCH In review Xiaomeng Hou 3 participants 3 messages Apr 27, 2023 – Apr 28, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: remove pasid_src field from IV entry

PASID_SRC is not actually present in the Interrupt Packet, the field is taken as reserved bits now. So remove it from IV entry to avoid misuse.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c  | 1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h | 1 -
 2 files changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +0 -1
index d58353c89e59..fceb3b384955 100644
@@ -271,7 +271,6 @@ void amdgpu_ih_decode_iv_helper(struct amdgpu_device *adev,
 	entry->timestamp_src = dw[2] >> 31;
 	entry->pasid = dw[3] & 0xffff;
 	entry->node_id = (dw[3] >> 16) & 0xff;
-	entry->pasid_src = dw[3] >> 31;
 	entry->src_data[0] = dw[4];
 	entry->src_data[1] = dw[5];
 	entry->src_data[2] = dw[6];
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h +0 -1
index 7a8e686bdd41..1c747ac4129a 100644
@@ -54,7 +54,6 @@ struct amdgpu_iv_entry {
 	unsigned timestamp_src;
 	unsigned pasid;
 	unsigned node_id;
-	unsigned pasid_src;
 	unsigned src_data[AMDGPU_IRQ_SRC_DATA_MAX_SIZE_DW];
 	const uint32_t *iv_entry;
 };
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Good catch!
The PASID_SRC bit is only used in IH_COOKIE which is sent as register write to the IH by IH_client.
But in the interrupt packet from IH to driver, the corresponding bit is always reserved. PASID_SRC is not to be used for driver.

Quoted 48 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Xiaomeng Hou
Sent: Thursday, April 27, 2023 3:17 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Ji, Ruili <[email protected]>; Hou, Xiaomeng (Matthew) <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH] drm/amdgpu: remove pasid_src field from IV entry

PASID_SRC is not actually present in the Interrupt Packet, the field is taken as reserved bits now. So remove it from IV entry to avoid misuse.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c  | 1 -
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h | 1 -
 2 files changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +0 -1
index d58353c89e59..fceb3b384955 100644
@@ -271,7 +271,6 @@ void amdgpu_ih_decode_iv_helper(struct
 amdgpu_device *adev,
      entry->timestamp_src = dw[2] >> 31;
      entry->pasid = dw[3] & 0xffff;
      entry->node_id = (dw[3] >> 16) & 0xff;
-     entry->pasid_src = dw[3] >> 31;
      entry->src_data[0] = dw[4];
      entry->src_data[1] = dw[5];
      entry->src_data[2] = dw[6];
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h +0 -2
index 7a8e686bdd41..1c747ac4129a 100644
@@ -54,7 +54,6 @@ struct amdgpu_iv_entry {
      unsigned timestamp_src;
      unsigned pasid;
      unsigned node_id;
-     unsigned pasid_src;
      unsigned src_data[AMDGPU_IRQ_SRC_DATA_MAX_SIZE_DW];
      const uint32_t *iv_entry;
 };
--

2.25.1

Reviewed-by
#2 lore raw

Yeah, the bit basically tells the IH which PASID lookup table to use for VMID->PASID translation.

I briefly remember that I've just copied&pasted the fields from the IH_COOKIE definition.

Am 28.04.23 um 04:54 schrieb Liu, Aaron:

Quoted 56 lines

[AMD Official Use Only - General]

Good catch!
The PASID_SRC bit is only used in IH_COOKIE which is sent as register write to the IH by IH_client.
But in the interrupt packet from IH to driver, the corresponding bit is always reserved. PASID_SRC is not to be used for driver.

Quoted 48 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Xiaomeng Hou
Sent: Thursday, April 27, 2023 3:17 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Ji, Ruili <[email protected]>; Hou, Xiaomeng (Matthew) <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH] drm/amdgpu: remove pasid_src field from IV entry

PASID_SRC is not actually present in the Interrupt Packet, the field is taken as reserved bits now. So remove it from IV entry to avoid misuse.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c  | 1 -
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h | 1 -
  2 files changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +0 -1
index d58353c89e59..fceb3b384955 100644
@@ -271,7 +271,6 @@ void amdgpu_ih_decode_iv_helper(struct
 amdgpu_device *adev,
       entry->timestamp_src = dw[2] >> 31;
       entry->pasid = dw[3] & 0xffff;
       entry->node_id = (dw[3] >> 16) & 0xff;
-     entry->pasid_src = dw[3] >> 31;
       entry->src_data[0] = dw[4];
       entry->src_data[1] = dw[5];
       entry->src_data[2] = dw[6];
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h +0 -2
index 7a8e686bdd41..1c747ac4129a 100644
@@ -54,7 +54,6 @@ struct amdgpu_iv_entry {
       unsigned timestamp_src;
       unsigned pasid;
       unsigned node_id;
-     unsigned pasid_src;
       unsigned src_data[AMDGPU_IRQ_SRC_DATA_MAX_SIZE_DW];
       const uint32_t *iv_entry;
  };
--

2.25.1