Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: wwan: iosm: fix driver not working with INTEL_IOMMU disabled

With INTEL_IOMMU disable config or by forcing intel_iommu=off from
grub some of the features of IOSM driver like browsing, flashing &
coredump collection is not working.

When driver calls DMA API - dma_map_single() for tx transfers. It is
resulting in dma mapping error.

Set the device DMA addressing capabilities using dma_set_mask() and
remove the INTEL_IOMMU dependency in kconfig so that driver follows
the platform config either INTEL_IOMMU enable or disable.

Fixes: f7af616c632e ("net: iosm: infrastructure")
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

M Chetan Kumar and committed by
David S. Miller
035e3bef d38a648d

+8 -1
+1 -1
drivers/net/wwan/Kconfig
··· 94 94 95 95 config IOSM 96 96 tristate "IOSM Driver for Intel M.2 WWAN Device" 97 - depends on INTEL_IOMMU 97 + depends on PCI 98 98 select NET_DEVLINK 99 99 select RELAY if WWAN_DEBUGFS 100 100 help
+7
drivers/net/wwan/iosm/iosm_ipc_pcie.c
··· 259 259 const struct pci_device_id *pci_id) 260 260 { 261 261 struct iosm_pcie *ipc_pcie = kzalloc(sizeof(*ipc_pcie), GFP_KERNEL); 262 + int ret; 262 263 263 264 pr_debug("Probing device 0x%X from the vendor 0x%X", pci_id->device, 264 265 pci_id->vendor); ··· 290 289 * ipc_imem_mount() 291 290 */ 292 291 goto pci_enable_fail; 292 + } 293 + 294 + ret = dma_set_mask(ipc_pcie->dev, DMA_BIT_MASK(64)); 295 + if (ret) { 296 + dev_err(ipc_pcie->dev, "Could not set PCI DMA mask: %d", ret); 297 + return ret; 293 298 } 294 299 295 300 ipc_pcie_config_aspm(ipc_pcie);