Skip to content

Commit 22e1dc4

Browse files
Wayne Linalexdeucher
authored andcommitted
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_device() Cc: Stable <[email protected]> Reviewed-by: Aurabindo Pillai <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Wayne Lin <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent b401b62 commit 22e1dc4

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,21 +1843,12 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
18431843
DRM_ERROR("amdgpu: fail to register dmub aux callback");
18441844
goto error;
18451845
}
1846-
if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD, dmub_hpd_callback, true)) {
1847-
DRM_ERROR("amdgpu: fail to register dmub hpd callback");
1848-
goto error;
1849-
}
1850-
if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD_IRQ, dmub_hpd_callback, true)) {
1851-
DRM_ERROR("amdgpu: fail to register dmub hpd callback");
1852-
goto error;
1853-
}
1854-
}
1855-
1856-
/* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.
1857-
* It is expected that DMUB will resend any pending notifications at this point, for
1858-
* example HPD from DPIA.
1859-
*/
1860-
if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
1846+
/* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.
1847+
* It is expected that DMUB will resend any pending notifications at this point. Note
1848+
* that hpd and hpd_irq handler registration are deferred to register_hpd_handlers() to
1849+
* align legacy interface initialization sequence. Connection status will be proactivly
1850+
* detected once in the amdgpu_dm_initialize_drm_device.
1851+
*/
18611852
dc_enable_dmub_outbox(adev->dm.dc);
18621853

18631854
/* DPIA trace goes to dmesg logs only if outbox is enabled */
@@ -3536,6 +3527,14 @@ static void register_hpd_handlers(struct amdgpu_device *adev)
35363527
int_params.requested_polarity = INTERRUPT_POLARITY_DEFAULT;
35373528
int_params.current_polarity = INTERRUPT_POLARITY_DEFAULT;
35383529

3530+
if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
3531+
if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD, dmub_hpd_callback, true))
3532+
DRM_ERROR("amdgpu: fail to register dmub hpd callback");
3533+
3534+
if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD_IRQ, dmub_hpd_callback, true))
3535+
DRM_ERROR("amdgpu: fail to register dmub hpd callback");
3536+
}
3537+
35393538
list_for_each_entry(connector,
35403539
&dev->mode_config.connector_list, head) {
35413540

@@ -3564,10 +3563,6 @@ static void register_hpd_handlers(struct amdgpu_device *adev)
35643563
handle_hpd_rx_irq,
35653564
(void *) aconnector);
35663565
}
3567-
3568-
if (adev->dm.hpd_rx_offload_wq)
3569-
adev->dm.hpd_rx_offload_wq[connector->index].aconnector =
3570-
aconnector;
35713566
}
35723567
}
35733568

@@ -4561,6 +4556,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
45614556
goto fail;
45624557
}
45634558

4559+
if (dm->hpd_rx_offload_wq)
4560+
dm->hpd_rx_offload_wq[aconnector->base.index].aconnector =
4561+
aconnector;
4562+
45644563
if (!dc_link_detect_connection_type(link, &new_connection_type))
45654564
DRM_ERROR("KMS: Failed to detect connector\n");
45664565

0 commit comments

Comments
 (0)