From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4250E455162; Sat, 12 Sep 2026 11:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789213176; cv=none; b=KKwRhZGTAF7s9s4fBYAlVG+zyRcDSFAdSLNN255oExsB3Wmx+t7wv/LKFwLlk8ilAVz1z3wUR9MGQvE/nQ61zeoJS80JAKHkxUiqOVUsa7J9qFk9SD8+QxtyH3vSAdGnRnghFt7NjQvhoTu7xInEIGsLSt6OjNBWe4nSxAUzXYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789213176; c=relaxed/simple; bh=nk1wzZRnDX9g/8tsc7CZ1A+kOiOSOTAHSQHEjhIvxKI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X5Z5CIvKOAIDSDd+QbC9fFuTLQiix57ZtrCxdfOBGvg6mVqV1KjAxCn0dU2tK/y4OOn6OE49YWHMHQc4sfAtV48V06l/KvGBaZDnBzOZ5EnB0IV8KYu9ISbUTk3bh42xqm/ij+aBTa8nT1hJ8/n+otu2qQWcfRAh655WRMD+haw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KYutHDIk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KYutHDIk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 715CF1F000FF; Sat, 12 Sep 2026 11:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789213172; bh=OljD3XASuQ8TwivDV98XlG4AElKWwTrVjZZ+hSutLg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KYutHDIkzirPqiNRPo4SUZ67WJ+N84YQyXujlAXQdNf83vM/qMQdFukcp/ycd+YPt 9Mr5K2ZN1NdKcSb56SgiR7XdkWdsykxBH0zQKi8m6HO3UuZd3VNqKUAJNzVRjdx3UJ 3+n9LEnAeiUoXEcH1M2INuloYIeMAi/zigAE7YJ8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ju Nan , Thomas Gleixner , Radu Rendec , Antonio Borneo Subject: [PATCH 6.12 0067/1376] irqchip/stm32mp-exti: Fix the unit of the hwspinlock timeout Date: Sat, 12 Sep 2026 08:41:33 +0200 Message-ID: <20260912065609.052600261@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ju Nan commit d31fbbade43f880b7e59e2b3a72722fe2725d93f upstream. 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; So stm32mp_exti_set_type() asks for a 1 second timeout where the comment next to the macro says it wants 1 millisecond. The semaphore is polled with udelay() from a section that holds chip_data->rlock, a raw_spinlock_t, so preemption stays disabled for the whole wait on every configuration, PREEMPT_RT included. 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: 5257169ade8c ("irqchip/stm32-exti: Use the hwspin_lock_timeout_in_atomic() API") Signed-off-by: Ju Nan Signed-off-by: Thomas Gleixner Reviewed-by: Radu Rendec Reviewed-by: Antonio Borneo Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260821024756.24927-2-junan76@163.com Signed-off-by: Greg Kroah-Hartman --- drivers/irqchip/irq-stm32mp-exti.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/irqchip/irq-stm32mp-exti.c +++ b/drivers/irqchip/irq-stm32mp-exti.c @@ -23,7 +23,7 @@ #define IRQS_PER_BANK 32 -#define HWSPNLCK_TIMEOUT 1000 /* usec */ +#define HWSPNLCK_TIMEOUT_MS 1 #define EXTI_EnCIDCFGR(n) (0x180 + (n) * 4) #define EXTI_HWCFGR1 0x3f0 @@ -377,7 +377,7 @@ static int stm32mp_exti_set_type(struct raw_spin_lock(&chip_data->rlock); if (hwlock) { - err = hwspin_lock_timeout_in_atomic(hwlock, HWSPNLCK_TIMEOUT); + err = hwspin_lock_timeout_in_atomic(hwlock, HWSPNLCK_TIMEOUT_MS); if (err) { pr_err("%s can't get hwspinlock (%d)\n", __func__, err); goto unlock;