From nobody Sun May 19 01:26:45 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E39B615DBAE; Wed, 27 Mar 2024 12:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711541921; cv=none; b=tibSmbImhO+RkZsZArqjwIyhtZkoh/TVaB6o5uHDgTa/dW4uGJBDjHwn8fupUBK4ubk/KeB4AwcQRsIh7/Ahr3G1RejPIHAMx2PJe9Z6Z2UffOWcETpWM1nhSqPkhFtVT+zXX8kitadxHBAV75BhISt/Wwgy7x54vFVbyanXr1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711541921; c=relaxed/simple; bh=3z1dsjdu8YhtrbD+uaI0V2x9raBjjlVnv+kw8aDPaSw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Dm7ho3y6qJsSNfCTYEaY4AijQdEwLkIF/Yols+Zvze0s+vGR3Dq7+M+1oFmc5NsTOHqHzUVgmNnBluIKk9v72ikaEkqELHpvHLCFqIw0xMquExkY6mItwY8sIqxxxW+LmRDWZNQG84IogC/DaSVL3nH74DEwb5aZdN03Gmn1uLI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VQBaULXt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VQBaULXt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB523C433F1; Wed, 27 Mar 2024 12:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711541920; bh=3z1dsjdu8YhtrbD+uaI0V2x9raBjjlVnv+kw8aDPaSw=; h=From:To:Cc:Subject:Date:From; b=VQBaULXt+V4ejf7EDQmPPnG5YVhmoT7yMG5pZNYeOGlf6S1UmHDnPQ18takZWuUNh U2vDGya9pN17FPIMYvkTtiebo/Q+6LB351A6SOLAe8X6hnc510LTdxiLXR9FZghIOo sJGh/I5Xoj4hiulJTHpuxGhMUlBkt4cZpm2ZVN0u5frL+1CQhcLXnhmP0g6tZr/snA 5/rqRkVGpOAQr0tiB4YyFIeQ4ZooZoCKGq2GqVo52asc/oToTWWHd5QDaeIXHmZIix RKse+ZjqvS3urSUwecwjX5pb3En/dCUgmTDNmLkYlq0BQF+YIUeZggiw3lJDHLilzj LZuSmxs6bQUMQ== From: Sasha Levin To: stable@vger.kernel.org, wayne.lin@amd.com Cc: Aurabindo Pillai , Rodrigo Siqueira , Daniel Wheeler , Alex Deucher , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: FAILED: Patch "drm/amd/display: adjust few initialization order in dm" failed to apply to 5.10-stable tree Date: Wed, 27 Mar 2024 08:18:38 -0400 Message-ID: <20240327121839.2834553-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The patch below does not apply to the 5.10-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 . Thanks, Sasha Acked-by: Rodrigo Siqueira Reviewed-by: Aurabindo Pillai Tested-by: Daniel Wheeler ------------------ original commit in Linus's tree ------------------ From c9aef4f6c6d7cdc92a64ffe761c6921ec85157ae Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Fri, 2 Feb 2024 17:34:11 +0800 Subject: [PATCH] drm/amd/display: adjust few initialization order in dm [Why] Observe error message "Can't retrieve aconnector in hpd_rx_irq_offload_work" when boot up with a mst tbt4 dock connected. After analyzing, there are few parts needed to be adjusted: 1. hpd_rx_offload_wq[].aconnector is not initialzed before the dmub outbox hpd_irq handler get registered which causes the error message. 2. registeration of hpd and hpd_rx_irq event for usb4 dp tunneling is not aligned with legacy interface sequence [How] Put DMUB_NOTIFICATION_HPD and DMUB_NOTIFICATION_HPD_IRQ handler registration into register_hpd_handlers() to align other interfaces and get hpd_rx_offload_wq[].aconnector initialized earlier than that. Leave DMUB_NOTIFICATION_AUX_REPLY registered as it was since we need that while calling dc_link_detect(). USB4 connection status will be proactively detected by dc_link_detect_connection_type() in amdgpu_dm_initialize_drm_de= vice() Cc: Stable Reviewed-by: Aurabindo Pillai Acked-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gp= u/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 985137b51372d..8b13cb334b366 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1844,21 +1844,12 @@ static int amdgpu_dm_init(struct amdgpu_device *ade= v) DRM_ERROR("amdgpu: fail to register dmub aux callback"); goto error; } - if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD, dmub_hpd= _callback, true)) { - DRM_ERROR("amdgpu: fail to register dmub hpd callback"); - goto error; - } - if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD_IRQ, dmub= _hpd_callback, true)) { - DRM_ERROR("amdgpu: fail to register dmub hpd callback"); - goto error; - } - } - - /* Enable outbox notification only after IRQ handlers are registered and = DMUB is alive. - * It is expected that DMUB will resend any pending notifications at this= point, for - * example HPD from DPIA. - */ - if (dc_is_dmub_outbox_supported(adev->dm.dc)) { + /* Enable outbox notification only after IRQ handlers are registered and= DMUB is alive. + * It is expected that DMUB will resend any pending notifications at thi= s point. Note + * that hpd and hpd_irq handler registration are deferred to register_hp= d_handlers() to + * align legacy interface initialization sequence. Connection status wil= l be proactivly + * detected once in the amdgpu_dm_initialize_drm_device. + */ dc_enable_dmub_outbox(adev->dm.dc); =20 /* DPIA trace goes to dmesg logs only if outbox is enabled */ @@ -3547,6 +3538,14 @@ static void register_hpd_handlers(struct amdgpu_devi= ce *adev) int_params.requested_polarity =3D INTERRUPT_POLARITY_DEFAULT; int_params.current_polarity =3D INTERRUPT_POLARITY_DEFAULT; =20 + if (dc_is_dmub_outbox_supported(adev->dm.dc)) { + if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD, dmub_hpd= _callback, true)) + DRM_ERROR("amdgpu: fail to register dmub hpd callback"); + + if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD_IRQ, dmub= _hpd_callback, true)) + DRM_ERROR("amdgpu: fail to register dmub hpd callback"); + } + list_for_each_entry(connector, &dev->mode_config.connector_list, head) { =20 @@ -3575,10 +3574,6 @@ static void register_hpd_handlers(struct amdgpu_devi= ce *adev) handle_hpd_rx_irq, (void *) aconnector); } - - if (adev->dm.hpd_rx_offload_wq) - adev->dm.hpd_rx_offload_wq[connector->index].aconnector =3D - aconnector; } } =20 @@ -4590,6 +4585,10 @@ static int amdgpu_dm_initialize_drm_device(struct am= dgpu_device *adev) goto fail; } =20 + if (dm->hpd_rx_offload_wq) + dm->hpd_rx_offload_wq[aconnector->base.index].aconnector =3D + aconnector; + if (!dc_link_detect_connection_type(link, &new_connection_type)) DRM_ERROR("KMS: Failed to detect connector\n"); =20 --=20 2.43.0