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=1796527454; b=sFiefH4OieckX9b3A7T1fW+Ia/n8Y3qIb+V+VDBmAEt7yoiIO0kCprfQ1Arv2fAcVOQG KXxdheuuRs5zePDE5aCAtKqxjf3GQN7hmJq0dBmHp+wPx6Xk5hh/urGhGLWYvubAh6Vz7 sbNbHk7OpaRjLDhSDjOCvKi0SOsHrJiAtwv+aw3txExMlajSZIPpj2YvLKYRadFvIhPbh MMNZvKeJgrD4UPIjgqkHagZOChaDh1W5EhsiQ94gqPKuUCE26+5WeabXa4lVLkjrKVDx5 CpcFCLijbaG9wWWvwvLpSb2B9pRKMCgQNGwKWrhnDV3PZWlI4dGoGg+rWqyW9hReGVw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796527454; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=2008rb1/9G5vdM9FHfL0/awZvtFrJfoty1HAqroNHjY=; b=V0SF2mRJvjBYxYGrLmXXIrsNjacCHJaKDntb+zPxd/0mE1XCAQJQ/EJwqSIRY9QWcWKO WNl0NMaLHuq6RIMqOqBFwCa68PZ53vGxG5SDPlukoB9r6ZSKmJjyYA7HSiT0OS2ukTSHa glL4WRhiQkHVFcmHfvj3AnJhG0lAKiutFpLcw+sJardln+zhaYm4uBCGac8LxXyeKgnT8 S1jMxkLOC50zMUY4pIaqS0+QqImNnjR06vJDHAvQ2qX/PmCUzNQlLg/i7y192rgaTLpkl apg1C4f2Nn6q4b23KGZ9u8prtdoIBXPoTdzvtn6FVvDU0AfLXlraAvaa+U0E4Hz6aCQ== 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=XOyPSl5Y; 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 C6B89606A31F; Sun, 6 Dec 2026 03:24:14 +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=XOyPSl5Y Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F9CD1F0092B; Sun, 6 Dec 2026 03:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796527454; bh=2008rb1/9G5vdM9FHfL0/awZvtFrJfoty1HAqroNHjY=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XOyPSl5YZbXaRn54SIgaCYgdw0gcHHjnlWEeUeRieKtXv/FHjmOqIqbFFZhHzfIOy 0pCjh6S87AapmVbovBfpdoPE01tb64b2cQGosOe3GWikSGe32Ue6hIVzX2boB26R6S FIhTKTywlWmAMBCClaa0MdH/Iyhn6EEo2G4uP9wF5YWuTlSlQClJubWNzI4VNW3Xd6 VMoHJ7m7ls2tYbqA8hM+v5Cq7tosu8ljhoLEhMfb33aRNuPftZujfzlscysoUpnB86 D0LY9mtpfvD1Yy4RVeYOVelUKLJrjVUs3FFAeMdX85sfi80p9B4i4UIG4C6qRcrWtt ckNf+ch0pJJNw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v7 4/9] power: axp20x_battery: Add constant charge current table Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?TW9sbsOhciBNw6F0w6k=?= Cc: devicetree@vger.kernel.org, linux-input@vger.kernel.org, mfd@lists.linux.dev, robh@kernel.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com, lee@kernel.org In-Reply-To: <20261206-axp192-v7-4-0200fc77da53@gmail.com> References: <20261206-axp192-v7-0-0200fc77da53@gmail.com> <20261206-axp192-v7-4-0200fc77da53@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Dec 2026 03:24:13 +0000 X-Mailing-List: linux-input@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 1 potential issue to consider: - [Medium] power: supply: axp20x_battery: missing upper bound check for ccc_table -- commit f993b38bb97cab5bf0e1a39f154f674939512710 Author: Aidan MacDonald power: axp20x_battery: Add constant charge current table This commit adds a lookup table option for constant charge current on variants whose values do not follow a linear range, and updates the DT fallback to use the device's minimum configured current. > diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply= /axp20x_battery.c > index 4af1a209c9cf3..f31b735ed6548 100644 > --- a/drivers/power/supply/axp20x_battery.c > +++ b/drivers/power/supply/axp20x_battery.c [ ... ] > @@ -675,16 +686,35 @@ static int axp717_battery_set_max_voltage(struct ax= p20x_batt_ps *axp20x_batt, > AXP717_CHRG_CV_VOLT_MASK, val); > } > =20 > +static int axp20x_get_constant_charge_current_sel(struct axp20x_batt_ps = *axp_batt, > + int charge_current) > +{ > + int i; > + > + if (axp_batt->data->ccc_table) { > + for (i =3D AXP20X_CHRG_CTRL1_TGT_CURR; i >=3D 0; i--) { > + if (axp_batt->data->ccc_table[i] <=3D charge_current) > + return i; > + } > + > + return -EINVAL; > + } > + > + i =3D (charge_current - axp_batt->data->ccc_offset) / axp_batt->data->c= cc_scale; > + if (i > AXP20X_CHRG_CTRL1_TGT_CURR || i < 0) > + return -EINVAL; > + > + return i; > +} [Severity: Medium] Should the ccc_table path reject charge_current values above ccc_table[AXP20X_CHRG_CTRL1_TGT_CURR] with -EINVAL? Unlike the linear branch below, the reverse scan matches any value above the maximum table entry on the first iteration and returns selector AXP20X_CHRG_CTRL1_TGT_CURR. An out-of-range high write to constant_charge_current_max via axp20x_set_max_constant_charge_current() then silently raises max_ccc to the hardware maximum instead of returning -EINVAL, and an unsupported high DT value in axp209_set_battery_info() programs the hardware maximum instead of falling back to ccc_table[0]. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206-axp192-v7-= 0-0200fc77da53@gmail.com?part=3D4