<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 27 Oct, 2020, 17:01 Sandeep, <<a href="mailto:sandy.8925@gmail.com">sandy.8925@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Tue, 27 Oct, 2020, 08:10 Evan Quan, <<a href="mailto:evan.quan@amd.com" target="_blank" rel="noreferrer">evan.quan@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Which can be used for S4(hibernation) support.<br>
<br>
Change-Id: I6e4962c120a3baed14cea04ed1742ff11a273d34<br>
Signed-off-by: Evan Quan <<a href="mailto:evan.quan@amd.com" rel="noreferrer noreferrer" target="_blank">evan.quan@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/amdgpu/cik.c | 4 +++-<br>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ci_baco.c | 7 ++++---<br>
2 files changed, 7 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c<br>
index 03ff8bd1fee8..5442df094102 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/cik.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c<br>
@@ -1336,11 +1336,13 @@ cik_asic_reset_method(struct amdgpu_device *adev)<br>
<br>
switch (adev->asic_type) {<br>
case CHIP_BONAIRE:<br>
- case CHIP_HAWAII:<br>
/* disable baco reset until it works */<br>
/* smu7_asic_get_baco_capability(adev, &baco_reset); */<br>
baco_reset = false;<br>
break;<br>
+ case CHIP_HAWAII:<br>
+ baco_reset = cik_asic_supports_baco(adev);<br>
+ break;<br>
default:<br>
baco_reset = false;<br>
break;<br>
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ci_baco.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ci_baco.c<br>
index 3be40114e63d..45f608838f6e 100644<br>
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ci_baco.c<br>
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ci_baco.c<br>
@@ -142,12 +142,12 @@ static const struct baco_cmd_entry exit_baco_tbl[] =<br>
{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_BCLK_OFF_MASK, BACO_CNTL__BACO_BCLK_OFF__SHIFT, 0, 0x00 },<br>
{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_POWER_OFF_MASK, BACO_CNTL__BACO_POWER_OFF__SHIFT, 0, 0x00 },<br>
{ CMD_DELAY_MS, 0, 0, 0, 20, 0 },<br>
- { CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__PWRGOOD_BF_MASK, 0, 0xffffffff, 0x20 },<br>
+ { CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__PWRGOOD_BF_MASK, 0, 0xffffffff, 0x200 },<br>
{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_ISO_DIS_MASK, BACO_CNTL__BACO_ISO_DIS__SHIFT, 0, 0x01 },<br>
- { CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__PWRGOOD_MASK, 0, 5, 0x1c },<br>
+ { CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__PWRGOOD_MASK, 0, 5, 0x1c00 },<br>
{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_ANA_ISO_DIS_MASK, BACO_CNTL__BACO_ANA_ISO_DIS__SHIFT, 0, 0x01 },<br>
{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_RESET_EN_MASK, BACO_CNTL__BACO_RESET_EN__SHIFT, 0, 0x00 },<br>
- { CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__RCU_BIF_CONFIG_DONE_MASK, 0, 5, 0x10 },<br>
+ { CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__RCU_BIF_CONFIG_DONE_MASK, 0, 5, 0x100 },<br>
{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_EN_MASK, BACO_CNTL__BACO_EN__SHIFT, 0, 0x00 },<br>
{ CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__BACO_MODE_MASK, 0, 0xffffffff, 0x00 }<br>
};<br>
@@ -155,6 +155,7 @@ static const struct baco_cmd_entry exit_baco_tbl[] =<br>
static const struct baco_cmd_entry clean_baco_tbl[] =<br>
{<br>
{ CMD_WRITE, mmBIOS_SCRATCH_6, 0, 0, 0, 0 },<br>
+ { CMD_WRITE, mmBIOS_SCRATCH_7, 0, 0, 0, 0 },<br>
{ CMD_WRITE, mmCP_PFP_UCODE_ADDR, 0, 0, 0, 0 }<br>
};<br>
<br>
-- <br>
2.29.0<br></blockquote></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Not sure why I'm cc'd on this, I'm not a maintainer, nor does this patch seem related to any patches I've contributed.</div><div dir="auto"><br></div><div dir="auto">- Sandeep</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Ok, I just saw the other email. I'll try testing the patch and see if it fixes the hibernation bug.</div><div dir="auto"><br></div><div dir="auto">- Sandeep</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>
</blockquote></div></div></div>