Skip to content

Commit

Permalink
net: wwan: iosm: fix driver not working with INTEL_IOMMU disabled
Browse files Browse the repository at this point in the history
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: f7af616 ("net: iosm: infrastructure")
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
M Chetan Kumar authored and David S. Miller committed Nov 9, 2022
1 parent d38a648 commit 035e3be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wwan/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ config RPMSG_WWAN_CTRL

config IOSM
tristate "IOSM Driver for Intel M.2 WWAN Device"
depends on INTEL_IOMMU
depends on PCI
select NET_DEVLINK
select RELAY if WWAN_DEBUGFS
help
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/wwan/iosm/iosm_ipc_pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ static int ipc_pcie_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
struct iosm_pcie *ipc_pcie = kzalloc(sizeof(*ipc_pcie), GFP_KERNEL);
int ret;

pr_debug("Probing device 0x%X from the vendor 0x%X", pci_id->device,
pci_id->vendor);
Expand Down Expand Up @@ -291,6 +292,12 @@ static int ipc_pcie_probe(struct pci_dev *pci,
goto pci_enable_fail;
}

ret = dma_set_mask(ipc_pcie->dev, DMA_BIT_MASK(64));
if (ret) {
dev_err(ipc_pcie->dev, "Could not set PCI DMA mask: %d", ret);
return ret;
}

ipc_pcie_config_aspm(ipc_pcie);
dev_dbg(ipc_pcie->dev, "PCIe device enabled.");

Expand Down

0 comments on commit 035e3be

Please sign in to comment.