Commit 8f3c6f08 authored by Dave Airlie's avatar Dave Airlie Committed by Danilo Krummrich
Browse files

nouveau/dpcd: return EBUSY for aux xfer if the device is asleep



If we have runtime suspended, and userspace wants to use /dev/drm_dp_*
then just tell it the device is busy instead of crashing in the GSP
code.

WARNING: CPU: 2 PID: 565741 at drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rpc.c:164 r535_gsp_msgq_wait+0x9a/0xb0 [nouveau]
CPU: 2 UID: 0 PID: 565741 Comm: fwupd Not tainted 6.18.10-200.fc43.x86_64 #1 PREEMPT(lazy)
Hardware name: LENOVO 20QTS0PQ00/20QTS0PQ00, BIOS N2OET65W (1.52 ) 08/05/2024
RIP: 0010:r535_gsp_msgq_wait+0x9a/0xb0 [nouveau]

This is a simple fix to get backported. We should probably engineer a
proper power domain solution to wake up devices and keep them awake
while fw updates are happening.

Cc: stable@vger.kernel.org
Fixes: 8894f491 ("drm/nouveau: register a drm_dp_aux channel for each dp connector")
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patch.msgid.link/20260224031750.791621-1-airlied@gmail.com


Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent f82859c8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1230,6 +1230,9 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *obj, struct drm_dp_aux_msg *msg)
	u8 size = msg->size;
	int ret;

	if (pm_runtime_suspended(nv_connector->base.dev->dev))
		return -EBUSY;

	nv_encoder = find_encoder(&nv_connector->base, DCB_OUTPUT_DP);
	if (!nv_encoder)
		return -ENODEV;