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: <20250107234530.GA191158@bhelgaas>
Date: Tue, 7 Jan 2025 17:45:30 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Sergey Ryazanov <ryazanov.s.a@...il.com>
Cc: "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>,
	M Chetan Kumar <m.chetan.kumar@...el.com>,
	Loic Poulain <loic.poulain@...aro.org>,
	Johannes Berg <johannes@...solutions.net>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"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-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: wwan: iosm: Fix hibernation by re-binding the
 driver around it

On Wed, Jan 08, 2025 at 01:13:41AM +0200, Sergey Ryazanov wrote:
> On 05.01.2025 19:39, Maciej S. Szmigiero wrote:
> > Currently, the driver is seriously broken with respect to the
> > hibernation (S4): after image restore the device is back into
> > IPC_MEM_EXEC_STAGE_BOOT (which AFAIK means bootloader stage) and needs
> > full re-launch of the rest of its firmware, but the driver restore
> > handler treats the device as merely sleeping and just sends it a
> > wake-up command.
> > 
> > This wake-up command times out but device nodes (/dev/wwan*) remain
> > accessible.
> > However attempting to use them causes the bootloader to crash and
> > enter IPC_MEM_EXEC_STAGE_CD_READY stage (which apparently means "a crash
> > dump is ready").
> > 
> > It seems that the device cannot be re-initialized from this crashed
> > stage without toggling some reset pin (on my test platform that's
> > apparently what the device _RST ACPI method does).
> > 
> > While it would theoretically be possible to rewrite the driver to tear
> > down the whole MUX / IPC layers on hibernation (so the bootloader does
> > not crash from improper access) and then re-launch the device on
> > restore this would require significant refactoring of the driver
> > (believe me, I've tried), since there are quite a few assumptions
> > hard-coded in the driver about the device never being partially
> > de-initialized (like channels other than devlink cannot be closed,
> > for example).
> > Probably this would also need some programming guide for this hardware.
> > 
> > Considering that the driver seems orphaned [1] and other people are
> > hitting this issue too [2] fix it by simply unbinding the PCI driver
> > before hibernation and re-binding it after restore, much like
> > USB_QUIRK_RESET_RESUME does for USB devices that exhibit a similar
> > problem.
> > 
> > Tested on XMM7360 in HP EliteBook 855 G7 both with s2idle (which uses
> > the existing suspend / resume handlers) and S4 (which uses the new code).
> > 
> > [1]: https://lore.kernel.org/all/c248f0b4-2114-4c61-905f-466a786bdebb@leemhuis.info/
> > [2]:
> > https://github.com/xmm7360/xmm7360-pci/issues/211#issuecomment-1804139413
> > 
> > Signed-off-by: Maciej S. Szmigiero <mail@...iej.szmigiero.name>
> 
> Generally looks good to me. Lets wait for approval from PCI maintainers to
> be sure that there no unexpected side effects.

I have nothing useful to contribute here.  Seems like kind of a mess.
But Intel claims to maintain this, so it would be nice if they would
step up and make this work nicely.

Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ