[PATCH] iommu/amd: Remove redundant WARN_ON()

2018-07-20 Thread Anna-Maria Gleixner
callers acquire another lock which already disables interrupts. Signed-off-by: Anna-Maria Gleixner --- drivers/iommu/amd_iommu.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 596b95c50051..b5f39bffd684 100644 ---

[PATCH v2 0/4] iommu/amd: avoid irqs_disabled() check

2018-05-07 Thread Anna-Maria Gleixner
Primary motivation was to get rid of the "WARN_ON(!irqs_disabled());" check. The second patch avoids a possible loop (if cleanup_domain() is invoked `entry->domain == NULL' then it loops for ever). The irqs_disabled() check has been replaced with a lockdep_assert_held() check. v1..v2: - Fix the

[PATCH v2 4/4] iommu/amd: Do not flush when device is busy

2018-05-07 Thread Anna-Maria Gleixner
When device is already attached to a domain, there is no need to execute the domain_flush_tlb_pde(). Therefore move the check if the domain is set into attach_device(). Signed-off-by: Anna-Maria Gleixner <anna-ma...@linutronix.de> --- drivers/iommu/amd_iommu.

[PATCH v2 3/4] iommu/amd: Cleanup locking in __attach/detach_device()

2018-05-07 Thread Anna-Maria Gleixner
here appropriate. Signed-off-by: Anna-Maria Gleixner <anna-ma...@linutronix.de> --- drivers/iommu/amd_iommu.c | 70 ++- 1 file changed, 15 insertions(+), 55 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index a632cc2daad

[PATCH v2 2/4] iommu/amd: Prevent possible null pointer dereference and infinite loop

2018-05-07 Thread Anna-Maria Gleixner
o the caller detach_device() and return immediately. Throw an error, when hitting the condition in cleanup_domain(). Signed-off-by: Anna-Maria Gleixner <anna-ma...@linutronix.de> --- drivers/iommu/amd_iommu.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --g

[PATCH v2 1/4] iommu/amd: Fix grammar of comments

2018-05-07 Thread Anna-Maria Gleixner
Suggested-by: Gary R Hook <gary.h...@amd.com> Signed-off-by: Anna-Maria Gleixner <anna-ma...@linutronix.de> --- drivers/iommu/amd_iommu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index

Re: [PATCH 3/3] iommu/amd: Do not flush when device is busy

2018-05-07 Thread Anna-Maria Gleixner
On Fri, 4 May 2018, Gary R Hook wrote: > On 05/04/2018 11:22 AM, Sebastian Andrzej Siewior wrote: > > From: Anna-Maria Gleixner <anna-ma...@linutronix.de> > > > > When device is already attached to a domain, there is no need to execute > > the domain_flush_tl