lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <CAAd53p44LFmZowFjRFaNV3fFUbMp2zxJksnCTR-MyhNJYfTeJw@mail.gmail.com> Date: Wed, 17 May 2023 12:28:16 +0800 From: Kai-Heng Feng <kai.heng.feng@...onical.com> To: Piotr Raczynski <piotr.raczynski@...el.com> Cc: chandrashekar.devegowda@...el.com, linuxwwan@...el.com, chiranjeevi.rapolu@...ux.intel.com, haijun.liu@...iatek.com, m.chetan.kumar@...ux.intel.com, ricardo.martinez@...ux.intel.com, Loic Poulain <loic.poulain@...aro.org>, Sergey Ryazanov <ryazanov.s.a@...il.com>, Johannes Berg <johannes@...solutions.net>, "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH] net: wwan: t7xx: Ensure init is completed before system sleep On Tue, May 16, 2023 at 6:42 PM Piotr Raczynski <piotr.raczynski@...el.com> wrote: > > On Tue, May 16, 2023 at 04:03:27PM +0800, Kai-Heng Feng wrote: > > 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@...onical.com> > > Does it fix any issue? Anyway target tree would help here I guess. It fixes "PM: failed to suspend async: error -14" mentioned in the commit message. > > [...] > > > +static int t7xx_pci_pm_prepare(struct device *dev) > > +{ > > + struct pci_dev *pdev = to_pci_dev(dev); > > + struct t7xx_pci_dev *t7xx_dev; > > + > > + t7xx_dev = pci_get_drvdata(pdev); > > + if (!wait_for_completion_timeout(&t7xx_dev->init_done, 20 * HZ)) > > #define T7XX_INIT_TIMEOUT or something similar wouldn't do any harm here. Sure, will do in next revision. > > > + dev_warn(dev, "Not ready for system sleep.\n"); > > + > > + return 0; > > So in case of a timeout you still return 0, is that OK? You are right, error code should be returned instead. Kai-Heng > > [...] > Thanks, Piotr.
Powered by blists - more mailing lists