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=1796387905; b=Am5f1TR+kz3xu8vjviv6fD71qh5AGIBEE5k+1EhV+c4EJY+MXDuNAWrYOBguzqlUw+Pm dPljUKbaxwUHr6PV3JvvtA+WfwV588MB+QrjCeOuHcZmN+eObxgfXl76XyQoZUiZUtxtY 86EWaPMJyDUpzuKxZxkyHEaTzsWKohPGKJtxXuPVtoqkybw4nPTZeexmN1mXq88x/jbUC t2fIQdCrUetvdeapVD60CoiZ/MTp5l7sl9pNOWJkeXljI2RqZE4De3tcLyIcg2gBmYAzZ BVdyxXkQb6nyEL8A7fG+SuqbCFNlPg0pBxjmLBtDoj75jz+VzQKyUloMLoqzuk15ytg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387905; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=UesQxHsizG+nc25Jbxzgty6H54G3eBt3nF5v05oV54c=; b=mYxIzQqK0qi65evS6bQIYto9StRQjgMSD4OHOzf9H6CzLOIH+tQg2fv8tEg+UaLyt8VZ EHEAY5Q76Xr95+p42VGpBBoBe2sGyuLEsWRUG2LElzAD3Xe2+diko8rlCBd0/BNYsLYkQ SPGiBWcUjkUHtOTleR07Ou867QbIsdMXYfRP0QYLbKW8YNhxrR+7pNbCF0JE32dnN5ZHF SPGn+4c/fGVx13av94pUy154fW50Z7sUSgvMhMvfaZFuUm+Hb0Vv6s4cMM5mbr56Evkug v91j1nPHZZiK5Fqlp7W8PvfZ7weKIuDUX8wYjYWUAMAAeuWOvaDLeRHa4RqThMDAzYw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=QgP48Q1F; 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 AFA98606A322; Fri, 4 Dec 2026 12:38:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=QgP48Q1F Received: by smtp.kernel.org (Postfix) with ESMTPSA id 263F61F000C2; Fri, 4 Dec 2026 12:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387905; bh=UesQxHsizG+nc25Jbxzgty6H54G3eBt3nF5v05oV54c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QgP48Q1FtIqrjMWpPYRRyi9b0b5J6EAhvelB+gL5cCCALIDmbJB9xYSPMLcRpk6cr gShEZS6K8NaCsSb4d3BexvJHKZjozMgYiRHzcUcNv2w5Gclo6KBgOG+eOxGh/Cb5nh fP3Awkh+iT1quCX+l+f/2NT7CWckidF75mGsQn74= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ju Nan , Linus Walleij , Sasha Levin Subject: [PATCH 6.1 0404/1059] pinctrl: stm32: Fix the unit of the hwspinlock timeout Date: Fri, 4 Dec 2026 18:58:55 +0900 Message-ID: <20261204100654.800613175@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ju Nan [ Upstream commit 544b3f8042dd7c18baa48dcb1a393ff8b6742322 ] HWSPNLCK_TIMEOUT is passed to hwspin_lock_timeout_in_atomic(), whose timeout argument is in milliseconds, not microseconds: atomic_delay += HWSPINLOCK_RETRY_DELAY_US; if (atomic_delay > to * 1000) return -ETIMEDOUT; The hwspinlock core documents this explicitly: If the mode is HWLOCK_IN_ATOMIC (called from an atomic context) the timeout is handled with busy-waiting delays, hence shall not exceed few msecs. Fixes: 290a9f937e5a ("pinctrl: stm32: use the hwspin_lock_timeout_in_atomic() API") Signed-off-by: Ju Nan Signed-off-by: Linus Walleij [ sashal: Dropped the two hunks for functions absent from this tree and renamed only the five existing HWSPNLCK_TIMEOUT call sites to the new millisecond define. ] Signed-off-by: Sasha Levin --- drivers/pinctrl/stm32/pinctrl-stm32.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c index 635bfcdc91423..ba4fd04a4b015 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -66,7 +66,7 @@ #define gpio_range_to_bank(chip) \ container_of(chip, struct stm32_gpio_bank, range) -#define HWSPNLCK_TIMEOUT 1000 /* usec */ +#define HWSPNLCK_TIMEOUT_MS 1 static const char * const stm32_gpio_functions[] = { "gpio", "af0", "af1", @@ -443,7 +443,7 @@ static int stm32_gpio_domain_activate(struct irq_domain *d, if (pctl->hwlock) { ret = hwspin_lock_timeout_in_atomic(pctl->hwlock, - HWSPNLCK_TIMEOUT); + HWSPNLCK_TIMEOUT_MS); if (ret) { dev_err(pctl->dev, "Can't get hwspinlock\n"); return ret; @@ -779,7 +779,7 @@ static int stm32_pmx_set_mode(struct stm32_gpio_bank *bank, if (pctl->hwlock) { err = hwspin_lock_timeout_in_atomic(pctl->hwlock, - HWSPNLCK_TIMEOUT); + HWSPNLCK_TIMEOUT_MS); if (err) { dev_err(pctl->dev, "Can't get hwspinlock\n"); goto unlock; @@ -912,7 +912,7 @@ static int stm32_pconf_set_driving(struct stm32_gpio_bank *bank, if (pctl->hwlock) { err = hwspin_lock_timeout_in_atomic(pctl->hwlock, - HWSPNLCK_TIMEOUT); + HWSPNLCK_TIMEOUT_MS); if (err) { dev_err(pctl->dev, "Can't get hwspinlock\n"); goto unlock; @@ -963,7 +963,7 @@ static int stm32_pconf_set_speed(struct stm32_gpio_bank *bank, if (pctl->hwlock) { err = hwspin_lock_timeout_in_atomic(pctl->hwlock, - HWSPNLCK_TIMEOUT); + HWSPNLCK_TIMEOUT_MS); if (err) { dev_err(pctl->dev, "Can't get hwspinlock\n"); goto unlock; @@ -1014,7 +1014,7 @@ static int stm32_pconf_set_bias(struct stm32_gpio_bank *bank, if (pctl->hwlock) { err = hwspin_lock_timeout_in_atomic(pctl->hwlock, - HWSPNLCK_TIMEOUT); + HWSPNLCK_TIMEOUT_MS); if (err) { dev_err(pctl->dev, "Can't get hwspinlock\n"); goto unlock; -- 2.53.0