Skip to content

Commit 46b7edf

Browse files
tmlindkishon
authored andcommitted
phy: mapphone-mdm6600: Fix write timeouts with shorter GPIO toggle interval
I've noticed that when writing data to the modem the writes can time out at some point eventually. Looks like kicking the modem idle GPIO every 600 ms instead of once a second fixes the issue. Note that this rate is different from our runtime PM autosuspend rate MDM6600_MODEM_IDLE_DELAY_MS that we still want to keep at 1 second, so let's add a separate define for PHY_MDM6600_IDLE_KICK_MS. Fixes: f7f50b2 ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend") Cc: Marcel Partap <[email protected]> Cc: Merlijn Wajer <[email protected]> Cc: Michael Scott <[email protected]> Cc: NeKit <[email protected]> Cc: Pavel Machek <[email protected]> Cc: Sebastian Reichel <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent bb6d3fb commit 46b7edf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/phy/motorola/phy-mapphone-mdm6600.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#define PHY_MDM6600_PHY_DELAY_MS 4000 /* PHY enable 2.2s to 3.5s */
2222
#define PHY_MDM6600_ENABLED_DELAY_MS 8000 /* 8s more total for MDM6600 */
23+
#define PHY_MDM6600_WAKE_KICK_MS 600 /* time on after GPIO toggle */
2324
#define MDM6600_MODEM_IDLE_DELAY_MS 1000 /* modem after USB suspend */
2425
#define MDM6600_MODEM_WAKE_DELAY_MS 200 /* modem response after idle */
2526

@@ -496,8 +497,14 @@ static void phy_mdm6600_modem_wake(struct work_struct *work)
496497

497498
ddata = container_of(work, struct phy_mdm6600, modem_wake_work.work);
498499
phy_mdm6600_wake_modem(ddata);
500+
501+
/*
502+
* The modem does not always stay awake 1.2 seconds after toggling
503+
* the wake GPIO, and sometimes it idles after about some 600 ms
504+
* making writes time out.
505+
*/
499506
schedule_delayed_work(&ddata->modem_wake_work,
500-
msecs_to_jiffies(MDM6600_MODEM_IDLE_DELAY_MS));
507+
msecs_to_jiffies(PHY_MDM6600_WAKE_KICK_MS));
501508
}
502509

503510
static int __maybe_unused phy_mdm6600_runtime_suspend(struct device *dev)

0 commit comments

Comments
 (0)