From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37515606A320 for ; Tue, 1 Dec 2026 10:47:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=J/05rLWF Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A59E810F159; Tue, 1 Dec 2026 10:47:44 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDCC310F159 for ; Tue, 1 Dec 2026 10:47:37 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 0024561949; Tue, 1 Dec 2026 10:47:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97D2A1F00893; Tue, 1 Dec 2026 10:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796122056; bh=W9EAxA4KeStdVnWfCjzLq8mZrSVShrZJb0NfBzPzBL4=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=J/05rLWFk7+hiKKBMIv0hk477yCeFPTqyo/tMyN9q2ULj088a8l2gL+IdYlutTmOw FUHEdUaNEp4/7/EgR7eOxEusbxWwJvibDsxoj78NgYeqSykzIFo9X/TnFS3EQoPhUf FznA4kwYQTxN3rWMgPfNeLJ4xPR3hq9KkI93ELZmpPl5qPcddzRwI7osxhy6G/kSzg N0sw3fzixQjqAPo9oxJazt5N9fQY2bdNuSBuT5qrcwYldgs6B7frVYe0neo4l0sbwA LvhYoGdcIujvQ6yhDxASTJU4nkUD9lZV6/+p8W7a4g606prh5E2AEhX9msRbIebQ7v MGfjz3i7d2D3w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 4/4] drm/panel: novatek-nt36536: reject enable when prepare failed To: "Qianhui Xu" , dri-devel@lists.freedesktop.org In-Reply-To: <20261201103915.3503057-5-xiaqinghuan@mail.ustc.edu.cn> References: <20261201103915.3503057-1-xiaqinghuan@mail.ustc.edu.cn> <20261201103915.3503057-5-xiaqinghuan@mail.ustc.edu.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 10:47:36 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] drm/panel: novatek_enable() reaches into drm_panel core panel->prepared state -- commit a50376adf296c5b8a35b17ec581a70a2368b7e12 Author: Qianhui Xu drm/panel: novatek-nt36536: reject enable when prepare failed This commit adds a novatek_enable() callback that checks panel->prepared and returns -EIO so the panel is not marked enabled when novatek_prepare() fail= s. > diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36536.c b/drivers/gpu/= drm/panel/panel-novatek-nt36536.c > index 88a003f5a9441..698e7b85a8a76 100644 > --- a/drivers/gpu/drm/panel/panel-novatek-nt36536.c > +++ b/drivers/gpu/drm/panel/panel-novatek-nt36536.c > @@ -123,6 +123,12 @@ static int novatek_prepare(struct drm_panel *panel) > return ret; > } > =20 > +static int novatek_enable(struct drm_panel *panel) > +{ > + /* The bridge enable chain can continue after a failed prepare callback= . */ > + return panel->prepared ? 0 : -EIO; > +} > + > static int novatek_off(struct mipi_dsi_multi_context *dsi_ctx) > { > mipi_dsi_dcs_set_display_off_multi(dsi_ctx); > @@ -186,6 +192,7 @@ static int novatek_get_modes(struct drm_panel *panel, > =20 > static const struct drm_panel_funcs novatek_panel_funcs =3D { > .prepare =3D novatek_prepare, > + .enable =3D novatek_enable, > .unprepare =3D novatek_unprepare, > .get_modes =3D novatek_get_modes, > }; [Severity: Low] Should this panel->prepared check live in drm_panel_enable() instead of adding a dummy novatek_enable() callback that reaches into core drm_panel state? Commit d2aacaf07395 ("drm/panel: Check for already prepared/enabled in drm_panel") moved panel->prepared and panel->enabled tracking into drivers/gpu/drm/drm_panel.c so individual panel drivers would not inspect those fields directly. Also, the commit message states that checking panel->prepared in drm_panel_enable() would skip panels that never implement prepare(), but drm_panel_prepare() sets panel->prepared =3D true even when panel->funcs->prepare is NULL: drivers/gpu/drm/drm_panel.c:drm_panel_prepare() { ... if (panel->funcs && panel->funcs->prepare) { ret =3D panel->funcs->prepare(panel); if (ret < 0) goto exit; } panel->prepared =3D true; ... } Handling !panel->prepared in drm_panel_enable() would avoid driver-specific workarounds and keep behavior consistent across all panel drivers. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201103915.3503= 057-1-xiaqinghuan@mail.ustc.edu.cn?part=3D4