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 404613446AD; Sat, 12 Sep 2026 12:42:58 +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=1789216979; cv=none; b=HwahjnTIRKycyrXiGkvrGLn8Xe7Tx514fjumrOzkyunJLV6t2xPo7GCIZiUHs+rICjbR0tDiHJD0UxJjkR5bXV/3SCbk6VyLIx7Jbi1RqKW5ApJiv5/eWkf/me8XH97rHuPX2BHa1hozRXjum4/GQ/1z8E/g7j9aH/45WyDA5Q4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789216979; c=relaxed/simple; bh=irjgaGAX3kGkaCsuDX/Z6eK5WUB/fcF/Qla6Hf3y0Tk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KpRGoQZkcYqsmxUSGey+HEhNqTJUPQGsMBb/HHwCYoyp614HakzUrM/aw3laVr9CzaZCip9Rgno24nnJ0o2eRdDNcS6ErfMSvPWEoBUCrrmERRDBcvm+V3atsjWQawD8CmOSzz5mPwTGsm1G7S67Rx9GPds6QvGdEBqTwuv7fgk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hXIokzeb; 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="hXIokzeb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13AA01F000FF; Sat, 12 Sep 2026 12:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789216978; bh=nEPk7nhqxZC6A35MoiXLWz0dktA15FS6Qmt2/W2lrj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hXIokzeblOG8KbqeyCy/rsV2bltQGpY7OBN/uR7XMnqb/3jt5kSYV6E0N+Ex7bps4 MozoQ+QBtIbIrnovRSHZk4cRueQL+yG8ecuvPyuEHfmfla1sIxK2RrWXdMt8/D/1nF 6jXCvO92gHbaiKJbCaPdR8oSQ5AsArTpIzNY/9xU= 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.12 0848/1376] iommu/arm-smmu-v3: Convert to use atomic poll timeout Date: Sat, 12 Sep 2026 08:54:34 +0200 Message-ID: <20260912065626.452414615@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: 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 0a8a6cf1f0330..28331d9118b63 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3774,8 +3774,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