Patch is Reviewed-by: Rex Zhu <Rex.Zhu@xxxxxxx> Rex > -----Original Message----- > From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of S, > Shirish > Sent: Friday, October 26, 2018 6:37 AM > To: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Zhu, Rex > <Rex.Zhu@xxxxxxx> > Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; S, Shirish <Shirish.S@xxxxxxx> > Subject: [PATCH] drm/amdgpu: fix reporting of failed msg sent to SMU > > Currently send_msg_to_smc_async() only report which message failed, but > the actual failing message is the previous one, which SMU is unable to service. > > This patch reads the contents of register where the SMU is stuck and report > appropriately. > > Signed-off-by: Shirish S <shirish.s@xxxxxxx> > --- > drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c > b/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c > index f836d30..b1007b8 100644 > --- a/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c > +++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c > @@ -64,6 +64,7 @@ static uint32_t smu8_get_argument(struct pp_hwmgr > *hwmgr) static int smu8_send_msg_to_smc_async(struct pp_hwmgr > *hwmgr, uint16_t msg) { > int result = 0; > + uint32_t = val; > > if (hwmgr == NULL || hwmgr->device == NULL) > return -EINVAL; > @@ -71,7 +72,11 @@ static int smu8_send_msg_to_smc_async(struct > pp_hwmgr *hwmgr, uint16_t msg) > result = PHM_WAIT_FIELD_UNEQUAL(hwmgr, > SMU_MP1_SRBM2P_RESP_0, > CONTENT, 0); > if (result != 0) { > + /* Read the last message to SMU, to report actual cause */ > + val = cgs_read_register(hwmgr->device, > + mmSMU_MP1_SRBM2P_MSG_0); > pr_err("smu8_send_msg_to_smc_async (0x%04x) failed\n", > msg); > + pr_err("SMU still servicing msg (0x%04x)\n", val); > return result; > } > > -- > 2.7.4 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/amd-gfx _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx