Skip to contentSkip to conversation

drm/amd/powerplay: clear VBIOS scratchs on baco exit

PATCH In review Evan Quan 5 participants 14 messages Dec 6, 2019 – Dec 9, 2019

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -0
index 39ec06aee809..ab809df7bc35 100644
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
 		}
 	} else {
 		ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+		if (ret)
+			goto out;
+
+		WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+		WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
 		bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
 						BIF_DOORBELL_INT_CNTL,
 						DOORBELL_INTERRUPT_DISABLE, 0);
Signature · 6 lines
2.24.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix?
I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Quoted 34 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -0
index 39ec06aee809..ab809df7bc35 100644
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
Signature · 6 lines
2.24.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637112002208927733&sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk4o%3D&reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#2 lore raw

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 48 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 10 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 49 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 11 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Chawking.zhang%40amd.com%7C5b9b008a08674b9adf4608d77a0cf73f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637112068506058460&amp;sdata=MAu4Lqac9Ta0HWGKUpnr6BDrqHNwlfljaDTiUIuooro%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw

Correct my typo

This is in high risk to break gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年12月6日 16:07
To: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 49 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 11 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Chawking.zhang%40amd.com%7Cb57687a1142a499ce9bb08d77a235786%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637112164527793226&amp;sdata=VnfAQDikahlBNsvaGwbFHWTcYonmo9q4tWVRuTw9wHk%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Chawking.zhang%40amd.com%7Cb57687a1142a499ce9bb08d77a235786%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637112164527793226&amp;sdata=VnfAQDikahlBNsvaGwbFHWTcYonmo9q4tWVRuTw9wHk%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw
Quoted 5 lines · Hawking

Correct my typo

This is in high risk to break gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

I think we should be ok. If ATOM_S7_ASIC_INIT_COMPLETE_MASK is cleared, we'll assume the card needs to be posted, which it probably should after BACO. This may even be what makes this patch a fix.

Alex

Quoted 90 lines

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年12月6日 16:07
To: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 49 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 11 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

Quoted 12 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Chawking.zhang%40amd.com%7Cb57687a1142a499ce9bb08d77a235786%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637112164527793226&amp;sdata=VnfAQDikahlBNsvaGwbFHWTcYonmo9q4tWVRuTw9wHk%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Chawking.zhang%40amd.com%7Cb57687a1142a499ce9bb08d77a235786%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637112164527793226&amp;sdata=VnfAQDikahlBNsvaGwbFHWTcYonmo9q4tWVRuTw9wHk%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#6 lore raw

Ah yes, I made a logical mistake. This should work.

Regards,
Hawking
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年12月6日 22:01
To: Zhang, Hawking <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Quoted 5 lines · Hawking

Correct my typo

This is in high risk to break gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

I think we should be ok. If ATOM_S7_ASIC_INIT_COMPLETE_MASK is cleared, we'll assume the card needs to be posted, which it probably should after BACO. This may even be what makes this patch a fix.

Alex

Quoted 114 lines

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年12月6日 16:07
To: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 50 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 12 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#7 lore raw

[AMD Official Use Only - Internal Distribution Only]

Can someone tell me what's BIOS_SCRATCH_6 used for? I know BIOS_SCRATCH_7 is used for asic init.

Thanks,
Zhigang

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: December 6, 2019 9:22 AM
To: Alex Deucher <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Ah yes, I made a logical mistake. This should work.

Regards,
Hawking
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年12月6日 22:01
To: Zhang, Hawking <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Quoted 5 lines · Hawking

Correct my typo

This is in high risk to break gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

I think we should be ok. If ATOM_S7_ASIC_INIT_COMPLETE_MASK is cleared, we'll assume the card needs to be posted, which it probably should after BACO. This may even be what makes this patch a fix.

Alex

Quoted 114 lines

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年12月6日 16:07
To: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 50 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 12 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#8 lore raw
Quoted 4 lines · Zhigang

[AMD Official Use Only - Internal Distribution Only]

Can someone tell me what's BIOS_SCRATCH_6 used for? I know BIOS_SCRATCH_7 is used for asic init.

ATOM_S6_CRITICAL_STATE and ATOM_S6_ACC_MODE. See the other S6 defines in atombios.h. I think it's mainly for display.

Alex

Quoted 24 lines

Thanks,
Zhigang

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: December 6, 2019 9:22 AM
To: Alex Deucher <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Ah yes, I made a logical mistake. This should work.

Regards,
Hawking
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年12月6日 22:01
To: Zhang, Hawking <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Quoted 1 line · Hawking
Quoted 131 lines
Quoted 4 lines

Correct my typo

This is in high risk to break gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

I think we should be ok. If ATOM_S7_ASIC_INIT_COMPLETE_MASK is cleared, we'll assume the card needs to be posted, which it probably should after BACO. This may even be what makes this patch a fix.

Alex

Quoted 122 lines

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年12月6日 16:07
To: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 50 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 12 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#9 lore raw

[AMD Official Use Only - Internal Distribution Only]

Thanks, Alex.

Quoted 1 line
Quoted 1 line

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?).

Yes, sriov driver use this register to detect if asic init performed or not.

--Zhigang

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: December 6, 2019 10:42 AM
To: Luo, Zhigang <[email protected]>
Cc: Zhang, Hawking <[email protected]>; Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Quoted 4 lines · Zhigang

[AMD Official Use Only - Internal Distribution Only]

Can someone tell me what's BIOS_SCRATCH_6 used for? I know BIOS_SCRATCH_7 is used for asic init.

ATOM_S6_CRITICAL_STATE and ATOM_S6_ACC_MODE. See the other S6 defines in atombios.h. I think it's mainly for display.

Alex

Quoted 30 lines

Thanks,
Zhigang

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: December 6, 2019 9:22 AM
To: Alex Deucher <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Ah yes, I made a logical mistake. This should work.

Regards,
Hawking
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年12月6日 22:01
To: Zhang, Hawking <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Quoted 1 line · Hawking
Quoted 145 lines
Quoted 4 lines

Correct my typo

This is in high risk to break gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

I think we should be ok. If ATOM_S7_ASIC_INIT_COMPLETE_MASK is cleared, we'll assume the card needs to be posted, which it probably should after BACO. This may even be what makes this patch a fix.

Alex

Quoted 136 lines

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年12月6日 16:07
To: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 50 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 14 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2F
li
st
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknq k
4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7C Ha wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe 48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5 lg
1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7C Ha wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe 48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5 lg
1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7C Ha wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe 48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5 lg
1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#10 lore raw
In reply to Luo, Zhigang

It was used to indicate whether bios or driver to handle display mode for various display type. And also some field to indicate other display status like docking/undocking, LID open/close, etc.

Check atombios_encoder.c for its major usage

Regards,
Hawking

-----Original Message-----
From: Luo, Zhigang <[email protected]>
Sent: 2019年12月6日 23:37
To: Zhang, Hawking <[email protected]>; Alex Deucher <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

[AMD Official Use Only - Internal Distribution Only]

Can someone tell me what's BIOS_SCRATCH_6 used for? I know BIOS_SCRATCH_7 is used for asic init.

Thanks,
Zhigang

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: December 6, 2019 9:22 AM
To: Alex Deucher <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Ah yes, I made a logical mistake. This should work.

Regards,
Hawking
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年12月6日 22:01
To: Zhang, Hawking <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Quoted 5 lines · Hawking

Correct my typo

This is in high risk to break gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

I think we should be ok. If ATOM_S7_ASIC_INIT_COMPLETE_MASK is cleared, we'll assume the card needs to be posted, which it probably should after BACO. This may even be what makes this patch a fix.

Alex

Quoted 114 lines

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年12月6日 16:07
To: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 50 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 12 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#11 lore raw

[AMD Official Use Only - Internal Distribution Only]

Thanks, Hawking.

--Zhigang

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: December 6, 2019 12:35 PM
To: Luo, Zhigang <[email protected]>; Alex Deucher <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

It was used to indicate whether bios or driver to handle display mode for various display type. And also some field to indicate other display status like docking/undocking, LID open/close, etc.

Check atombios_encoder.c for its major usage

Regards,
Hawking

-----Original Message-----
From: Luo, Zhigang <[email protected]>
Sent: 2019年12月6日 23:37
To: Zhang, Hawking <[email protected]>; Alex Deucher <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

[AMD Official Use Only - Internal Distribution Only]

Can someone tell me what's BIOS_SCRATCH_6 used for? I know BIOS_SCRATCH_7 is used for asic init.

Thanks,
Zhigang

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: December 6, 2019 9:22 AM
To: Alex Deucher <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Ah yes, I made a logical mistake. This should work.

Regards,
Hawking
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年12月6日 22:01
To: Zhang, Hawking <[email protected]>
Cc: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Quoted 5 lines · Hawking

Correct my typo

This is in high risk to break gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

I think we should be ok. If ATOM_S7_ASIC_INIT_COMPLETE_MASK is cleared, we'll assume the card needs to be posted, which it probably should after BACO. This may even be what makes this patch a fix.

Alex

Quoted 114 lines

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年12月6日 16:07
To: Quan, Evan <[email protected]>; Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

This is in high risk to break secondary gpu resume and reset just because you clear the ATOM_S7_ASIC_INIT_COMPLETE_MASK field in scratch register 7. And the atom_bios init will be skipped.

We shall understand any libgv fixes very well before "copy" it to bare-metal. Libgv don't need to take care S3.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: 2019年12月6日 13:27
To: Yuan, Xiaojie <[email protected]>; Luo, Zhigang <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Xiaojie,

This was reported by Zhigang team. Under their special use case, scratch register 7 has be to 0 to perform asic init(@Luo, Zhigang right?). And considering old asics(vega20/10) also applied this change.
So, I think it's reasonable(and recommend by SMU fw team) to apply this on the new ASICs also.

Regards,
Evan

Quoted 50 lines

-----Original Message-----
From: Yuan, Xiaojie <[email protected]>
Sent: Friday, December 6, 2019 12:20 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

Hi Evan,

Just out of curiosity, may I know what issue are you trying to fix? I used to see vbios post failure (hangs in atombios init table) after baco exit occasionally on navi.

BR,
Xiaojie

Review

Quoted 11 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b

---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++

1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 4 lines

index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

Quoted 15 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 -1
       }
   } else {
       ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+        if (ret)
+            goto out;
+
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+        WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);
+
       bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                       BIF_DOORBELL_INT_CNTL,
                       DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

Quoted 12 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CXiaojie.Yuan%40amd.com%7C682c142ef30748bbd 00508d779fd6f82%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 112002208927733&amp;sdata=bajaaj3Cw2IxW5nRucg3FXUjcyIi50kCSPQ7eknqk 4o%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CHa wking.Zhang%40amd.com%7C4d211a25634b44f5f7e508d77a54cf55%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637112376982866817&amp;sdata=iM7a7q5lg 1tb4f8EY%2B0heZgeVnHJWwyJJNf8xzCYje8%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#12 lore raw
In reply to Evan Quan
Quoted 14 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
index 39ec06aee809..ab809df7bc35 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state) · line 1666

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +5 -0
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
                }
        } else {
                ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+               if (ret)
+                       goto out;
+
+               WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+               WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);

Please use:
WREG32(adev->bios_scratch_reg_offset + 6, 0); WREG32(adev->bios_scratch_reg_offset + 7, 0);
So we don't have to worry about asic specific scratch register offsets.

Quoted 11 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +1 -1
+
                bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
                                                BIF_DOORBELL_INT_CNTL,
                                                DOORBELL_INTERRUPT_DISABLE, 0);
--

2.24.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#13 lore raw

Thanks. Just sent out a V2.

Quoted 52 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, December 6, 2019 9:59 PM
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>; Luo, Zhigang <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: clear VBIOS scratchs on baco exit

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct

Quoted 15 lines · Evan Quan

This is needed for coming asic init on performing gpu reset.

Change-Id If3671a24d239e3d288665fadaa2c40c87d5da40b
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
index 39ec06aee809..ab809df7bc35 100644
@@ -1659,6 +1659,12 @@ int smu_v11_0_baco_set_state(struct

smu_context *smu, enum smu_baco_state state)

drivers/gpu/drm/amd/powerplay/smu_v11_0.c int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state) · line 1666

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +5 -0
                }
        } else {
                ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
+               if (ret)
+                       goto out;
+
+               WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_6, 0);
+               WREG32_SOC15(NBIO, 0, mmBIOS_SCRATCH_7, 0);

Please use:
WREG32(adev->bios_scratch_reg_offset + 6, 0); WREG32(adev-

Quoted 1 line

bios_scratch_reg_offset + 7, 0); So we don't have to worry about asic specific

scratch register offsets.

Quoted 8 lines

+
bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
BIF_DOORBELL_INT_CNTL,

DOORBELL_INTERRUPT_DISABLE, 0);
--
2.24.0

Quoted 5 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-

Quoted 8 lines

gfx&amp;data=02%7C01%7Cev

Quoted 1 line

an.quan%40amd.com%7Cc8cc8c10f81a47a79fcf08d77a546f33%7C3dd8961fe4 884e6

Quoted 1 line

08e11a82d994e183d%7C0%7C0%7C637112375369462062&amp;sdata=cMVnI %2BkSAsW

Quoted 1 line

1rkwPe%2BpBPKHWDIWOE9Br%2FDEpZejEOZA%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx