Skip to contentSkip to conversation

drm/amdgpu: Add MB_REQ_MSG_READY_TO_RESET response when VF get FLR notification.

PATCH In review Peng Ju Zhou 2 participants 3 messages Aug 9, 2021 – Aug 12, 2021

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

PATCH 1/1 drm/amdgpu: Add MB_REQ_MSG_READY_TO_RESET response when VF get FLR notification.

From: Jiange Zhao <[email protected]>

When guest received FLR notification from host, it would lock adapter into reset state. There will be no more job submission and hardware access after that.

Then it should send a response to host that it has prepared for host reset.

---
 drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +2 -0
index b48e68f46a5c..a35e6d87e537 100644
@@ -287,6 +287,8 @@ static void xgpu_nv_mailbox_flr_work(struct work_struct *work)
 	amdgpu_virt_fini_data_exchange(adev);
 	atomic_set(&adev->in_gpu_reset, 1);
 
+	xgpu_nv_mailbox_trans_msg(adev, IDH_READY_TO_RESET, 0, 0, 0);
+
 	do {
 		if (xgpu_nv_mailbox_peek_msg(adev) == IDH_FLR_NOTIFICATION_CMPL)
 			goto flr_done;
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h +2 -1
index 9f5808616174..73887b0aa1d6 100644
@@ -37,7 +37,8 @@ enum idh_request {
 	IDH_REQ_GPU_RESET_ACCESS,
 	IDH_REQ_GPU_INIT_DATA,
 
-	IDH_LOG_VF_ERROR       = 200,
+	IDH_LOG_VF_ERROR	= 200,
+	IDH_READY_TO_RESET 	= 201,
 };
 
 enum idh_event {
Signature · 1 line
2.17.1
#1 lore raw

[AMD Official Use Only]

ping

Quoted 57 lines

-----Original Message-----
From: Peng Ju Zhou <[email protected]>
Sent: Monday, August 9, 2021 5:37 PM
To: [email protected]
Cc: Zhao, Jiange <[email protected]>; Zhou, Peng Ju <[email protected]>
Subject: [PATCH] drm/amdgpu: Add MB_REQ_MSG_READY_TO_RESET response when VF get FLR notification.

From: Jiange Zhao <[email protected]>

When guest received FLR notification from host, it would lock adapter into reset state. There will be no more job submission and hardware access after that.

Then it should send a response to host that it has prepared for host reset.

---
 drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 2 ++
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +2 -0
index b48e68f46a5c..a35e6d87e537 100644
@@ -287,6 +287,8 @@ static void xgpu_nv_mailbox_flr_work(struct
 work_struct *work)
 	amdgpu_virt_fini_data_exchange(adev);
 	atomic_set(&adev->in_gpu_reset, 1);
 
+	xgpu_nv_mailbox_trans_msg(adev, IDH_READY_TO_RESET, 0, 0, 0);
+
 	do {
 		if (xgpu_nv_mailbox_peek_msg(adev) ==

IDH_FLR_NOTIFICATION_CMPL)

drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +0 -0
 			goto flr_done;
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h +2 -2
index 9f5808616174..73887b0aa1d6 100644
@@ -37,7 +37,8 @@ enum idh_request {
 	IDH_REQ_GPU_RESET_ACCESS,
 	IDH_REQ_GPU_INIT_DATA,
 
-	IDH_LOG_VF_ERROR       = 200,
+	IDH_LOG_VF_ERROR	= 200,
+	IDH_READY_TO_RESET 	= 201,
 };
 
 enum idh_event {
--

2.17.1

Reviewed-by
#2 lore raw
Quoted 71 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhou, Peng Ju
Sent: Thursday, August 12, 2021 4:28 PM
To: Zhou, Peng Ju <[email protected]>; [email protected]
Cc: Zhao, Jiange <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: Add MB_REQ_MSG_READY_TO_RESET response when VF get FLR notification.

[AMD Official Use Only]

ping

Quoted 7 lines

-----Original Message-----
From: Peng Ju Zhou <[email protected]>
Sent: Monday, August 9, 2021 5:37 PM
To: [email protected]
Cc: Zhao, Jiange <[email protected]>; Zhou, Peng Ju <[email protected]>
Subject: [PATCH] drm/amdgpu: Add MB_REQ_MSG_READY_TO_RESET

response

Quoted 50 lines

when VF get FLR notification.

From: Jiange Zhao <[email protected]>

When guest received FLR notification from host, it would lock adapter into reset state. There will be no more job submission and hardware access after that.

Then it should send a response to host that it has prepared for host reset.

---
 drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 2 ++
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +2 -0
index b48e68f46a5c..a35e6d87e537 100644
@@ -287,6 +287,8 @@ static void xgpu_nv_mailbox_flr_work(struct
 work_struct *work)
 	amdgpu_virt_fini_data_exchange(adev);
 	atomic_set(&adev->in_gpu_reset, 1);
 
+	xgpu_nv_mailbox_trans_msg(adev, IDH_READY_TO_RESET, 0, 0, 0);
+
 	do {
 		if (xgpu_nv_mailbox_peek_msg(adev) ==

IDH_FLR_NOTIFICATION_CMPL)

drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +0 -0
 			goto flr_done;
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h +2 -2
index 9f5808616174..73887b0aa1d6 100644
@@ -37,7 +37,8 @@ enum idh_request {
 	IDH_REQ_GPU_RESET_ACCESS,
 	IDH_REQ_GPU_INIT_DATA,
 
-	IDH_LOG_VF_ERROR       = 200,
+	IDH_LOG_VF_ERROR	= 200,
+	IDH_READY_TO_RESET 	= 201,
 };
 
 enum idh_event {
--

2.17.1