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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGNeG1O1yS229nPO@nimitz>
Date:   Tue, 16 May 2023 12:42:35 +0200
From:   Piotr Raczynski <piotr.raczynski@...el.com>
To:     Kai-Heng Feng <kai.heng.feng@...onical.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 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.

[...]

> +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.

> +		dev_warn(dev, "Not ready for system sleep.\n");
> +
> +	return 0;

So in case of a timeout you still return 0, is that OK?

[...]
Thanks, Piotr.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ