Skip to contentSkip to conversation

drm/amd/display: Shorten hdmi_frl_status_polling_workqueue

PATCH Superseded Nathan Chancellor 3 participants 3 messages Jun 5

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Shorten hdmi_frl_status_polling_workqueue

There is a warning when creating the hdmi_frl_status_polling_wq workqueue because "hdmi_frl_status_polling_workqueue" excceds WQ_NAME_LEN:

workqueue: name exceeds WQ_NAME_LEN. Truncating to: hdmi_frl_status_polling_workque

Shorten the workqueue name to "hdmi_frl_status_polling_wq" like the structure member to avoid the warning.

Fixes 5c9b8b27a883 ("drm/amd/display: Tie FRL support into amdgpu_dm")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
index 1ed697a3a453..f120f75827d9 100644
@@ -2262,9 +2262,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 	}
 	if (adev->dm.dc->caps.max_links > 0) {
 		adev->dm.hdmi_frl_status_polling_wq =
-			create_singlethread_workqueue("hdmi_frl_status_polling_workqueue");
+			create_singlethread_workqueue("hdmi_frl_status_polling_wq");
 		if (!adev->dm.hdmi_frl_status_polling_wq)
-			drm_err(adev_to_drm(adev), "failed to initialize hdmi_frl_status_polling_workqueue\n");
+			drm_err(adev_to_drm(adev), "failed to initialize hdmi_frl_status_polling_wq\n");
 		adev->dm.hdmi_frl_status_polling_delay_ms = 200;
 		INIT_DELAYED_WORK(&adev->dm.hdmi_frl_status_polling_work, hdmi_frl_status_polling_work);
 	}

---
base-commit: 56ae73c92e200e630c2bdf1e98c88b86c8483b37
change-id: 20260604-amdgpu-fix-wq_name_len-warning-63c8012e0c2b

Best regards,

Signature · 2 lines
Cheers,
Nathan
#1 lore raw
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] Resource leak of hdmi_frl_status_polling_wq during module teardown or initialization failure.
- [High] NULL pointer dereference if hdmi_frl_status_polling_wq allocation fails.
--

commit b8f83563decd99d69977bc64fe3e67736687cb49
Author: Nathan Chancellor <[email protected]> drm/amd/display: Shorten hdmi_frl_status_polling_workqueue

This commit shortens the name of the hdmi_frl_status_polling_wq workqueue to prevent warnings about exceeding the maximum workqueue name length.

Fixes 5c9b8b27a883 ("drm/amd/display: Tie FRL support into amdgpu_dm")

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 2262

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 8f80420e9f0b8..3cde7a456858c 100644
@@ -2259,9 +2259,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 	}
 	if (adev->dm.dc->caps.max_links > 0) {
 		adev->dm.hdmi_frl_status_polling_wq =
-			create_singlethread_workqueue("hdmi_frl_status_polling_workqueue");
+			create_singlethread_workqueue("hdmi_frl_status_polling_wq");

[Severity: High]
This isn't a bug introduced by this patch, but does this workqueue get leaked on driver unload?

Looking at amdgpu_dm_fini(), there doesn't seem to be a corresponding destroy_workqueue() call for this specific workqueue. Does this mean every time the driver is unloaded or initialization fails after this point, the workqueue struct and its internal resources are leaked?

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 2267

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 		if (!adev->dm.hdmi_frl_status_polling_wq)
-			drm_err(adev_to_drm(adev), "failed to initialize hdmi_frl_status_polling_workqueue\n");
+			drm_err(adev_to_drm(adev), "failed to initialize hdmi_frl_status_polling_wq\n");

[Severity: High]
This is also a pre-existing issue, but can an allocation failure here cause a NULL pointer dereference later on?

Unlike other workqueues in this function that use a goto error path when allocation fails, this just logs the error and continues. If it returns NULL, wouldn't amdgpu_dm_commit_streams() trigger a kernel panic when it subsequently calls queue_delayed_work() using this NULL pointer?

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
 		adev->dm.hdmi_frl_status_polling_delay_ms = 200;
 		INIT_DELAYED_WORK(&adev->dm.hdmi_frl_status_polling_work, hdmi_frl_status_polling_work);
 	}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/20260604-amdgpu-fix-wq_name_len-warning-v1-1-eb5415b45b27@kernel.org?part=1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Nathan Chancellor
Quoted 41 lines · Nathan Chancellor

There is a warning when creating the hdmi_frl_status_polling_wq workqueue because "hdmi_frl_status_polling_workqueue" excceds WQ_NAME_LEN:

workqueue: name exceeds WQ_NAME_LEN. Truncating to: hdmi_frl_status_polling_workque

Shorten the workqueue name to "hdmi_frl_status_polling_wq" like the structure member to avoid the warning.

Fixes 5c9b8b27a883 ("drm/amd/display: Tie FRL support into amdgpu_dm")
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -3
index 1ed697a3a453..f120f75827d9 100644
@@ -2262,9 +2262,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
  	}
  	if (adev->dm.dc->caps.max_links > 0) {
  		adev->dm.hdmi_frl_status_polling_wq =
-			create_singlethread_workqueue("hdmi_frl_status_polling_workqueue");
+			create_singlethread_workqueue("hdmi_frl_status_polling_wq");
  		if (!adev->dm.hdmi_frl_status_polling_wq)
-			drm_err(adev_to_drm(adev), "failed to initialize hdmi_frl_status_polling_workqueue\n");
+			drm_err(adev_to_drm(adev), "failed to initialize hdmi_frl_status_polling_wq\n");
  		adev->dm.hdmi_frl_status_polling_delay_ms = 200;
  		INIT_DELAYED_WORK(&adev->dm.hdmi_frl_status_polling_work, hdmi_frl_status_polling_work);
  	}
 
---

base-commit: 56ae73c92e200e630c2bdf1e98c88b86c8483b37
change-id: 20260604-amdgpu-fix-wq_name_len-warning-63c8012e0c2b

Best regards,
--
Cheers,
Nathan