aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/efx.c18
-rw-r--r--drivers/net/sfc/workarounds.h2
2 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index b8bd936374f2..d890679e4c4d 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1054,6 +1054,7 @@ static int efx_init_io(struct efx_nic *efx)
1054{ 1054{
1055 struct pci_dev *pci_dev = efx->pci_dev; 1055 struct pci_dev *pci_dev = efx->pci_dev;
1056 dma_addr_t dma_mask = efx->type->max_dma_mask; 1056 dma_addr_t dma_mask = efx->type->max_dma_mask;
1057 bool use_wc;
1057 int rc; 1058 int rc;
1058 1059
1059 netif_dbg(efx, probe, efx->net_dev, "initialising I/O\n"); 1060 netif_dbg(efx, probe, efx->net_dev, "initialising I/O\n");
@@ -1104,8 +1105,21 @@ static int efx_init_io(struct efx_nic *efx)
1104 rc = -EIO; 1105 rc = -EIO;
1105 goto fail3; 1106 goto fail3;
1106 } 1107 }
1107 efx->membase = ioremap_wc(efx->membase_phys, 1108
1108 efx->type->mem_map_size); 1109 /* bug22643: If SR-IOV is enabled then tx push over a write combined
1110 * mapping is unsafe. We need to disable write combining in this case.
1111 * MSI is unsupported when SR-IOV is enabled, and the firmware will
1112 * have removed the MSI capability. So write combining is safe if
1113 * there is an MSI capability.
1114 */
1115 use_wc = (!EFX_WORKAROUND_22643(efx) ||
1116 pci_find_capability(pci_dev, PCI_CAP_ID_MSI));
1117 if (use_wc)
1118 efx->membase = ioremap_wc(efx->membase_phys,
1119 efx->type->mem_map_size);
1120 else
1121 efx->membase = ioremap_nocache(efx->membase_phys,
1122 efx->type->mem_map_size);
1109 if (!efx->membase) { 1123 if (!efx->membase) {
1110 netif_err(efx, probe, efx->net_dev, 1124 netif_err(efx, probe, efx->net_dev,
1111 "could not map memory BAR at %llx+%x\n", 1125 "could not map memory BAR at %llx+%x\n",
diff --git a/drivers/net/sfc/workarounds.h b/drivers/net/sfc/workarounds.h
index e4dd3a7f304b..99ff11400cef 100644
--- a/drivers/net/sfc/workarounds.h
+++ b/drivers/net/sfc/workarounds.h
@@ -38,6 +38,8 @@
38#define EFX_WORKAROUND_15783 EFX_WORKAROUND_ALWAYS 38#define EFX_WORKAROUND_15783 EFX_WORKAROUND_ALWAYS
39/* Legacy interrupt storm when interrupt fifo fills */ 39/* Legacy interrupt storm when interrupt fifo fills */
40#define EFX_WORKAROUND_17213 EFX_WORKAROUND_SIENA 40#define EFX_WORKAROUND_17213 EFX_WORKAROUND_SIENA
41/* Write combining and sriov=enabled are incompatible */
42#define EFX_WORKAROUND_22643 EFX_WORKAROUND_SIENA
41 43
42/* Spurious parity errors in TSORT buffers */ 44/* Spurious parity errors in TSORT buffers */
43#define EFX_WORKAROUND_5129 EFX_WORKAROUND_FALCON_A 45#define EFX_WORKAROUND_5129 EFX_WORKAROUND_FALCON_A