From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/loongson: clean up KMS polling on probe failure Date: Sat, 16 May 2026 14:50:22 +1000 Message-ID: In-Reply-To: <20260511170152.16957-1-mhun512@gmail.com> References: <20260511170152.16957-1-mhun512@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: drm/loongson: clean up KMS polling on probe failure Author: Myeonghun Pak Patches: 4 Reviewed: 2026-05-16T14:50:22.210155 --- This is a single patch that addresses a real bug: `drm_kms_helper_poll_init= ()` is called during probe but `drm_kms_helper_poll_fini()` is never called= on either the error paths or the remove path. The analysis is correct =E2= =80=94 the polling timer/work would leak on probe failure and on device rem= oval. However, **the proposed fix is not the right approach**. The loongson drive= r already uses `devm_drm_dev_alloc()` and `drmm_mode_config_init()` =E2=80= =94 it follows the DRM managed resource pattern. The proper fix is to repla= ce `drm_kms_helper_poll_init()` with `drmm_kms_helper_poll_init()` (a one-l= ine change), which registers a managed cleanup action so that `drm_kms_help= er_poll_fini()` is called automatically when the DRM device is torn down. T= his eliminates the need for any manual `goto` cleanup labels or explicit `p= oll_fini` calls in remove. Additionally, the remove-path change has an ordering concern: the patch pla= ces `drm_kms_helper_poll_fini()` **before** `drm_dev_unregister()`, but the= standard tear-down order (as seen in e.g. `verisilicon/vs_drm.c`) is to un= register first, then finalize polling. Calling `poll_fini` while the device= is still registered could race with connector probing triggered by userspa= ce. --- Generated by Claude Code Patch Reviewer