From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795907392; b=iN3NO3ur6TMGXjr5cwyPW8/wHC7cw5LfADRgOZjd2OWfyLMabLc6iRWH5WAiMAIb3tBN uEKtpKbWd/b2j5xzXBp9PTUGnU2DvHsLEtjIOGoP+RPRCnM+hmUBaA88uKW6/fwymc4HR AecXgX7jhUda47pSnX9l9YhJYfcGO6vQBEFQZouDWZXOSlMh4zFIGe3BLFeJzfe84TJE5 0p9OQqj+VT3nIkChXQNbSTHb2Gl5JNnyAXDRFV5uKiXMAziQA4fJcsAad5yJd5/ptIKzf dAn9uaUjtk/hJPOvP1jlbKY9RG3RuR/cCx0hRneVzuZVLEx9AyRynd8xbGZhq18kJtA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795907392; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=X83JhCRgpioj+eCqTgTB04ysRdaWifANzrC2/o98xbU=; b=szxHHZaReLbxI43HsnBgD5gBqAubcTwTiFWXQN6DLRbGJTUxZfiyODHsjYvqGWNpS07a lIk5p5J1+cXN4LrbFQ4S6Rj/Q6lTxia7za9o9xnaCW2WDIjr9teeRzZ3FzZODcLYgSN5q toSpUSh6x3ATx0Ra6C7G/c9bFK9yvfe0fbHoGYLDUhQr6A1Wst9hPXHAQHXYcHHLE7rdI KefvpFh6BiQqNGgCQSwb5X6ysQaNK9S/rGO6b4X/TZZggSogQ3h2fwIf3dPpl/fM/mWLU CYlGESfAcV4iQzc5KCVRtZQmPvzoxqjrKJVHjhGz/dlOYil7oBfP3U+llG9DY+6Mqmg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jXu4P56C; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D179606A31C for ; Sat, 28 Nov 2026 23:09:52 +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=jXu4P56C Received: by smtp.kernel.org (Postfix) with ESMTPSA id B041F1F00897; Sat, 28 Nov 2026 23:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795907391; bh=X83JhCRgpioj+eCqTgTB04ysRdaWifANzrC2/o98xbU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=jXu4P56CZpqztDLsoqPnN7Y+x9etAwnagxL/skU6DMc1KoTF5/Ra+l39uswSVSuR2 YftlLMLfBHs8/lOBt/WpjeftR5771HxKXB2m1THfMAe6l+0yqUbIqwmOfycnaWn5qz rHtJ9nuDVzq6i7iJP7KnKW/LWVvArGJ0JFiK3F3SI6vGMS6V/FF0OqVbQO/OwaDSr5 UdhmvRpUAKZTdzFXewAMuUVnTRKFeyEWjkZb5BVQyKq/SA0CbW1VhQPNLDWyb7rT8X gm+GqsMdlxaHbthFa1HFOGgUJ3ax1ma+MqBjv6I24uTD8lChxPhg0zqLdM9pQ4ISjK pvGF5FfPTkLAw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] leds: pca9532: Propagate I2C errors Reply-To: sashiko-reviews@lists.linux.dev To: "Daniil Demakov" Cc: linux-leds@vger.kernel.org, lee@kernel.org In-Reply-To: <20261128225901.224593-1-t3127430@gmail.com> References: <20261128225901.224593-1-t3127430@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 28 Nov 2026 23:09:51 +0000 X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] leds: pca9532: stale PCA9532_PWM1 in pca9532_set_blink() on error - [Medium] leds: pca9532: unchecked pca9532_gpio_set_value() in direction_input - [Low] leds: pca9532: missing Fixes trailer for pca9532_setled() I2C error handling -- commit 4d10e52bbfe129d5c32f60079f0dde38edbd4d8f Author: Daniil Demakov > leds: pca9532: Propagate I2C errors > > Check the return values of SMBus read and write operations > in pca9532_setled() and propagate errors to callers. > > Unregister the LED class device if configuring the LED fails. > > Signed-off-by: Daniil Demakov [Severity: Low] This fixes the unchecked SMBus read and write operations in pca9532_setled() and pca9532_configure(). Should it include: Fixes: e14fa82439d3 ("leds: Add pca9532 led driver") > diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c > index c8085427696ff..7a2c3ba5c9d8d 100644 > --- a/drivers/leds/leds-pca9532.c > +++ b/drivers/leds/leds-pca9532.c [ ... ] > @@ -257,9 +277,9 @@ static int pca9532_set_blink(struct led_classdev *led= _cdev, > if (err) > return err; > =20 > - pca9532_setled(led); > + err =3D pca9532_setled(led); > =20 > - return 0; > + return err; > } [Severity: Medium] If pca9532_setled() fails here, does led->state stay set to PCA9532_PWM1 from pca9532_update_hw_blink()? When blink_set returns an error, led_blink_setup() falls back to software blinking, which calls pca9532_set_brightness(). Because pca9532_set_brightness() returns early on non-zero brightness when led->state =3D=3D PCA9532_PWM1, software blinking will not turn the LED on, and pca9532_update_hw_blink() will reject different blink timings on other LEDs. > static int pca9532_event(struct input_dev *dev, unsigned int type, > @@ -328,15 +348,15 @@ static int pca9532_gpio_set_value(struct gpio_chip = *gc, unsigned int offset, > { > struct pca9532_data *data =3D gpiochip_get_data(gc); > struct pca9532_led *led =3D &data->leds[offset]; > - > + int err; > if (val) > led->state =3D PCA9532_OFF; > else > led->state =3D PCA9532_ON; > =20 > - pca9532_setled(led); > + err =3D pca9532_setled(led); > =20 > - return 0; > + return err; > } [Severity: Medium] Now that pca9532_gpio_set_value() returns the error from pca9532_setled(), should pca9532_gpio_direction_input() propagate it the way pca9532_gpio_direction_output() does? drivers/leds/leds-pca9532.c:pca9532_gpio_direction_input() { /* To use as input ensure pin is not driven */ pca9532_gpio_set_value(gc, offset, 1); return 0; } Otherwise an I2C failure leaves the open-drain pin driven in its previous state while pca9532_gpio_direction_input() reports success. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261128225901.2245= 93-1-t3127430@gmail.com?part=3D1