OSDN Git Service

net: wwan: t7xx: Ensure init is completed before system sleep
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Wed, 17 May 2023 05:24:51 +0000 (13:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 May 2023 12:02:25 +0000 (13:02 +0100)
commitab87603b251134441a67385ecc9d3371be17b7a7
tree14ae551d4c7f163a927e0419b3bcb84d8c9f4414
parent9ba9485b87ac97fd159abdb4cbd53099bc9f01c6
net: wwan: t7xx: Ensure init is completed before system sleep

When the system attempts to sleep while mtk_t7xx is not ready, the driver
cannot put the device to sleep:
[   12.472918] mtk_t7xx 0000:57:00.0: [PM] Exiting suspend, modem in invalid state
[   12.472936] mtk_t7xx 0000:57:00.0: PM: pci_pm_suspend(): t7xx_pci_pm_suspend+0x0/0x20 [mtk_t7xx] returns -14
[   12.473678] mtk_t7xx 0000:57:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x1b0 returns -14
[   12.473711] mtk_t7xx 0000:57:00.0: PM: failed to suspend async: error -14
[   12.764776] PM: Some devices failed to suspend, or early wake event detected

Mediatek confirmed the device can take a rather long time to complete
its initialization, so wait for up to 20 seconds until init is done.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wwan/t7xx/t7xx_pci.c
drivers/net/wwan/t7xx/t7xx_pci.h