Re: [PATCH 1/1] pci/quirks: fix a dmar fault for intel 82599 card

From: Li, ZhenHua
Date: Tue Sep 30 2014 - 02:16:31 EST

Add Joerg to CC list. For it is also related to iommu module.

There was a try for this dmar fault,

This patch is trying to fix the same thing.

On 09/30/2014 02:09 PM, Li, Zhen-Hua wrote:
On a HP system with Intel Corporation 82599 ethernet adapter, when kernel
crashed and the kdump kernel boots with intel_iommu=on, there may be some
unexpected DMA requests on this adapter, which will cause DMA Remapping
faults like:
dmar: DRHD: handling fault status reg 102
dmar: DMAR:[DMA Read] Request device [41:00.0] fault addr fff81000
DMAR:[fault reason 01] Present bit in root entry is clear

Analysis for this bug:

The present bit is set in this function:

static struct context_entry * device_to_context_entry(
struct intel_iommu *iommu, u8 bus, u8 devfn)

Calling tree:

This means, the present bit in root entry will not be set until the device
driver is loaded.

But in the kdump kernel, some hardware device does not know the OS is the
second kernel and the drivers should be loaded again, this causes there are
some unexpected DMA requsts on this device when it has not been initialized,
and then the DMA Remapping errors come.

To fix this DMAR fault, we need to reset the bus that this device on. Reset
the device itself does not work.

There also was a discussion:

Signed-off-by: Li, Zhen-Hua <zhen-hual@xxxxxx>
drivers/pci/quirks.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 80c2d01..5198af3 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -25,6 +25,7 @@
#include <linux/sched.h>
#include <linux/ktime.h>
#include <asm/dma.h> /* isa_dma_bridge_buggy */
+#include <linux/crash_dump.h>
#include "pci.h"

@@ -3832,3 +3833,13 @@ void pci_dev_specific_enable_acs(struct pci_dev *dev)
+void quirk_reset_buggy_devices(struct pci_dev *dev)
+ if (unlikely(is_kdump_kernel()))
+ pci_try_reset_bus(dev->bus);
+ PCI_CLASS_NETWORK_ETHERNET, 8, quirk_reset_buggy_devices);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at