Skip to content

Commit 5d04158

Browse files
committed
Merge branch 'wwan-iosm-fixes'
M Chetan Kumar says: ==================== net: wwan: iosm: fixes This patch series contains iosm fixes. PATCH1: Fix memory leak in ipc_pcie_read_bios_cfg. PATCH2: Fix driver not working with INTEL_IOMMU disabled config. PATCH3: Fix invalid mux header type. PATCH4: Fix kernel build robot reported errors. Please refer to individual commit message for details. -- v2: * PATCH1: No Change * PATCH2: Kconfig change - Add dependency on PCI to resolve kernel build robot errors. * PATCH3: No Change * PATCH4: New (Fix kernel build robot errors) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 742c60e + 980ec04 commit 5d04158

6 files changed

Lines changed: 27 additions & 4 deletions

File tree

drivers/net/wwan/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ config RPMSG_WWAN_CTRL
9494

9595
config IOSM
9696
tristate "IOSM Driver for Intel M.2 WWAN Device"
97-
depends on INTEL_IOMMU
97+
depends on PCI
9898
select NET_DEVLINK
9999
select RELAY if WWAN_DEBUGFS
100100
help

drivers/net/wwan/iosm/iosm_ipc_coredump.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* Copyright (C) 2020-2021 Intel Corporation.
44
*/
5+
#include <linux/vmalloc.h>
56

67
#include "iosm_ipc_coredump.h"
78

drivers/net/wwan/iosm/iosm_ipc_devlink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* Copyright (C) 2020-2021 Intel Corporation.
44
*/
5+
#include <linux/vmalloc.h>
56

67
#include "iosm_ipc_chnl_cfg.h"
78
#include "iosm_ipc_coredump.h"

drivers/net/wwan/iosm/iosm_ipc_imem_ops.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ void ipc_imem_wwan_channel_init(struct iosm_imem *ipc_imem,
9191
}
9292

9393
ipc_chnl_cfg_get(&chnl_cfg, ipc_imem->nr_of_channels);
94+
95+
if (ipc_imem->mmio->mux_protocol == MUX_AGGREGATION &&
96+
ipc_imem->nr_of_channels == IPC_MEM_IP_CHL_ID_0) {
97+
chnl_cfg.ul_nr_of_entries = IPC_MEM_MAX_TDS_MUX_AGGR_UL;
98+
chnl_cfg.dl_nr_of_entries = IPC_MEM_MAX_TDS_MUX_AGGR_DL;
99+
chnl_cfg.dl_buf_size = IPC_MEM_MAX_ADB_BUF_SIZE;
100+
}
101+
94102
ipc_imem_channel_init(ipc_imem, IPC_CTYPE_WWAN, chnl_cfg,
95103
IRQ_MOD_OFF);
96104

drivers/net/wwan/iosm/iosm_ipc_mux.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#define IPC_MEM_MAX_UL_DG_ENTRIES 100
1212
#define IPC_MEM_MAX_TDS_MUX_AGGR_UL 60
13+
#define IPC_MEM_MAX_TDS_MUX_AGGR_DL 60
1314

1415
#define IPC_MEM_MAX_ADB_BUF_SIZE (16 * 1024)
1516
#define IPC_MEM_MAX_UL_ADB_BUF_SIZE IPC_MEM_MAX_ADB_BUF_SIZE

drivers/net/wwan/iosm/iosm_ipc_pcie.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ static void ipc_pcie_config_init(struct iosm_pcie *ipc_pcie)
232232
*/
233233
static enum ipc_pcie_sleep_state ipc_pcie_read_bios_cfg(struct device *dev)
234234
{
235+
enum ipc_pcie_sleep_state sleep_state = IPC_PCIE_D0L12;
235236
union acpi_object *object;
236237
acpi_handle handle_acpi;
237238

@@ -242,18 +243,23 @@ static enum ipc_pcie_sleep_state ipc_pcie_read_bios_cfg(struct device *dev)
242243
}
243244

244245
object = acpi_evaluate_dsm(handle_acpi, &wwan_acpi_guid, 0, 3, NULL);
246+
if (!object)
247+
goto default_ret;
248+
249+
if (object->integer.value == 3)
250+
sleep_state = IPC_PCIE_D3L2;
245251

246-
if (object && object->integer.value == 3)
247-
return IPC_PCIE_D3L2;
252+
kfree(object);
248253

249254
default_ret:
250-
return IPC_PCIE_D0L12;
255+
return sleep_state;
251256
}
252257

253258
static int ipc_pcie_probe(struct pci_dev *pci,
254259
const struct pci_device_id *pci_id)
255260
{
256261
struct iosm_pcie *ipc_pcie = kzalloc(sizeof(*ipc_pcie), GFP_KERNEL);
262+
int ret;
257263

258264
pr_debug("Probing device 0x%X from the vendor 0x%X", pci_id->device,
259265
pci_id->vendor);
@@ -286,6 +292,12 @@ static int ipc_pcie_probe(struct pci_dev *pci,
286292
goto pci_enable_fail;
287293
}
288294

295+
ret = dma_set_mask(ipc_pcie->dev, DMA_BIT_MASK(64));
296+
if (ret) {
297+
dev_err(ipc_pcie->dev, "Could not set PCI DMA mask: %d", ret);
298+
return ret;
299+
}
300+
289301
ipc_pcie_config_aspm(ipc_pcie);
290302
dev_dbg(ipc_pcie->dev, "PCIe device enabled.");
291303

0 commit comments

Comments
 (0)