2012-06-25 02:31:22

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the pci tree with Linus' tree

Hi Bjorn,

Today's linux-next merge of the pci tree got a conflict in
drivers/pci/pci.c between commit c2fb8a3fa255 ("USB: add
NO_D3_DURING_SLEEP flag and revert 151b61284776be2") from Linus' tree and
commit 448bd857d48e ("PCI/PM: add PCIe runtime D3cold support") from the
pci tree.

I fixed it up (I think - see below) and can carry the fix as necessary.
--
Cheers,
Stephen Rothwell [email protected]

diff --cc drivers/pci/pci.c
index 77cb54a,3f8b74f..0000000
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@@ -1744,11 -1803,10 +1803,15 @@@ int pci_prepare_to_sleep(struct pci_de
if (target_state == PCI_POWER_ERROR)
return -EIO;

+ /* D3cold during system suspend/hibernate is not supported */
+ if (target_state > PCI_D3hot)
+ target_state = PCI_D3hot;
+
+ /* Some devices mustn't be in D3 during system sleep */
+ if (target_state == PCI_D3hot &&
+ (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP))
+ return 0;
+
pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev));

error = pci_set_power_state(dev, target_state);


Attachments:
(No filename) (1.07 kB)
(No filename) (836.00 B)
Download all attachments

2012-06-25 06:32:57

by huang ying

[permalink] [raw]
Subject: Re: linux-next: manual merge of the pci tree with Linus' tree

Hi, Stephen,

On Mon, Jun 25, 2012 at 10:31 AM, Stephen Rothwell <[email protected]> wrote:
> Hi Bjorn,
>
> Today's linux-next merge of the pci tree got a conflict in
> drivers/pci/pci.c between commit c2fb8a3fa255 ("USB: add
> NO_D3_DURING_SLEEP flag and revert 151b61284776be2") from Linus' tree and
> commit 448bd857d48e ("PCI/PM: add PCIe runtime D3cold support") from the
> pci tree.
>
> I fixed it up (I think - see below) and can carry the fix as necessary.
> --
> Cheers,
> Stephen Rothwell                    [email protected]
>
> diff --cc drivers/pci/pci.c
> index 77cb54a,3f8b74f..0000000
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@@ -1744,11 -1803,10 +1803,15 @@@ int pci_prepare_to_sleep(struct pci_de
>        if (target_state == PCI_POWER_ERROR)
>                return -EIO;
>
> +       /* D3cold during system suspend/hibernate is not supported */
> +       if (target_state > PCI_D3hot)
> +               target_state = PCI_D3hot;
> +
>  +      /* Some devices mustn't be in D3 during system sleep */
>  +      if (target_state == PCI_D3hot &&
>  +                      (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP))
>  +              return 0;
>  +
>        pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev));
>
>        error = pci_set_power_state(dev, target_state);

I found this conflict during development too. I think the fixing is
correct. Thanks.

Best Regards,
Huang Ying

2012-06-25 14:14:18

by Alan Stern

[permalink] [raw]
Subject: Re: linux-next: manual merge of the pci tree with Linus' tree

On Mon, 25 Jun 2012, Stephen Rothwell wrote:

> Hi Bjorn,
>
> Today's linux-next merge of the pci tree got a conflict in
> drivers/pci/pci.c between commit c2fb8a3fa255 ("USB: add
> NO_D3_DURING_SLEEP flag and revert 151b61284776be2") from Linus' tree and
> commit 448bd857d48e ("PCI/PM: add PCIe runtime D3cold support") from the
> pci tree.
>
> I fixed it up (I think - see below) and can carry the fix as necessary.
> --
> Cheers,
> Stephen Rothwell [email protected]
>
> diff --cc drivers/pci/pci.c
> index 77cb54a,3f8b74f..0000000
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@@ -1744,11 -1803,10 +1803,15 @@@ int pci_prepare_to_sleep(struct pci_de
> if (target_state == PCI_POWER_ERROR)
> return -EIO;
>
> + /* D3cold during system suspend/hibernate is not supported */
> + if (target_state > PCI_D3hot)
> + target_state = PCI_D3hot;
> +
> + /* Some devices mustn't be in D3 during system sleep */
> + if (target_state == PCI_D3hot &&
> + (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP))
> + return 0;
> +
> pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev));
>
> error = pci_set_power_state(dev, target_state);

This looks right to me too.

Alan Stern