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 4C78E606A322 for ; Sat, 5 Dec 2026 01:12:07 +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=XwLbk+M2 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7E3111322C; Sat, 5 Dec 2026 01:12:01 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BB4411322F for ; Sat, 5 Dec 2026 01:11:55 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id BFD90601C7; Sat, 5 Dec 2026 01:11:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C3EF1F00936; Sat, 5 Dec 2026 01:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796433114; bh=wuPHimdXWJHOO3bn9eBZyAGj8BO/x2t9QTovBkWBDVs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XwLbk+M2gbmOUdLJXbMQz1zu+N1BF+d3WSe0pj16TSzr33Eq0a/JZ1OawzA/DJ0an 6zUipmpea8C01r8Kcktxci9HTREPtm0gd68gZ06ihu4Y44fuaj9v71zqVHQCNlRksP bFYbf0xITvVMroOQL7m1YmnS4N9aMrIyxKgQmJMY/b5HWSrSYHdM1SGwdzyxNeZRyo JsgAXE5HTGqLXGDPGc7YkQgFeHgwhjT+KOfbTv+HDtmbLctV66kCfE/rCT2/udaAmS sUpc0/jaXK7mhbevtBrtpH7zxw+l1EmOfAooGSrOjombKVOwRuiMvWxMBUeUckut3S TqDplTfmwPmGQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 6/6] backlight: aw99706: Add AW99703 support To: "Luka Panio" Cc: dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org, lee@kernel.org In-Reply-To: <20261205005118.884885-7-lukapanio@gmail.com> References: <20261205005118.884885-1-lukapanio@gmail.com> <20261205005118.884885-7-lukapanio@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 01:11:53 +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=-11.1 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 3 potential issues to consider: - [Medium] backlight: aw99706: skip hwen_delay_us in aw99706_probe() without enable-gpios - [Medium] backlight: aw99706: missing hwen_delay_us in aw99706_hw_init() on resume - [Medium] backlight: aw99706: aw->bl_enable desynced when enable-gpios is omitted -- commit 33423fef0e8fe321782e20dbb975455055809999 Author: Luka Panio backlight: aw99706: Add AW99703 support This commit adds support for the Awinic AW99703 3-channel WLED backlight driver to the aw99706 driver, including optional vin regulator and enable GPIO handling, a label property, and an HWEN startup delay. > diff --git a/drivers/video/backlight/aw99706.c b/drivers/video/backlight/= aw99706.c > index 5e0f8ccd3c88e..f898df0d4ed15 100644 > --- a/drivers/video/backlight/aw99706.c > +++ b/drivers/video/backlight/aw99706.c [ ... ] > @@ -456,12 +611,19 @@ static int aw99706_probe(struct i2c_client *client) > =20 > aw99706_dt_parse(aw, &props); > =20 > - aw->hwen_gpio =3D devm_gpiod_get(aw->dev, "enable", GPIOD_OUT_LOW); > + ret =3D devm_regulator_get_enable_optional(dev, "vin"); > + if (ret < 0 && ret !=3D -ENODEV) > + return dev_err_probe(dev, ret, "Failed to enable vin supply\n"); > + > + aw->hwen_gpio =3D devm_gpiod_get_optional(aw->dev, "enable", > + GPIOD_OUT_LOW); > if (IS_ERR(aw->hwen_gpio)) > return dev_err_probe(dev, PTR_ERR(aw->hwen_gpio), > "Failed to get enable gpio\n"); [Severity: Medium] Can aw->bl_enable get out of sync with the hardware when enable-gpios is omitted? Without an enable GPIO, probe neither resets the chip nor reads chip->en_reg, so aw->bl_enable stays false even if the bootloader left the backlight enabled. A later aw99706_update_brightness(aw, 0) when blanking the backlight then skips aw99706_bl_enable(aw, false), leaving the boost converter active. Initializing aw->bl_enable from chip->en_reg or issuing a software reset when no enable GPIO is present would keep the cached state aligned. > =20 > gpiod_set_value_cansleep(aw->hwen_gpio, 1); > + if (aw->hwen_gpio && aw->chip->hwen_delay_us) > + fsleep(aw->chip->hwen_delay_us); > =20 > ret =3D aw99706_chip_id_read(aw); [Severity: Medium] Should the hwen_delay_us wait also run when vin-supply powers the chip without enable-gpios? When HWEN is tied high to VIN and enable-gpios is omitted, devm_regulator_get_enable_optional() enables the supply but aw->hwen_gpio is NULL, so fsleep() is skipped. aw99706_chip_id_read() then accesses the chip before the 3.5 ms startup window completes, which can NACK over I2C and fail probe with -ENODEV. [Severity: Medium] Does aw99706_hw_init() also need to wait aw->chip->hwen_delay_us after asserting aw->hwen_gpio? aw99706_resume() calls aw99706_hw_init() directly, which drives aw->hwen_gpio high and immediately issues I2C writes for aw->init_tbl[]. If HWEN dropped low during suspend or hibernation, skipping the 3.5 ms startup delay on AW99703 can cause those transfers to fail and leave the backlight uninitialized after resume. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205005118.8848= 85-1-lukapanio@gmail.com?part=3D6