lkml.org 
[lkml]   [2022]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 2/2] PCI/PM: Fix pci_pm_suspend_noirq() to disable PTM
On Thu, May 12, 2022 at 07:52:36PM +0200, Rafael J. Wysocki wrote:
> On Thu, May 12, 2022 at 7:42 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Thu, May 12, 2022 at 03:49:18PM +0200, Rafael J. Wysocki wrote:

> > > Something like this should suffice IMV:
> > >
> > > if (!dev_state_saved || pci_dev->current_state != PCI_D3cold)
> > >
> > > pci_disable_ptm(pci_dev);
> >
> > It makes sense to me that we needn't disable PTM if the device is in
> > D3cold. But the "!dev_state_saved" condition depends on what the
> > driver did. Why is that important? Why should we not do the
> > following?
> >
> > if (pci_dev->current_state != PCI_D3cold)
> > pci_disable_ptm(pci_dev);
>
> We can do this too. I thought we could skip the power state check if
> dev_state_saved was unset, because then we would know that the power
> state was not D3cold. It probably isn't worth the hassle though.

Ah, thanks. IMHO it's easier to analyze for correctness if we only
check the power state.

Bjorn

\
 
 \ /
  Last update: 2022-05-12 20:36    [W:0.117 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site