Commit 228c4f5cfbf1cda411d9aa7204a612a63c89b1e8

Authored by Dan Williams
1 parent e22dde9904

ioat3: dca and raid operations are incompatible

RAID operations cause a system hang on platforms with DCA
(Direct-Cache-Access) enabled.  So turn off RAID capabilities in this
case.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Showing 3 changed files with 9 additions and 1 deletions Side-by-side Diff

drivers/dma/ioat/dca.c
... ... @@ -103,7 +103,7 @@
103 103 return res;
104 104 }
105 105  
106   -static int system_has_dca_enabled(struct pci_dev *pdev)
  106 +int system_has_dca_enabled(struct pci_dev *pdev)
107 107 {
108 108 if (boot_cpu_has(X86_FEATURE_DCA))
109 109 return dca_enabled_in_bios(pdev);
drivers/dma/ioat/dma_v3.c
... ... @@ -1117,6 +1117,7 @@
1117 1117 int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca)
1118 1118 {
1119 1119 struct pci_dev *pdev = device->pdev;
  1120 + int dca_en = system_has_dca_enabled(pdev);
1120 1121 struct dma_device *dma;
1121 1122 struct dma_chan *c;
1122 1123 struct ioat_chan_common *chan;
... ... @@ -1137,6 +1138,11 @@
1137 1138 dma->device_prep_dma_interrupt = ioat3_prep_interrupt_lock;
1138 1139  
1139 1140 cap = readl(device->reg_base + IOAT_DMA_CAP_OFFSET);
  1141 +
  1142 + /* dca is incompatible with raid operations */
  1143 + if (dca_en && (cap & (IOAT_CAP_XOR|IOAT_CAP_PQ)))
  1144 + cap &= ~(IOAT_CAP_XOR|IOAT_CAP_PQ);
  1145 +
1140 1146 if (cap & IOAT_CAP_XOR) {
1141 1147 is_raid_device = true;
1142 1148 dma->max_xor = 8;
drivers/dma/ioat/hw.h
... ... @@ -39,6 +39,8 @@
39 39 #define IOAT_VER_3_0 0x30 /* Version 3.0 */
40 40 #define IOAT_VER_3_2 0x32 /* Version 3.2 */
41 41  
  42 +int system_has_dca_enabled(struct pci_dev *pdev);
  43 +
42 44 struct ioat_dma_descriptor {
43 45 uint32_t size;
44 46 union {