From: Jasdeep Dhillon <jdhillon@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: stylon.wang@amd.com, hengzhou <Hengyong.Zhou@amd.com>,
Eric Yang <Eric.Yang2@amd.com>,
Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
qingqing.zhuo@amd.com, Jasdeep Dhillon <jdhillon@amd.com>,
Rodrigo.Siqueira@amd.com, roman.li@amd.com, solomon.chiu@amd.com,
Aurabindo.Pillai@amd.com, wayne.lin@amd.com,
Bhawanpreet.Lakha@amd.com,
Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>,
agustin.gutierrez@amd.com, pavle.kotarac@amd.com
Subject: [PATCH 3/8] drm/amd/display: Wait DMCUB to idle state before reset.
Date: Tue, 24 May 2022 13:57:19 -0400 [thread overview]
Message-ID: <20220524175724.126380-4-jdhillon@amd.com> (raw)
In-Reply-To: <20220524175724.126380-1-jdhillon@amd.com>
From: hengzhou <Hengyong.Zhou@amd.com>
[WHY]
Very low rate to cause memory access issue while resetting
DMCUB after the halt command was sent to it.
The process of stopping fw of DMCUB may be timeout, that means
it is not in idle state, such as the window frames may still be
kept in cache, so reset by force will cause MMHUB hang.
[HOW]
After the halt command was sent, keep checking the DMCUB state until
it is idle.
Reviewed-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Jasdeep Dhillon <jdhillon@amd.com>
Signed-off-by: hengzhou <Hengyong.Zhou@amd.com>
---
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 2 +-
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 9 ++++++++-
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h | 3 ++-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h
index 4c880b64f8ca..c7021915bac8 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h
@@ -62,7 +62,7 @@ struct dccg {
int ref_dppclk;
//int dtbclk_khz[MAX_PIPES];/* TODO needs to be removed */
//int audio_dtbclk_khz;/* TODO needs to be removed */
- //int ref_dtbclk_khz;/* TODO needs to be removed */
+ int ref_dtbclk_khz;/* TODO needs to be removed */
};
struct dtbclk_dto_params {
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c
index 7c9330a61ac1..8d4574895757 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c
@@ -84,7 +84,7 @@ void dmub_dcn31_reset(struct dmub_srv *dmub)
{
union dmub_gpint_data_register cmd;
const uint32_t timeout = 100;
- uint32_t in_reset, scratch, i;
+ uint32_t in_reset, scratch, i, pwait_mode;
REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &in_reset);
@@ -115,6 +115,13 @@ void dmub_dcn31_reset(struct dmub_srv *dmub)
udelay(1);
}
+ for (i = 0; i < timeout; ++i) {
+ REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &pwait_mode);
+ if (pwait_mode & (1 << 0))
+ break;
+
+ udelay(1);
+ }
/* Force reset in case we timed out, DMCUB is likely hung. */
}
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h
index 59ddc81b5a0e..f6db6f89d45d 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h
@@ -151,7 +151,8 @@ struct dmub_srv;
DMUB_SF(DCN_VM_FB_OFFSET, FB_OFFSET) \
DMUB_SF(DMCUB_INBOX0_WPTR, DMCUB_INBOX0_WPTR) \
DMUB_SF(DMCUB_INTERRUPT_ENABLE, DMCUB_GPINT_IH_INT_EN) \
- DMUB_SF(DMCUB_INTERRUPT_ACK, DMCUB_GPINT_IH_INT_ACK)
+ DMUB_SF(DMCUB_INTERRUPT_ACK, DMCUB_GPINT_IH_INT_ACK) \
+ DMUB_SF(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS)
struct dmub_srv_dcn31_reg_offset {
#define DMUB_SR(reg) uint32_t reg;
--
2.25.1
next prev parent reply other threads:[~2022-05-24 17:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 17:57 [PATCH 0/8] May 24, 2022 Jasdeep Dhillon
2022-05-24 17:57 ` [PATCH 1/8] drm/amd/display: revert Blank eDP on disable/enable drv Jasdeep Dhillon
2022-05-24 17:57 ` [PATCH 2/8] drm/amd/display: Pass the new context into disable OTG WA Jasdeep Dhillon
2022-05-24 17:57 ` Jasdeep Dhillon [this message]
2022-05-24 17:57 ` [PATCH 4/8] drm/amd/display: Fix DMUB outbox trace in S4 (#4465) Jasdeep Dhillon
2022-05-24 17:57 ` [PATCH 5/8] drm/amd/display: Don't clear ref_dtbclk value Jasdeep Dhillon
2022-05-24 17:57 ` [PATCH 6/8] Prepare for new interfaces Jasdeep Dhillon
2022-05-24 17:57 ` [PATCH 7/8] drm/amd/display: Fix possible infinite loop in DP LT fallback Jasdeep Dhillon
2022-05-24 17:57 ` [PATCH 8/8] drm/amd/display: 3.2.187 Jasdeep Dhillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220524175724.126380-4-jdhillon@amd.com \
--to=jdhillon@amd.com \
--cc=Aurabindo.Pillai@amd.com \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=Eric.Yang2@amd.com \
--cc=Harry.Wentland@amd.com \
--cc=Hengyong.Zhou@amd.com \
--cc=Nicholas.Kazlauskas@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Sunpeng.Li@amd.com \
--cc=agustin.gutierrez@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=pavle.kotarac@amd.com \
--cc=qingqing.zhuo@amd.com \
--cc=roman.li@amd.com \
--cc=solomon.chiu@amd.com \
--cc=stylon.wang@amd.com \
--cc=wayne.lin@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox