linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Bjorn Helgaas <helgaas@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH 5/5] PCI: PM: Fold __pci_complete_power_transition() into its caller
Date: Tue, 5 Nov 2019 17:15:01 +0100	[thread overview]
Message-ID: <CAJZ5v0gd84S3MBjTMJfs8NZu92QcdFAin4WEwVqWVzXrrC1vrw@mail.gmail.com> (raw)
In-Reply-To: <20191105160943.GA19190@infradead.org>

On Tue, Nov 5, 2019 at 5:09 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Tue, Nov 05, 2019 at 11:32:02AM +0100, Rafael J. Wysocki wrote:
> >       if (state > PCI_D3cold)
> > @@ -1132,10 +1112,12 @@ int pci_set_power_state(struct pci_dev *
> >       error = pci_raw_set_power_state(dev, state > PCI_D3hot ?
> >                                       PCI_D3hot : state);
> >
> > -     if (!__pci_complete_power_transition(dev, state))
> > -             error = 0;
> > +     ret = pci_platform_power_transition(dev, state);
> > +     /* Powering off a bridge may power off the whole hierarchy */
> > +     if (!ret && state == PCI_D3cold)
> > +             pci_bus_set_current_state(dev->subordinate, PCI_D3cold);
> >
> > -     return error;
> > +     return ret ? error : 0;
>
> Total nitpick, but why not:
>
>         if (pci_platform_power_transition(dev, state))
>                 return error;
>
>         /* Powering off a bridge may power off the whole hierarchy */
>         if (state == PCI_D3cold)
>                 pci_bus_set_current_state(dev->subordinate, PCI_D3cold);
>         return 0;

Yes, that looks better, thanks!

I'll send an update of this patch.

  reply	other threads:[~2019-11-05 16:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 10:11 [PATCH 0/5] PCI: PM: Cleanups related to power state changes Rafael J. Wysocki
2019-11-05 10:13 ` [PATCH 1/5] PCI: PM: Move power state update away from pci_power_up() Rafael J. Wysocki
2019-11-05 10:27 ` [PATCH 2/5] PCI: PM: Use pci_power_up() in pci_set_power_state() Rafael J. Wysocki
2019-11-05 10:29 ` [PATCH 3/5] PCI: PM: Fold __pci_start_power_transition() into its caller Rafael J. Wysocki
2019-11-05 10:30 ` [PATCH 4/5] PCI: PM: Avoid exporting __pci_complete_power_transition() Rafael J. Wysocki
2019-11-05 10:32 ` [PATCH 5/5] PCI: PM: Fold __pci_complete_power_transition() into its caller Rafael J. Wysocki
2019-11-05 16:09   ` Christoph Hellwig
2019-11-05 16:15     ` Rafael J. Wysocki [this message]
2019-11-05 11:28 ` [PATCH 0/5] PCI: PM: Cleanups related to power state changes Rafael J. Wysocki
2019-11-05 22:35   ` Bjorn Helgaas
2019-11-05 22:48     ` Rafael J. Wysocki
2019-11-05 13:02 ` Mika Westerberg
2019-11-05 16:32 ` [PATCH update 5/5] PCI: PM: Fold __pci_complete_power_transition() into its caller Rafael J. Wysocki
2019-11-06 19:02 ` [PATCH 0/5] PCI: PM: Cleanups related to power state changes Bjorn Helgaas
2019-11-07 13:33   ` Rafael J. Wysocki
2019-11-08 11:49   ` Rafael J. Wysocki
2019-11-08 20:13     ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJZ5v0gd84S3MBjTMJfs8NZu92QcdFAin4WEwVqWVzXrrC1vrw@mail.gmail.com \
    --to=rafael@kernel.org \
    --cc=hch@infradead.org \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --subject='Re: [PATCH 5/5] PCI: PM: Fold __pci_complete_power_transition() into its caller' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).