From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B85761AF0B6; Wed, 4 Jun 2025 01:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748999205; cv=none; b=ctWWUFZfK+nkWB9Ncw5AFSdTyXa+27o6sYCkKd2HVpVLm9yjcQDBS74h+KkNPwMwJmU1L5xvDNsKz/KgXRmQDRZUHP1SS9FwK/diMIIi2TClFiyHyUzG9iNZX1MQpdTkH027/KfBtRrCaK6V1SZus4PacPHnILTz29pnPktZY9o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748999205; c=relaxed/simple; bh=42m6U2aC7xOBQPY5211IT4cf4IJj/Yjxtb+F8ulvFWk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=F2lDx4WeDgdeiwes8VeDGX8zvOQY6BCGRTBMZzXa99o26XJMSYT/Uqz1wFLytQ8WKzGoJpfjoQs06bsQm/0v7jC/byzdC9H30YI/k2Ih/9xPqpt2l80v7kVKuQ1BizHdejnaP+72MnU6uvDVVz6TCE5k93S9+WCFc/LxCg2q/8k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PExc1m+4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PExc1m+4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44598C4CEED; Wed, 4 Jun 2025 01:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748999205; bh=42m6U2aC7xOBQPY5211IT4cf4IJj/Yjxtb+F8ulvFWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PExc1m+4pEtbUoXDLXkyAyYtxnpm/FYTuhWpYZWPcRJiY+8HILnM/u/xAyKP/pnox 0fZMGiwGY8F5Ikv25dIedhNJZb9Fd446YGgJZ/MzFf8ECKOd+gi6qrqwvIgpd/IjVA 8qvaIWv0Mt3yoFsGoAAE8fkWhWyKcileUwrj9l5VUtUKrguQgewULXGbA/ljkPtcxi frQxvN3ZldcUi+izq998J0halm2rmSs42+UyRQ3hpWgu9ncVNkf0o5PHChxpBIIS2Y BcSs5Qp5JkSHGtSXGz0zTnhwGhqEfnl95jou5/grJQQCKjBFnPFyvGtt/7pZjzk8vs AiK2wN4O66FCQ== From: Sasha Levin To: patches@lists.linux.dev, stable@vger.kernel.org Cc: Gabor Juhos , Imre Kaloz , Andrew Lunn , Linus Walleij , Sasha Levin , gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, brgl@bgdev.pl, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 14/27] pinctrl: armada-37xx: propagate error from armada_37xx_pmx_set_by_name() Date: Tue, 3 Jun 2025 21:06:07 -0400 Message-Id: <20250604010620.6819-14-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250604010620.6819-1-sashal@kernel.org> References: <20250604010620.6819-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.237 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Gabor Juhos [ Upstream commit 4229c28323db141eda69cb99427be75d3edba071 ] The regmap_update_bits() function can fail, so propagate its error up to the stack instead of silently ignoring that. Signed-off-by: Imre Kaloz Reviewed-by: Andrew Lunn Signed-off-by: Gabor Juhos Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-7-07e9ac1ab737@gmail.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- Based on my analysis of the commit and the code context, here's my assessment: **YES** This commit should be backported to stable kernel trees. Here's my extensive analysis: ## Code Analysis The commit changes `armada_37xx_pmx_set_by_name()` function from: ```c regmap_update_bits(info->regmap, reg, mask, val); return 0; ``` To: ```c return regmap_update_bits(info->regmap, reg, mask, val); ``` ## Why This Should Be Backported 1. **Bug Fix Nature**: This is a clear bug fix that addresses silent error handling. The `regmap_update_bits()` function returns an integer error code (0 on success, negative on failure), but the original code was ignoring this return value and always returning success (0). 2. **Error Propagation Impact**: The function `armada_37xx_pmx_set_by_name()` is called from: - `armada_37xx_pmx_set()` - the main pinmux set function - `armada_37xx_gpio_request_enable()` - GPIO request handler that already checks return values 3. **Consistency with Similar Fixes**: Looking at the historical commits provided: - **Similar Commit #2** (Backport Status: YES) shows the exact same pattern where `armada_37xx_gpio_request_enable()` was updated to check return values from `armada_37xx_pmx_set_by_name()` - This current commit completes that fix by ensuring the function actually returns errors when they occur 4. **Critical Subsystem**: This affects the pinctrl subsystem which is fundamental to GPIO and pin configuration. Silent failures in pin configuration can lead to: - Hardware not being configured correctly - GPIO requests appearing to succeed when they actually failed - Difficult-to-debug hardware issues 5. **Minimal Risk**: The change is extremely small and contained: - No new functionality added - No architectural changes - Simple error propagation fix - Maintains existing API contract 6. **Stable Tree Criteria Compliance**: - ✅ Fixes an important bug affecting users - ✅ Small, contained change - ✅ No new features - ✅ Minimal regression risk - ✅ Affects critical kernel subsystem 7. **Real-World Impact**: Without this fix, regmap failures (which can occur due to hardware issues, power management problems, or I2C/SPI communication errors) would be silently ignored, leading to unpredictable system behavior where pin configurations appear successful but are actually failed. The commit follows the pattern established in the historical commit #2 which was marked for backporting, and represents the completion of proper error handling in this driver's critical path. drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 85a0052bb0e62..da83f188351d3 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -354,9 +354,7 @@ static int armada_37xx_pmx_set_by_name(struct pinctrl_dev *pctldev, val = grp->val[func]; - regmap_update_bits(info->regmap, reg, mask, val); - - return 0; + return regmap_update_bits(info->regmap, reg, mask, val); } static int armada_37xx_pmx_set(struct pinctrl_dev *pctldev, -- 2.39.5