From: Joerg Roedel Date: Thu, 3 Sep 2009 13:15:10 +0000 (+0200) Subject: x86/amd-iommu: Reset command buffer if wait loop fails X-Git-Tag: master-2009-09-23~82^2^2~2^3 X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=6a1eddd2f951656a6abbd42e2cddc2267c4a639d;p=~andy%2Flinux x86/amd-iommu: Reset command buffer if wait loop fails Instead of a panic on an comletion wait loop failure, try to recover from that event from resetting the command buffer. Signed-off-by: Joerg Roedel --- diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index b62a2f64dfc..cfca80bfe75 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -318,8 +318,11 @@ static void __iommu_wait_for_completion(struct amd_iommu *iommu) status &= ~MMIO_STATUS_COM_WAIT_INT_MASK; writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET); - if (unlikely(i == EXIT_LOOP_COUNT)) - panic("AMD IOMMU: Completion wait loop failed\n"); + if (unlikely(i == EXIT_LOOP_COUNT)) { + spin_unlock(&iommu->lock); + reset_iommu_command_buffer(iommu); + spin_lock(&iommu->lock); + } } /*