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 34D623CDBB5; Sat, 12 Sep 2026 16:30:04 +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=1789230607; cv=none; b=T6Turq11FiJ3iaHeA4OFR4nABgdywqQ5jsuFm6pAM8ARvqfOWfT4F4wrRltHAhib0NMGwWwzQKBqoN4JxapA1I4o5dlOD/RmWy58jZiBTfJy8/qX3xzFD3eJYNYkMeQ66Mpzr8sEvgl21yDUnxggtICbWOXYqM4NAWCwjpVN7/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789230607; c=relaxed/simple; bh=N1NRgTWtFskIXbHeF8w3+PHKASIDN9Rw5lq2KZkanr0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LXMy7L5De8CwhQkEN2NxGgmRu2c5mDr9/E99lwmT5N/pareWNeBKCPl7rpTsUHnwrbSB1YGaywilljMIawyTWaJ6Kmx0uUJi+k9VuFOo41WMudDLR2oHLz3UFmFjoAQ4+AZWSfQhhzTngb8GDkkOP+KkxT5KKcoEv/xwhSWSubI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ez5WUXSD; 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="ez5WUXSD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4EB31F00893; Sat, 12 Sep 2026 16:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789230604; bh=Whnj/lWJDTvtD1A1grgRH8ttlCxVmXy38PCkCC4SURk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ez5WUXSDrh1T85U4rBMrLL1xVg4ZYVcAWOezpisl4Cuu+A8bLWHtw6ITmbMIfFY+9 I+x3jRPqK7E9smZLejzMmvV+KB0MBy39bEw57B/oTJ+44+e4WnNdMOnhMzqV6qzBnD NdOT4aQ9844vzWf5EAUTjGTd9+aVilkDC9hUWWUQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Pranjal Shrivastava , Will Deacon , Sasha Levin Subject: [PATCH 6.1 0826/1191] iommu/arm-smmu-v3: Convert to use atomic poll timeout Date: Sat, 12 Sep 2026 08:59:14 +0200 Message-ID: <20260912065606.818910449@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065548.086904252@linuxfoundation.org> References: <20260912065548.086904252@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pranjal Shrivastava [ Upstream commit eced8058c82a3a81ae480a6546e2da32100dddfa ] The arm_smmu_write_reg_sync() helper is currently implemented using readl_relaxed_poll_timeout() (that relies on usleep_range() internally) which becomes a critical issue when used in the gerror irq handler. If the SMMU hits a gerror and enters Service Failure Mode (GERROR_SFM_ERR), the gerror handler calls arm_smmu_device_disable() in hard-irq context. This becomes a problem as arm_smmu_device_disable() inevitably calls arm_smmu_write_reg_sync() which might attempt to sleep inside a hard-irq context. Fix this by converting the arm_smmu_write_reg_sync to use the readl_relaxed_poll_timeout_atomic() polling helper. (Discovered while running Sashiko locally on another patch series). Reported-by: Sashiko Fixes: 48ec83bcbcf5 ("iommu/arm-smmu: Add initial driver support for ARM SMMUv3 devices") Signed-off-by: Pranjal Shrivastava Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index eba2b2e2da0b9..33f3c5e6b3320 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3134,8 +3134,9 @@ static int arm_smmu_write_reg_sync(struct arm_smmu_device *smmu, u32 val, u32 reg; writel_relaxed(val, smmu->base + reg_off); - return readl_relaxed_poll_timeout(smmu->base + ack_off, reg, reg == val, - 1, ARM_SMMU_POLL_TIMEOUT_US); + return readl_relaxed_poll_timeout_atomic(smmu->base + ack_off, reg, + reg == val, 1, + ARM_SMMU_POLL_TIMEOUT_US); } /* GBPA is "special" */ -- 2.53.0