Skip to content

Commit f1a066f

Browse files
anna-marialxjoergroedel
authored andcommitted
iommu/amd: Remove redundant WARN_ON()
The WARN_ON() was introduced in commit 272e4f9 ("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 <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 90fcffd commit f1a066f

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

drivers/iommu/amd_iommu.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,12 +1946,6 @@ static int __attach_device(struct iommu_dev_data *dev_data,
19461946
{
19471947
int ret;
19481948

1949-
/*
1950-
* Must be called with IRQs disabled. Warn here to detect early
1951-
* when its not.
1952-
*/
1953-
WARN_ON(!irqs_disabled());
1954-
19551949
/* lock domain */
19561950
spin_lock(&domain->lock);
19571951

@@ -2117,12 +2111,6 @@ static void __detach_device(struct iommu_dev_data *dev_data)
21172111
{
21182112
struct protection_domain *domain;
21192113

2120-
/*
2121-
* Must be called with IRQs disabled. Warn here to detect early
2122-
* when its not.
2123-
*/
2124-
WARN_ON(!irqs_disabled());
2125-
21262114
domain = dev_data->domain;
21272115

21282116
spin_lock(&domain->lock);

0 commit comments

Comments
 (0)