[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jWBcUUDxNTLmYP071noSXB4q0UP0CD46sk_uS4HNgeqA@mail.gmail.com>
Date: Mon, 4 Nov 2019 11:31:40 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Linux PCI <linux-pci@...r.kernel.org>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux PM <linux-pm@...r.kernel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH 3/6] PCI/PM: Simplify pci_set_power_state()
On Fri, Nov 1, 2019 at 9:46 PM Bjorn Helgaas <helgaas@...nel.org> wrote:
>
> From: Bjorn Helgaas <bhelgaas@...gle.com>
>
> Check for the PCI_DEV_FLAGS_NO_D3 quirk early, before calling
> __pci_start_power_transition(). This way all the cases where we don't need
> to do anything at all are checked up front.
>
> This doesn't fix anything because if the caller requested D3hot or D3cold,
> __pci_start_power_transition() is a no-op. But calling it is pointless and
> makes the code harder to analyze.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> drivers/pci/pci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index a9d3653ef960..281bc8fc51b3 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1130,8 +1130,6 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
> if (dev->current_state == state)
> return 0;
>
> - __pci_start_power_transition(dev, state);
> -
> /*
> * This device is quirked not to be put into D3, so don't put it in
> * D3
> @@ -1139,6 +1137,8 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
> if (state >= PCI_D3hot && (dev->dev_flags & PCI_DEV_FLAGS_NO_D3))
> return 0;
>
> + __pci_start_power_transition(dev, state);
> +
> /*
> * To put device in D3cold, we put device into D3hot in native
> * way, then put device into D3cold with platform ops
> --
> 2.24.0.rc1.363.gb1bccd3e3d-goog
>
Powered by blists - more mailing lists