aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna-Maria Gleixner <anna-maria@linutronix.de>2018-07-20 04:45:45 -0400
committerJoerg Roedel <jroedel@suse.de>2018-07-20 08:36:19 -0400
commitf1a066fcc9725960a73c00267afe7e346cc9fc6f (patch)
treea8ba305f274d84549de250e374cee3b3c9df5c4d
parent90fcffd9cf5e7cc593169f529799f3e3c5437e75 (diff)
iommu/amd: Remove redundant WARN_ON()
The WARN_ON() was introduced in commit 272e4f99e966 ("iommu/amd: WARN when __[attach|detach]_device are called with irqs enabled") to ensure that the domain->lock is taken in proper irqs disabled context. This is required, because the domain->lock is taken as well in irq context. The proper context check by the WARN_ON() is redundant, because it is already covered by LOCKDEP. When working with locks and changing context, a run with LOCKDEP is required anyway and would detect the wrong lock context. Furthermore all callers for those functions are within the same file and all callers acquire another lock which already disables interrupts. Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--drivers/iommu/amd_iommu.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 64cfe854e0f5..8aaefee98d74 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1946,12 +1946,6 @@ static int __attach_device(struct iommu_dev_data *dev_data,
1946{ 1946{
1947 int ret; 1947 int ret;
1948 1948
1949 /*
1950 * Must be called with IRQs disabled. Warn here to detect early
1951 * when its not.
1952 */
1953 WARN_ON(!irqs_disabled());
1954
1955 /* lock domain */ 1949 /* lock domain */
1956 spin_lock(&domain->lock); 1950 spin_lock(&domain->lock);
1957 1951
@@ -2117,12 +2111,6 @@ static void __detach_device(struct iommu_dev_data *dev_data)
2117{ 2111{
2118 struct protection_domain *domain; 2112 struct protection_domain *domain;
2119 2113
2120 /*
2121 * Must be called with IRQs disabled. Warn here to detect early
2122 * when its not.
2123 */
2124 WARN_ON(!irqs_disabled());
2125
2126 domain = dev_data->domain; 2114 domain = dev_data->domain;
2127 2115
2128 spin_lock(&domain->lock); 2116 spin_lock(&domain->lock);