Skip to contentSkip to conversation

drm/amdgpu: correct vmid_src -> vmhub_index mapping

PATCH In review Lang Yu 3 participants 4 messages Jul 26, 2023 – Jul 27, 2023

Subsystems (2)
lore
Share & tools
lore

Lang Yu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: correct vmid_src -> vmhub_index mapping

Align with new vmhub definition.
vmid_src 0 -> AMDGPU_GFXHUB(0).
vmid_src 1 -> AMDGPU_MMHUB0(0).

---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +2 -1
index 6b430e10d38e..9c4e084da99a 100644
@@ -102,9 +102,10 @@ static int gmc_v10_0_process_interrupt(struct amdgpu_device *adev,
 				       struct amdgpu_irq_src *source,
 				       struct amdgpu_iv_entry *entry)
 {
+	struct amdgpu_vmhub *hub =
+		&adev->vmhub[entry->vmid_src ? AMDGPU_MMHUB0(0) : AMDGPU_GFXHUB(0)];
 	bool retry_fault = !!(entry->src_data[1] & 0x80);
 	bool write_fault = !!(entry->src_data[1] & 0x20);
-	struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
 	struct amdgpu_task_info task_info;
 	uint32_t status = 0;
 	u64 addr;
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +2 -1
index 604522f70d03..47f5ced12ba2 100644
@@ -99,7 +99,8 @@ static int gmc_v11_0_process_interrupt(struct amdgpu_device *adev,
 				       struct amdgpu_irq_src *source,
 				       struct amdgpu_iv_entry *entry)
 {
-	struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
+	struct amdgpu_vmhub *hub =
+		&adev->vmhub[entry->vmid_src ? AMDGPU_MMHUB0(0) : AMDGPU_GFXHUB(0)];
 	uint32_t status = 0;
 	u64 addr;
 
Signature · 1 line
2.25.1
#1 lore raw

[AMD Official Use Only - General]

@Chai, Thomas sent the same fix for the review if I remember correctly. Might check with him to see when he push the fixes.

Regards,
Hawking

-----Original Message-----
From: Yu, Lang <[email protected]>
Sent: Wednesday, July 26, 2023 19:25
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Zhang, Yifan <[email protected]>; Yu, Lang <[email protected]>
Subject: [PATCH] drm/amdgpu: correct vmid_src -> vmhub_index mapping

Align with new vmhub definition.
vmid_src 0 -> AMDGPU_GFXHUB(0).
vmid_src 1 -> AMDGPU_MMHUB0(0).

---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 ++-  drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +2 -1
index 6b430e10d38e..9c4e084da99a 100644
@@ -102,9 +102,10 @@ static int gmc_v10_0_process_interrupt(struct amdgpu_device *adev,
                                       struct amdgpu_irq_src *source,
                                       struct amdgpu_iv_entry *entry)  {
+       struct amdgpu_vmhub *hub =
+               &adev->vmhub[entry->vmid_src ? AMDGPU_MMHUB0(0) : AMDGPU_GFXHUB(0)];
        bool retry_fault = !!(entry->src_data[1] & 0x80);
        bool write_fault = !!(entry->src_data[1] & 0x20);
-       struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
        struct amdgpu_task_info task_info;
        uint32_t status = 0;
        u64 addr;
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +2 -2
index 604522f70d03..47f5ced12ba2 100644
@@ -99,7 +99,8 @@ static int gmc_v11_0_process_interrupt(struct amdgpu_device *adev,
                                       struct amdgpu_irq_src *source,
                                       struct amdgpu_iv_entry *entry)  {
-       struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
+       struct amdgpu_vmhub *hub =
+               &adev->vmhub[entry->vmid_src ? AMDGPU_MMHUB0(0) : AMDGPU_GFXHUB(0)];
        uint32_t status = 0;
        u64 addr;
 
--

2.25.1

#2 lore raw

[AMD Official Use Only - General]

Yes, the patch title is " drm/amdgpu: fix incorrect vmhub index ".

Hi lang:
You can update this patch based on the above patch review results .

-----------------
Best Regards,
Thomas

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Wednesday, July 26, 2023 8:03 PM
To: Yu, Lang <[email protected]>; [email protected]; Chai, Thomas <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: correct vmid_src -> vmhub_index mapping

[AMD Official Use Only - General]

@Chai, Thomas sent the same fix for the review if I remember correctly. Might check with him to see when he push the fixes.

Regards,
Hawking

-----Original Message-----
From: Yu, Lang <[email protected]>
Sent: Wednesday, July 26, 2023 19:25
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Zhang, Yifan <[email protected]>; Yu, Lang <[email protected]>
Subject: [PATCH] drm/amdgpu: correct vmid_src -> vmhub_index mapping

Align with new vmhub definition.
vmid_src 0 -> AMDGPU_GFXHUB(0).
vmid_src 1 -> AMDGPU_MMHUB0(0).

---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 ++-  drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +2 -1
index 6b430e10d38e..9c4e084da99a 100644
@@ -102,9 +102,10 @@ static int gmc_v10_0_process_interrupt(struct amdgpu_device *adev,
                                       struct amdgpu_irq_src *source,
                                       struct amdgpu_iv_entry *entry)  {
+       struct amdgpu_vmhub *hub =
+               &adev->vmhub[entry->vmid_src ? AMDGPU_MMHUB0(0) : AMDGPU_GFXHUB(0)];
        bool retry_fault = !!(entry->src_data[1] & 0x80);
        bool write_fault = !!(entry->src_data[1] & 0x20);
-       struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
        struct amdgpu_task_info task_info;
        uint32_t status = 0;
        u64 addr;
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +2 -2
index 604522f70d03..47f5ced12ba2 100644
@@ -99,7 +99,8 @@ static int gmc_v11_0_process_interrupt(struct amdgpu_device *adev,
                                       struct amdgpu_irq_src *source,
                                       struct amdgpu_iv_entry *entry)  {
-       struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
+       struct amdgpu_vmhub *hub =
+               &adev->vmhub[entry->vmid_src ? AMDGPU_MMHUB0(0) : AMDGPU_GFXHUB(0)];
        uint32_t status = 0;
        u64 addr;
 
--

2.25.1

author
#3 lore raw
Quoted 6 lines · Thomas

[AMD Official Use Only - General]

Yes, the patch title is " drm/amdgpu: fix incorrect vmhub index ".

Hi lang:
You can update this patch based on the above patch review results .

Ok. Thanks.

Regards,
Lang

Quoted 67 lines

-----------------
Best Regards,
Thomas

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Wednesday, July 26, 2023 8:03 PM
To: Yu, Lang <[email protected]>; [email protected]; Chai, Thomas <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: correct vmid_src -> vmhub_index mapping

[AMD Official Use Only - General]

@Chai, Thomas sent the same fix for the review if I remember correctly. Might check with him to see when he push the fixes.

Regards,
Hawking

-----Original Message-----
From: Yu, Lang <[email protected]>
Sent: Wednesday, July 26, 2023 19:25
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Zhang, Yifan <[email protected]>; Yu, Lang <[email protected]>
Subject: [PATCH] drm/amdgpu: correct vmid_src -> vmhub_index mapping

Align with new vmhub definition.
vmid_src 0 -> AMDGPU_GFXHUB(0).
vmid_src 1 -> AMDGPU_MMHUB0(0).

---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 ++-  drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +2 -1
index 6b430e10d38e..9c4e084da99a 100644
@@ -102,9 +102,10 @@ static int gmc_v10_0_process_interrupt(struct amdgpu_device *adev,
                                       struct amdgpu_irq_src *source,
                                       struct amdgpu_iv_entry *entry)  {
+       struct amdgpu_vmhub *hub =
+               &adev->vmhub[entry->vmid_src ? AMDGPU_MMHUB0(0) : AMDGPU_GFXHUB(0)];
        bool retry_fault = !!(entry->src_data[1] & 0x80);
        bool write_fault = !!(entry->src_data[1] & 0x20);
-       struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
        struct amdgpu_task_info task_info;
        uint32_t status = 0;
        u64 addr;
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +2 -2
index 604522f70d03..47f5ced12ba2 100644
@@ -99,7 +99,8 @@ static int gmc_v11_0_process_interrupt(struct amdgpu_device *adev,
                                       struct amdgpu_irq_src *source,
                                       struct amdgpu_iv_entry *entry)  {
-       struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
+       struct amdgpu_vmhub *hub =
+               &adev->vmhub[entry->vmid_src ? AMDGPU_MMHUB0(0) : AMDGPU_GFXHUB(0)];
        uint32_t status = 0;
        u64 addr;
 
--

2.25.1