Skip to content

Commit 1db34aa

Browse files
bagasmedavem330
authored andcommitted
Revert "net: wwan: iosm: enable runtime pm support for 7560"
Runtime power management support breaks Intel LTE modem where dmesg dump showes timeout errors: ``` [ 72.027442] iosm 0000:01:00.0: msg timeout [ 72.531638] iosm 0000:01:00.0: msg timeout [ 73.035414] iosm 0000:01:00.0: msg timeout [ 73.540359] iosm 0000:01:00.0: msg timeout ``` Furthermore, when shutting down with `poweroff` and modem attached, the system rebooted instead of powering down as expected. The modem works again only after power cycling. Revert runtime power management support for IOSM driver as introduced by commit e4f5073 ("net: wwan: iosm: enable runtime pm support for 7560"). Fixes: e4f5073 ("net: wwan: iosm: enable runtime pm support for 7560") Reported-by: Martin <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217996 Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Bagas Sanjaya <[email protected]> Reviewed-by: Loic Poulain <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1d30162 commit 1db34aa

File tree

6 files changed

+4
-65
lines changed

6 files changed

+4
-65
lines changed

drivers/net/wwan/iosm/iosm_ipc_imem.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
#include <linux/delay.h>
7-
#include <linux/pm_runtime.h>
87

98
#include "iosm_ipc_chnl_cfg.h"
109
#include "iosm_ipc_devlink.h"
@@ -632,11 +631,6 @@ static void ipc_imem_run_state_worker(struct work_struct *instance)
632631
/* Complete all memory stores after setting bit */
633632
smp_mb__after_atomic();
634633

635-
if (ipc_imem->pcie->pci->device == INTEL_CP_DEVICE_7560_ID) {
636-
pm_runtime_mark_last_busy(ipc_imem->dev);
637-
pm_runtime_put_autosuspend(ipc_imem->dev);
638-
}
639-
640634
return;
641635

642636
err_ipc_mux_deinit:
@@ -1240,7 +1234,6 @@ void ipc_imem_cleanup(struct iosm_imem *ipc_imem)
12401234

12411235
/* forward MDM_NOT_READY to listeners */
12421236
ipc_uevent_send(ipc_imem->dev, UEVENT_MDM_NOT_READY);
1243-
pm_runtime_get_sync(ipc_imem->dev);
12441237

12451238
hrtimer_cancel(&ipc_imem->td_alloc_timer);
12461239
hrtimer_cancel(&ipc_imem->tdupdate_timer);
@@ -1426,16 +1419,6 @@ struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id,
14261419

14271420
set_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag);
14281421
}
1429-
1430-
if (!pm_runtime_enabled(ipc_imem->dev))
1431-
pm_runtime_enable(ipc_imem->dev);
1432-
1433-
pm_runtime_set_autosuspend_delay(ipc_imem->dev,
1434-
IPC_MEM_AUTO_SUSPEND_DELAY_MS);
1435-
pm_runtime_use_autosuspend(ipc_imem->dev);
1436-
pm_runtime_allow(ipc_imem->dev);
1437-
pm_runtime_mark_last_busy(ipc_imem->dev);
1438-
14391422
return ipc_imem;
14401423
devlink_channel_fail:
14411424
ipc_devlink_deinit(ipc_imem->ipc_devlink);

drivers/net/wwan/iosm/iosm_ipc_imem.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ struct ipc_chnl_cfg;
103103
#define FULLY_FUNCTIONAL 0
104104
#define IOSM_DEVLINK_INIT 1
105105

106-
#define IPC_MEM_AUTO_SUSPEND_DELAY_MS 5000
107-
108106
/* List of the supported UL/DL pipes. */
109107
enum ipc_mem_pipes {
110108
IPC_MEM_PIPE_0 = 0,

drivers/net/wwan/iosm/iosm_ipc_pcie.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <linux/acpi.h>
77
#include <linux/bitfield.h>
88
#include <linux/module.h>
9-
#include <linux/pm_runtime.h>
109
#include <net/rtnetlink.h>
1110

1211
#include "iosm_ipc_imem.h"
@@ -438,8 +437,7 @@ static int __maybe_unused ipc_pcie_resume_cb(struct device *dev)
438437
return 0;
439438
}
440439

441-
static DEFINE_RUNTIME_DEV_PM_OPS(iosm_ipc_pm, ipc_pcie_suspend_cb,
442-
ipc_pcie_resume_cb, NULL);
440+
static SIMPLE_DEV_PM_OPS(iosm_ipc_pm, ipc_pcie_suspend_cb, ipc_pcie_resume_cb);
443441

444442
static struct pci_driver iosm_ipc_driver = {
445443
.name = KBUILD_MODNAME,

drivers/net/wwan/iosm/iosm_ipc_port.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* Copyright (C) 2020-21 Intel Corporation.
44
*/
55

6-
#include <linux/pm_runtime.h>
7-
86
#include "iosm_ipc_chnl_cfg.h"
97
#include "iosm_ipc_imem_ops.h"
108
#include "iosm_ipc_port.h"
@@ -15,16 +13,12 @@ static int ipc_port_ctrl_start(struct wwan_port *port)
1513
struct iosm_cdev *ipc_port = wwan_port_get_drvdata(port);
1614
int ret = 0;
1715

18-
pm_runtime_get_sync(ipc_port->ipc_imem->dev);
1916
ipc_port->channel = ipc_imem_sys_port_open(ipc_port->ipc_imem,
2017
ipc_port->chl_id,
2118
IPC_HP_CDEV_OPEN);
2219
if (!ipc_port->channel)
2320
ret = -EIO;
2421

25-
pm_runtime_mark_last_busy(ipc_port->ipc_imem->dev);
26-
pm_runtime_put_autosuspend(ipc_port->ipc_imem->dev);
27-
2822
return ret;
2923
}
3024

@@ -33,24 +27,15 @@ static void ipc_port_ctrl_stop(struct wwan_port *port)
3327
{
3428
struct iosm_cdev *ipc_port = wwan_port_get_drvdata(port);
3529

36-
pm_runtime_get_sync(ipc_port->ipc_imem->dev);
3730
ipc_imem_sys_port_close(ipc_port->ipc_imem, ipc_port->channel);
38-
pm_runtime_mark_last_busy(ipc_port->ipc_imem->dev);
39-
pm_runtime_put_autosuspend(ipc_port->ipc_imem->dev);
4031
}
4132

4233
/* transfer control data to modem */
4334
static int ipc_port_ctrl_tx(struct wwan_port *port, struct sk_buff *skb)
4435
{
4536
struct iosm_cdev *ipc_port = wwan_port_get_drvdata(port);
46-
int ret;
4737

48-
pm_runtime_get_sync(ipc_port->ipc_imem->dev);
49-
ret = ipc_imem_sys_cdev_write(ipc_port, skb);
50-
pm_runtime_mark_last_busy(ipc_port->ipc_imem->dev);
51-
pm_runtime_put_autosuspend(ipc_port->ipc_imem->dev);
52-
53-
return ret;
38+
return ipc_imem_sys_cdev_write(ipc_port, skb);
5439
}
5540

5641
static const struct wwan_port_ops ipc_wwan_ctrl_ops = {

drivers/net/wwan/iosm/iosm_ipc_trace.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
* Copyright (C) 2020-2021 Intel Corporation.
44
*/
55

6-
#include <linux/pm_runtime.h>
76
#include <linux/wwan.h>
8-
97
#include "iosm_ipc_trace.h"
108

119
/* sub buffer size and number of sub buffer */
@@ -99,8 +97,6 @@ static ssize_t ipc_trace_ctrl_file_write(struct file *filp,
9997
if (ret)
10098
return ret;
10199

102-
pm_runtime_get_sync(ipc_trace->ipc_imem->dev);
103-
104100
mutex_lock(&ipc_trace->trc_mutex);
105101
if (val == TRACE_ENABLE && ipc_trace->mode != TRACE_ENABLE) {
106102
ipc_trace->channel = ipc_imem_sys_port_open(ipc_trace->ipc_imem,
@@ -121,10 +117,6 @@ static ssize_t ipc_trace_ctrl_file_write(struct file *filp,
121117
ret = count;
122118
unlock:
123119
mutex_unlock(&ipc_trace->trc_mutex);
124-
125-
pm_runtime_mark_last_busy(ipc_trace->ipc_imem->dev);
126-
pm_runtime_put_autosuspend(ipc_trace->ipc_imem->dev);
127-
128120
return ret;
129121
}
130122

drivers/net/wwan/iosm/iosm_ipc_wwan.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <linux/etherdevice.h>
77
#include <linux/if_arp.h>
88
#include <linux/if_link.h>
9-
#include <linux/pm_runtime.h>
109
#include <linux/rtnetlink.h>
1110
#include <linux/wwan.h>
1211
#include <net/pkt_sched.h>
@@ -52,22 +51,19 @@ static int ipc_wwan_link_open(struct net_device *netdev)
5251
struct iosm_netdev_priv *priv = wwan_netdev_drvpriv(netdev);
5352
struct iosm_wwan *ipc_wwan = priv->ipc_wwan;
5453
int if_id = priv->if_id;
55-
int ret = 0;
5654

5755
if (if_id < IP_MUX_SESSION_START ||
5856
if_id >= ARRAY_SIZE(ipc_wwan->sub_netlist))
5957
return -EINVAL;
6058

61-
pm_runtime_get_sync(ipc_wwan->ipc_imem->dev);
6259
/* get channel id */
6360
priv->ch_id = ipc_imem_sys_wwan_open(ipc_wwan->ipc_imem, if_id);
6461

6562
if (priv->ch_id < 0) {
6663
dev_err(ipc_wwan->dev,
6764
"cannot connect wwan0 & id %d to the IPC mem layer",
6865
if_id);
69-
ret = -ENODEV;
70-
goto err_out;
66+
return -ENODEV;
7167
}
7268

7369
/* enable tx path, DL data may follow */
@@ -76,11 +72,7 @@ static int ipc_wwan_link_open(struct net_device *netdev)
7672
dev_dbg(ipc_wwan->dev, "Channel id %d allocated to if_id %d",
7773
priv->ch_id, priv->if_id);
7874

79-
err_out:
80-
pm_runtime_mark_last_busy(ipc_wwan->ipc_imem->dev);
81-
pm_runtime_put_autosuspend(ipc_wwan->ipc_imem->dev);
82-
83-
return ret;
75+
return 0;
8476
}
8577

8678
/* Bring-down the wwan net link */
@@ -90,12 +82,9 @@ static int ipc_wwan_link_stop(struct net_device *netdev)
9082

9183
netif_stop_queue(netdev);
9284

93-
pm_runtime_get_sync(priv->ipc_wwan->ipc_imem->dev);
9485
ipc_imem_sys_wwan_close(priv->ipc_wwan->ipc_imem, priv->if_id,
9586
priv->ch_id);
9687
priv->ch_id = -1;
97-
pm_runtime_mark_last_busy(priv->ipc_wwan->ipc_imem->dev);
98-
pm_runtime_put_autosuspend(priv->ipc_wwan->ipc_imem->dev);
9988

10089
return 0;
10190
}
@@ -117,7 +106,6 @@ static netdev_tx_t ipc_wwan_link_transmit(struct sk_buff *skb,
117106
if_id >= ARRAY_SIZE(ipc_wwan->sub_netlist))
118107
return -EINVAL;
119108

120-
pm_runtime_get(ipc_wwan->ipc_imem->dev);
121109
/* Send the SKB to device for transmission */
122110
ret = ipc_imem_sys_wwan_transmit(ipc_wwan->ipc_imem,
123111
if_id, priv->ch_id, skb);
@@ -131,14 +119,9 @@ static netdev_tx_t ipc_wwan_link_transmit(struct sk_buff *skb,
131119
ret = NETDEV_TX_BUSY;
132120
dev_err(ipc_wwan->dev, "unable to push packets");
133121
} else {
134-
pm_runtime_mark_last_busy(ipc_wwan->ipc_imem->dev);
135-
pm_runtime_put_autosuspend(ipc_wwan->ipc_imem->dev);
136122
goto exit;
137123
}
138124

139-
pm_runtime_mark_last_busy(ipc_wwan->ipc_imem->dev);
140-
pm_runtime_put_autosuspend(ipc_wwan->ipc_imem->dev);
141-
142125
return ret;
143126

144127
exit:

0 commit comments

Comments
 (0)