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: <75630ef1-0367-4ed3-b286-664b63424f52@rowland.harvard.edu>
Date: Sun, 7 Dec 2025 12:22:16 -0500
From: Alan Stern <stern@...land.harvard.edu>
To: Biju Das <biju.das.jz@...renesas.com>,
	"Rafael J. Wysocki" <rafael@...nel.org>
Cc: "biju.das.au" <biju.das.au@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Claudiu Beznea <claudiu.beznea.uj@...renesas.com>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>,
	"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH 0/2] usb: host: Drop resume calls on
 {e,o}hci_platform_suspend()

Rafael: Please see below.

On Sun, Dec 07, 2025 at 04:47:54PM +0000, Biju Das wrote:
> Hi Alan Stern,
> 
> Thanks for the feedback.
> 
> > -----Original Message-----
> > From: Alan Stern <stern@...land.harvard.edu>
> > Sent: 07 December 2025 16:36
> > Subject: Re: [PATCH 0/2] usb: host: Drop resume calls on {e,o}hci_platform_suspend()
> > 
> > On Sun, Dec 07, 2025 at 12:47:25PM +0000, Biju wrote:
> > > From: Biju Das <biju.das.jz@...renesas.com>
> > >
> > > As per the suspend_devices_and_enter() [1], if .suspend() fails, it
> > > invoke the .resume() callback.
> > 
> > Quite wrong.  If .suspend() fails, the core assumes the device is still at full power.  It does not
> > try to resume the device.
> 
> If there is a failure on any device it aborts suspend and jump to Resume_devices that
> calls .resume_callback(). Please see failure logs of PWM device failure[2]
> 
> Recover_platform:
> 	platform_recover(state);
> 	goto Resume_devices;

That is true, but it is not the full story.

> > > This patch series drops redundant resume() from
> > > {e,o}hci_platform_suspend()
> > 
> > These resume() calls are not redundant and they should not be dropped.
> 
> ehci_resume() is called from both failure and resume path.

Yes, but the resume path will not be called if suspend fails.

> Maybe it is OK to call ehci_resume() twice. One from failure path and one from resume().
> 
> > 
> > > [1]
> > > https://elixir.bootlin.com/linux/v6.18-rc7/source/kernel/power/suspend
> > > .c#L519
> > 
> > The message on this line has no bearing on what you are doing.  It merely says "Some devices failed to
> > suspend, or early wake event detected".  There's nothing about invoking the .resume() callback.
> 
> See the logs[2] in case of failure.
> 
> 
> [2]
> [   47.965220] Filesystems sync: 0.000 seconds
> [   47.971883] Freezing user space processes
> [   47.977739] Freezing user space processes completed (elapsed 0.001 seconds)
> [   47.984772] OOM killer disabled.
> [   47.988065] Freezing remaining freezable tasks
> [   47.993681] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> [   48.001143] printk: Suspending console(s) (use no_console_suspend to debug)
> [   48.077166] renesas-gbeth 15c30000.ethernet end0: Link is Down
> [   48.081846] pwm-rzg2l-gpt 13010000.pwm: PM: dpm_run_callback(): rzg2l_gpt_suspend [pwm_rzg2l_gpt] returns -110
> [   48.081937] pwm-rzg2l-gpt 13010000.pwm: PM: failed to suspend: error -110

Okay, here we see that pwm-rzg2l-gpt failed to suspend.

> [   48.082157] PM: Some devices failed to suspend, or early wake event detected
> [   48.091749] dwmac4: Master AXI performs any burst length
> [   48.091829] renesas-gbeth 15c30000.ethernet end0: No Safety Features support found
> [   48.091924] renesas-gbeth 15c30000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
> [   48.092073] renesas-gbeth 15c30000.ethernet end0: configuring for phy/rgmii-id link mode
> [   48.100718] dwmac4: Master AXI performs any burst length
> [   48.100791] renesas-gbeth 15c40000.ethernet end1: No Safety Features support found
> [   48.100875] renesas-gbeth 15c40000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported
> [   48.101016] renesas-gbeth 15c40000.ethernet end1: configuring for phy/rgmii-id link mode
> [   48.149094] usb usb1: root hub lost power or was reset
> [   48.149136] usb usb2: root hub lost power or was reset
> [   48.361219] OOM killer enabled.

And here we see no sign of a resume for pwm-rzg2l-gpt.

When recovering from a failed suspend transition, the kernel resumes 
only the devices that did suspend correctly.  The code that handles this 
is in drivers/base/power/main.c, and it's rather intricate and difficult 
to follow.

In short, dpm_resume() invokes the resume callback only for devices that 
are on dpm_suspended_list.  Devices are added to this list by 
dpm_suspend(), and if the suspend callback fails they are supposed to be 
removed from the list.

However, I don't see any place in device_suspend() where an error causes 
the device to be moved from dpm_suspended_list back to 
dpm_prepared_list.  Maybe this is a bug and needs to be fixed.  Or maybe 
I have misunderstood something.

Rafael should be able to explain this.

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ