FAILED: patch "[PATCH] drm/amd/display: Wake DMCUB before executing GPINT commands" failed to apply to 6.6-stable tree
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x e5ffd1263dd5b44929c676171802e7b6af483f21
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024012755-hunter-tableware-14bd@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
e5ffd1263dd5 ("drm/amd/display: Wake DMCUB before executing GPINT commands") 8892780834ae ("drm/amd/display: Wake DMCUB before sending a command") 8e57c06bf4b0 ("drm/amd/display: Refactor DMCUB enter/exit idle interface") 0f657938e434 ("drm/amd/display: do not send commands to DMUB if DMUB is inactive from S3") c41028a2a163 ("drm/amd/display: add a debugfs interface for the DMUB trace mask") 1ffa8602e39b ("drm/amd/display: Guard against invalid RPTR/WPTR being set") b63eae94d28c ("drm/amd/display: clean up some inconsistent indenting") 10406abe036b ("drm/amd/display: make dc_set_power_state() return type void again") 1ca965719b5b ("drm/amd/display: Change dc_set_power_state() to bool instead of int") 7441ef0b3ebe ("drm/amd: Propagate failures in dc_set_power_state()") 1288d7020809 ("drm/amd/display: Improve x86 and dmub ips handshake") c0f8b83188c7 ("drm/amd/display: disable IPS")93a66cef607c ("drm/amd/display: Add IPS control flag")dc01c4b79bfe ("drm/amd/display: Update driver and IPS interop") 06b1661e45b4 ("drm/amd/display: Add DCN35 DM Support")0fa45b6aeae4 ("drm/amd/display: Add DCN35 Resource")ec129fa356be ("drm/amd/display: Add DCN35 init")65138eb72e1f ("drm/amd/display: Add DCN35 DMUB")8774029f76b9 ("drm/amd/display: Add DCN35 CLK_MGR")6f8b7565cca4 ("drm/amd/display: Add DCN35 HWSEQ")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e5ffd1263dd5b44929c676171802e7b6af483f21 Mon Sep 17 00:00:00 2001
From: Nicholas Kazlauskas <[email protected]>
Date: Tue, 5 Dec 2023 11:22:56 -0500
Subject: [PATCH] drm/amd/display: Wake DMCUB before executing GPINT commands
[Why]
DMCUB can be in idle when we attempt to interface with the HW through the GPINT mailbox resulting in a system hang.
[How]
Add dc_wake_and_execute_gpint() to wrap the wake, execute, sleep sequence.
If the GPINT executes successfully then DMCUB will be put back into sleep after the optional response is returned.
It functions similar to the inbox command interface.
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +5 -24
@@ -2976,7 +2976,6 @@ static int dmub_trace_mask_set(void *data, u64 val)struct amdgpu_device *adev = data;struct dmub_srv *srv = adev->dm.dc->ctx->dmub_srv->dmub;enum dmub_gpint_command cmd; -enum dmub_status status;u64 mask =0xffff ;u8 shift =0 ;u32 res;
@@ -3003,13 +3002,7 @@ static int dmub_trace_mask_set(void *data, u64 val)break ; } - status =dmub_srv_send_gpint_command (srv, cmd, res,30 ); - -if (status ==DMUB_STATUS_TIMEOUT ) -return -ETIMEDOUT ; -else if (status ==DMUB_STATUS_INVALID ) -return -EINVAL ; -else if (status !=DMUB_STATUS_OK ) +if (!dc_wake_and_execute_gpint (adev->dm.dc->ctx, cmd, res,NULL ,DM_DMUB_WAIT_TYPE_WAIT ))return -EIO ;usleep_range (100 ,1000 );
@@ -3026,7 +3019,6 @@ static int dmub_trace_mask_show(void *data, u64 *val)enum dmub_gpint_command cmd =DMUB_GPINT__GET_TRACE_BUFFER_MASK_WORD0 ;struct amdgpu_device *adev = data;struct dmub_srv *srv = adev->dm.dc->ctx->dmub_srv->dmub; -enum dmub_status status;u8 shift =0 ;u64 raw =0 ;u64 res =0 ;
@@ -3036,23 +3028,12 @@ static int dmub_trace_mask_show(void *data, u64 *val)return -EINVAL ;while (i <4 ) { - status =dmub_srv_send_gpint_command (srv, cmd,0 ,30 ); - -if (status ==DMUB_STATUS_OK ) { - status =dmub_srv_get_gpint_response (srv, (u32 *) &raw); - -if (status ==DMUB_STATUS_INVALID ) -return -EINVAL ; -else if (status !=DMUB_STATUS_OK ) -return -EIO ; - }else if (status ==DMUB_STATUS_TIMEOUT ) { -return -ETIMEDOUT ; - }else if (status ==DMUB_STATUS_INVALID ) { -return -EINVAL ; - }else { +uint32_t response; + +if (!dc_wake_and_execute_gpint (adev->dm.dc->ctx, cmd,0 , &response,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ))return -EIO ; - } + raw = response;usleep_range (100 ,1000 ); cmd++;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +55 -17
100 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +11 -0
@@ -145,5 +145,16 @@ bool dc_wake_and_execute_dmub_cmd(const struct dc_context *ctx, union dmub_rb_cmbool dc_wake_and_execute_dmub_cmd_list (const struct dc_context *ctx,unsigned int count,union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type); +/** +* dc_wake_and_execute_gpint() +* +* @ctx: DC context +* @command_code: The command ID to send to DMCUB +* @param: The parameter to message DMCUB +* @response: Optional response out value - may be NULL. +* @wait_type: The wait behavior for the execution +*/ +bool dc_wake_and_execute_gpint (const struct dc_context *ctx,enum dmub_gpint_command command_code, +uint16_t param,uint32_t *response,enum dm_dmub_wait_type wait_type);#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +6 -13
@@ -105,23 +105,18 @@ static enum dc_psr_state convert_psr_state(uint32_t raw_state)*/ static void dmub_psr_get_state (struct dmub_psr *dmub,enum dc_psr_state *state,uint8_t panel_inst) { -struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;uint32_t raw_state =0 ;uint32_t retry_count =0 ; -enum dmub_status status;do {// Send gpint command and wait for ack - status =dmub_srv_send_gpint_command (srv,DMUB_GPINT__GET_PSR_STATE , panel_inst,30 ); - -if (status ==DMUB_STATUS_OK ) { -// GPINT was executed, get response -dmub_srv_get_gpint_response (srv, &raw_state); +if (dc_wake_and_execute_gpint (dmub->ctx,DMUB_GPINT__GET_PSR_STATE , panel_inst, &raw_state, +DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) { *state =convert_psr_state (raw_state); - }else + }else {// Return invalid state when GPINT times out *state =PSR_STATE_INVALID ; - + } }while (++retry_count <=1000 && *state ==PSR_STATE_INVALID );// Assert if max retry hit
@@ -452,13 +447,11 @@ static void dmub_psr_force_static(struct dmub_psr *dmub, uint8_t panel_inst)*/ static void dmub_psr_get_residency (struct dmub_psr *dmub,uint32_t *residency,uint8_t panel_inst) { -struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;uint16_t param = (uint16_t )(panel_inst <<8 );/* Send gpint command and wait for ack */ -dmub_srv_send_gpint_command (srv,DMUB_GPINT__PSR_RESIDENCY , param,30 ); - -dmub_srv_get_gpint_response (srv, residency); +dc_wake_and_execute_gpint (dmub->ctx,DMUB_GPINT__PSR_RESIDENCY , param, residency, +DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ); }static const struct dmub_psr_funcs psr_funcs = {