iommu/amd: Fix deadlock in ppr-handling error path
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 1 Jun 2012 13:20:23 +0000 (15:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Jun 2012 15:36:18 +0000 (00:36 +0900)
commit3e743873ed23bed0ab24ed33a92d960887ccfafa
tree4beacfc5eacba2bdb3034ada87eff3fa4f0a353a
parent98e69566e80c4de231456dbf4e6735ddfeb599db
iommu/amd: Fix deadlock in ppr-handling error path

commit eee53537c476c947bf7faa1c916d2f5a0ae8ec93 upstream.

In the error path of the ppr_notifer it can happen that the
iommu->lock is taken recursivly. This patch fixes the
problem by releasing the iommu->lock before any notifier is
invoked. This also requires to move the erratum workaround
for the ppr-log (interrupt may be faster than data in the log)
one function up.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/amd_iommu.c