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=1796385107; b=0M1RjCViRusyXDoaCu51Fvy8UJSHvpfxFoiKCvkWCveq7QDomfDAW4rsCJGi0h409VpC jD16yLLQEl81FADSygYB6RcQVPfsIUf4i9PFixa9nhCcXdWPFIqaniacPeAuzlPU9QDW+ WISj1f9QWE/jG4MBdkVQhzJDEQ5WmIH5V4QRRQ6cx5G+LI+v3OZA3E6Nd3jUlJoV4nYYB Ns3D/b2835wLnIveGri9n0skYvxkeFsvf5tymCV0bPvfAKP2osPRmSkgYqIa3npcwV+1Z c0K3BW+QJ9yXkCW1PF1npqctEkWEDDCqALegrPRvcBkh0DGT6saY84gxH6aIW2cmcaA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385107; 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=uCVorWFFz2fQysKQxpHFuUfVXtH2sSDgOEmdJIqHVno=; b=3/h4aeA5MxGt814LObIBn7aXbvbJbxx/GuMcUlWQvarbtAMidbBjE2GoiE5JY3WukNPu GE0CFdl2x4ZWJc8OzQH61KuUg6hJwczqPwdtVnnZgJwzAGDjd7eg+SoZiA/AwVJzyr06M 9BMK9pVziiye5GN7EGO70OnI27KWNRM0thLkLoEM9ZvxmsRAPVJX5LRjZ9d3EOkDZ9kj8 kiGIhkUUUFZKFvfTt7sWdci6x6W5jtiO8cU+Y0J5HfHIW6f8xL1LO+91e8SVb/wvm8vkW MarGA9bYt+fZ3j/+dafHLpDqDXKJVIsv1hOiuwLzUZK+BBxBxRd47Rs8/QAKH/Gs3WA== 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=gDz70d82; 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 DE776606A32F; Fri, 4 Dec 2026 11:51:47 +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=gDz70d82 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AA3B1F00936; Fri, 4 Dec 2026 11:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385107; bh=uCVorWFFz2fQysKQxpHFuUfVXtH2sSDgOEmdJIqHVno=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gDz70d82NN/EmMjPOmthaq1+XVjuKIBLLzjYwXIdx0QgXR0YBRPv0TIoVHMZJHzNn 9RyuAjPgJIbIGthrPRQHsdASkY69mHm3goyMXVw31M4vo57l/Bc3lGSbah/GYtgntL 7yQwikuG7N5dQP5ZgNe+L7YDH318ISO2gJb4mhg0= 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.6 0422/1167] pinctrl: stm32: Fix the unit of the hwspinlock timeout Date: Fri, 4 Dec 2026 18:57:29 +0900 Message-ID: <20261204100713.011645172@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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: adapted to the older file layout; only the call sites present in this version are updated. ] 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 170f0aa0d5381..218cf188d5982 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -68,7 +68,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", @@ -447,7 +447,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; @@ -783,7 +783,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; @@ -915,7 +915,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; @@ -966,7 +966,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; @@ -1017,7 +1017,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