From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 21EC2C5AD49 for ; Wed, 4 Jun 2025 03:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8YaDE1iPgVHtf9zTx2ZwoiTyLZHx+nuRVrGxmuTFGR0=; b=E949bmfVBAbpkhUjJfkzjge0we Z9UuMqgliYY6FIbHNFO/bWBU/ewJD4LyA0EmM3s8gknvema3uyn8jalhx8Ngu2ErCxwhibu0OyAxQ Yb9Om56RaRVUUl1TBdAKwjsJkDeeD2bUKiUgbgZzHPqQJ4YkoCZMVF1K+QlFziFUDY982U86YnxRO 352UK97EO3VvYzOhMfXL+ktbTKapbRVt414x+0SxQKxWwQAywvgdlgJl4u5DD5ygIWABzhiAuDDRb IZLJDz4IMXrFUlq0/QZdgf8uXC8EkAu5lhdwI/FZdL3xLh6ZbpZf8mp/g3ANy6QvdVeYiFlT3OPDd tHEKSOzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMeNe-0000000COsD-2mvq; Wed, 04 Jun 2025 03:01:30 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMcYe-0000000C8n1-309R for linux-arm-kernel@lists.infradead.org; Wed, 04 Jun 2025 01:04:46 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id EEF09A4F2A3; Wed, 4 Jun 2025 01:04:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DFB5C4CEED; Wed, 4 Jun 2025 01:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748999083; bh=MufHod0A/BdviTTzQlbdv34CCtmNQk+UQzrnAhhW2fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pqq03vnIL+eE11SJCKkhCvsEeObSP79n91M/rPKTlyRxuG92FWbgB+K9fEfWsT5O6 FStAkem9YhWGqAfiC9xnRStwHn4oRT8351Gm8Xifg0r/r9QnlWhvmURLZZQQxOCYTQ /Zczf3fTt2wcckTI2sozIK0WJ9bQdVWUaNdGPzBK3qXLcB2lDlg6lnssJcV8ZL+nf7 QEeeEEnQmPpqcFuMKRq69DprCIU5KgCLJQlCsnWerpaUsbRvSgk7wnmrUa4IXPiNQ7 OWv+9zjrgZsRmNb1Dben7rkGvxnU4WQ8oqoOBg5EAXAtOebbz9npI+QmR09cp/SQfs S0UqecSjopgdg== 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 6.1 21/46] pinctrl: armada-37xx: propagate error from armada_37xx_pmx_set_by_name() Date: Tue, 3 Jun 2025 21:03:39 -0400 Message-Id: <20250604010404.5109-21-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250604010404.5109-1-sashal@kernel.org> References: <20250604010404.5109-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.140 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250603_180444_897779_599FB6E2 X-CRM114-Status: GOOD ( 13.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 261b46841b9f6..df0683bd663b5 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -360,9 +360,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