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: <CAJZ5v0jH8m06r1thobzxHsQFwYUkY_6jPyQViXGFY6PsUFThow@mail.gmail.com>
Date: Fri, 27 Jun 2025 12:11:25 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>, Linux PM <linux-pm@...r.kernel.org>, 
	LKML <linux-kernel@...r.kernel.org>, Linux ACPI <linux-acpi@...r.kernel.org>, 
	Linux PCI <linux-pci@...r.kernel.org>, Ulf Hansson <ulf.hansson@...aro.org>, 
	Mika Westerberg <mika.westerberg@...ux.intel.com>
Subject: Re: [PATCH v2 9/9] PCI: PM: Set power.strict_midlayer in pci_pm_init()

On Thu, Jun 26, 2025 at 10:59 PM Bjorn Helgaas <helgaas@...nel.org> wrote:
>
> On Thu, Jun 26, 2025 at 08:15:05PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> >
> > The PCI bus type does not expect its runtime PM callbacks,
> > pci_pm_runtime_suspend() and pci_pm_runtime_resume(), to be invoked at
> > any point during system-wide suspend and resume, so make it express
> > that expectation by setting power.strict_midlayer for all PCI devices
> > in pci_pm_prepare() and clear it in pci_pm_complete().
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Previous PM-related patches in drivers/pci/ use a subject line like:
>
>   PCI/PM: ...

Sure.

> Would be cool if there were hints about what
> dev_pm_set_strict_midlayer() means.  Maybe the comment in
> get_callback() is enough, but it takes a little work to find it.

OK, I can add a kerneldoc comment to it.

> Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>

Thanks!

> > ---
> >
> > v1 -> v2:
> >    * Set and clear the new flag in "prepare" and "complete" to allow
> >      pm_runtime_force_suspend() invoked from driver remove callbacks to
> >      work.
> >    * Update subject and changelog.
> >
> > ---
> >  drivers/pci/pci-driver.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > --- a/drivers/pci/pci-driver.c
> > +++ b/drivers/pci/pci-driver.c
> > @@ -708,6 +708,8 @@
> >       struct pci_dev *pci_dev = to_pci_dev(dev);
> >       const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> >
> > +     dev_pm_set_strict_midlayer(dev, true);
> > +
> >       if (pm && pm->prepare) {
> >               int error = pm->prepare(dev);
> >               if (error < 0)
> > @@ -749,6 +751,8 @@
> >               if (pci_dev->current_state < pre_sleep_state)
> >                       pm_request_resume(dev);
> >       }
> > +
> > +     dev_pm_set_strict_midlayer(dev, false);
> >  }
> >
> >  #else /* !CONFIG_PM_SLEEP */
> >
> >
> >
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ