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 631D6426D03; Sat, 12 Sep 2026 10:36:35 +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=1789209396; cv=none; b=ZdZCfGUug7eoTivlQtGYctOt1KEHq3BDH+UMpl9Mo79Q9rlLBDKdu7wj60OLyeFlbF391Kh3qxkxYQDzja91DWWyMpsB6YttTmUKTg3108lN2qHhqYJlUS8yEX1TxuNXOjw3Q2f4NUFInoP0IRsEo4aYoy+fNGc2bccxJPCjhcU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789209396; c=relaxed/simple; bh=qM6uhT0avmo+47YGfzs2ePZE17RyNjYp5Cx826/krZo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZeVQlCDzeHBKnzPcKO8RbOAu8Oe7TfZCJ+xnm2t4AuqRrtiDpaH5rSg+dFfIsh9Uz+gza48je4ADxtUsHa3a7doQ/1hW83Utm/tH01vnwjrf5LR/VN6S7z8MExgJ9PfEtoyf2GzRhEY1T9uezuF/tUBWQ/gP8D9L8XqobfsiSoA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qzOBbMXf; 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="qzOBbMXf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 342651F000FF; Sat, 12 Sep 2026 10:36:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789209395; bh=BEDvDljs//wLc1rx/VF3SKnrV3OEZOQyNgRqadAqO8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qzOBbMXfKJFm9jYPp8k93nTP5LClVmKl8m9+ByNQ1qXc0hoSPJcHAxMwKCc/SrjOE PH4ShyEbE8m8MBD81TUHZeloOOSdBlyy/AsGyJHA/4NaJ7XRYWMwaOsfmrPxW5Q046 3/xgsKlCqYIftSUgJ0uxvT0e2gMeKzITuma8jXX4= 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.18 0811/1518] iommu/arm-smmu-v3: Convert to use atomic poll timeout Date: Sat, 12 Sep 2026 08:49:40 +0200 Message-ID: <20260912065641.782841080@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@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.18-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 d645f7edbd107..b677390e95bb9 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3992,8 +3992,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