linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the pm tree with the pci-current tree
@ 2024-02-13 23:30 Stephen Rothwell
  2024-02-14  7:09 ` Sakari Ailus
  2024-02-20 15:36 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Rothwell @ 2024-02-13 23:30 UTC (permalink / raw)
  To: Rafael J. Wysocki, Bjorn Helgaas, Lorenzo Pieralisi,
	Krzysztof Wilczyński
  Cc: Alex Williamson, Linux Kernel Mailing List,
	Linux Next Mailing List, Rafael J. Wysocki, Sakari Ailus

[-- Attachment #1: Type: text/plain, Size: 2501 bytes --]

Hi all,

Today's linux-next merge of the pm tree got a conflict in:

  drivers/pci/pci.c

between commit:

  41044d536068 ("PCI: Fix active state requirement in PME polling")

from the pci-current tree and commit:

  c0ef3df8dbae ("PM: runtime: Simplify pm_runtime_get_if_active() usage")

from the pm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/pci/pci.c
index a532bf597e57,cb51c4079013..000000000000
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@@ -2361,36 -2522,29 +2361,36 @@@ static void pci_pme_list_scan(struct wo
  		if (pdev->pme_poll) {
  			struct pci_dev *bridge = pdev->bus->self;
  			struct device *dev = &pdev->dev;
 -			int pm_status;
 +			struct device *bdev = bridge ? &bridge->dev : NULL;
 +			int bref = 0;
  
  			/*
 -			 * If bridge is in low power state, the
 -			 * configuration space of subordinate devices
 -			 * may be not accessible
 +			 * If we have a bridge, it should be in an active/D0
 +			 * state or the configuration space of subordinate
 +			 * devices may not be accessible or stable over the
 +			 * course of the call.
  			 */
 -			if (bridge && bridge->current_state != PCI_D0)
 -				continue;
 +			if (bdev) {
- 				bref = pm_runtime_get_if_active(bdev, true);
++				bref = pm_runtime_get_if_active(bdev);
 +				if (!bref)
 +					continue;
 +
 +				if (bridge->current_state != PCI_D0)
 +					goto put_bridge;
 +			}
  
  			/*
 -			 * If the device is in a low power state it
 -			 * should not be polled either.
 +			 * The device itself should be suspended but config
 +			 * space must be accessible, therefore it cannot be in
 +			 * D3cold.
  			 */
 -			pm_status = pm_runtime_get_if_active(dev);
 -			if (!pm_status)
 -				continue;
 -
 -			if (pdev->current_state != PCI_D3cold)
 +			if (pm_runtime_suspended(dev) &&
 +			    pdev->current_state != PCI_D3cold)
  				pci_pme_wakeup(pdev, NULL);
  
 -			if (pm_status > 0)
 -				pm_runtime_put(dev);
 +put_bridge:
 +			if (bref > 0)
 +				pm_runtime_put(bdev);
  		} else {
  			list_del(&pme_dev->list);
  			kfree(pme_dev);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the pm tree with the pci-current tree
  2024-02-13 23:30 linux-next: manual merge of the pm tree with the pci-current tree Stephen Rothwell
@ 2024-02-14  7:09 ` Sakari Ailus
  2024-02-20 15:36 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2024-02-14  7:09 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Rafael J. Wysocki, Bjorn Helgaas, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Alex Williamson,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Rafael J. Wysocki

Hi Stephen,

On Wed, Feb 14, 2024 at 10:30:08AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the pm tree got a conflict in:
> 
>   drivers/pci/pci.c
> 
> between commit:
> 
>   41044d536068 ("PCI: Fix active state requirement in PME polling")
> 
> from the pci-current tree and commit:
> 
>   c0ef3df8dbae ("PM: runtime: Simplify pm_runtime_get_if_active() usage")
> 
> from the pm tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

The change looks good to me.

Thanks!

> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc drivers/pci/pci.c
> index a532bf597e57,cb51c4079013..000000000000
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@@ -2361,36 -2522,29 +2361,36 @@@ static void pci_pme_list_scan(struct wo
>   		if (pdev->pme_poll) {
>   			struct pci_dev *bridge = pdev->bus->self;
>   			struct device *dev = &pdev->dev;
>  -			int pm_status;
>  +			struct device *bdev = bridge ? &bridge->dev : NULL;
>  +			int bref = 0;
>   
>   			/*
>  -			 * If bridge is in low power state, the
>  -			 * configuration space of subordinate devices
>  -			 * may be not accessible
>  +			 * If we have a bridge, it should be in an active/D0
>  +			 * state or the configuration space of subordinate
>  +			 * devices may not be accessible or stable over the
>  +			 * course of the call.
>   			 */
>  -			if (bridge && bridge->current_state != PCI_D0)
>  -				continue;
>  +			if (bdev) {
> - 				bref = pm_runtime_get_if_active(bdev, true);
> ++				bref = pm_runtime_get_if_active(bdev);
>  +				if (!bref)
>  +					continue;
>  +
>  +				if (bridge->current_state != PCI_D0)
>  +					goto put_bridge;
>  +			}
>   
>   			/*
>  -			 * If the device is in a low power state it
>  -			 * should not be polled either.
>  +			 * The device itself should be suspended but config
>  +			 * space must be accessible, therefore it cannot be in
>  +			 * D3cold.
>   			 */
>  -			pm_status = pm_runtime_get_if_active(dev);
>  -			if (!pm_status)
>  -				continue;
>  -
>  -			if (pdev->current_state != PCI_D3cold)
>  +			if (pm_runtime_suspended(dev) &&
>  +			    pdev->current_state != PCI_D3cold)
>   				pci_pme_wakeup(pdev, NULL);
>   
>  -			if (pm_status > 0)
>  -				pm_runtime_put(dev);
>  +put_bridge:
>  +			if (bref > 0)
>  +				pm_runtime_put(bdev);
>   		} else {
>   			list_del(&pme_dev->list);
>   			kfree(pme_dev);

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the pm tree with the pci-current tree
  2024-02-13 23:30 linux-next: manual merge of the pm tree with the pci-current tree Stephen Rothwell
  2024-02-14  7:09 ` Sakari Ailus
@ 2024-02-20 15:36 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2024-02-20 15:36 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Rafael J. Wysocki, Bjorn Helgaas, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Alex Williamson,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Rafael J. Wysocki, Sakari Ailus

On Wed, Feb 14, 2024 at 10:30:08AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the pm tree got a conflict in:
> 
>   drivers/pci/pci.c
> 
> between commit:
> 
>   41044d536068 ("PCI: Fix active state requirement in PME polling")
> 
> from the pci-current tree and commit:
> 
>   c0ef3df8dbae ("PM: runtime: Simplify pm_runtime_get_if_active() usage")
> 
> from the pm tree.

Just FYI, 41044d536068 is now upstream for v6.8, so the conflict will
be between upstream and the pm tree:

https://git.kernel.org/linus/41044d536068

> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc drivers/pci/pci.c
> index a532bf597e57,cb51c4079013..000000000000
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@@ -2361,36 -2522,29 +2361,36 @@@ static void pci_pme_list_scan(struct wo
>   		if (pdev->pme_poll) {
>   			struct pci_dev *bridge = pdev->bus->self;
>   			struct device *dev = &pdev->dev;
>  -			int pm_status;
>  +			struct device *bdev = bridge ? &bridge->dev : NULL;
>  +			int bref = 0;
>   
>   			/*
>  -			 * If bridge is in low power state, the
>  -			 * configuration space of subordinate devices
>  -			 * may be not accessible
>  +			 * If we have a bridge, it should be in an active/D0
>  +			 * state or the configuration space of subordinate
>  +			 * devices may not be accessible or stable over the
>  +			 * course of the call.
>   			 */
>  -			if (bridge && bridge->current_state != PCI_D0)
>  -				continue;
>  +			if (bdev) {
> - 				bref = pm_runtime_get_if_active(bdev, true);
> ++				bref = pm_runtime_get_if_active(bdev);
>  +				if (!bref)
>  +					continue;
>  +
>  +				if (bridge->current_state != PCI_D0)
>  +					goto put_bridge;
>  +			}
>   
>   			/*
>  -			 * If the device is in a low power state it
>  -			 * should not be polled either.
>  +			 * The device itself should be suspended but config
>  +			 * space must be accessible, therefore it cannot be in
>  +			 * D3cold.
>   			 */
>  -			pm_status = pm_runtime_get_if_active(dev);
>  -			if (!pm_status)
>  -				continue;
>  -
>  -			if (pdev->current_state != PCI_D3cold)
>  +			if (pm_runtime_suspended(dev) &&
>  +			    pdev->current_state != PCI_D3cold)
>   				pci_pme_wakeup(pdev, NULL);
>   
>  -			if (pm_status > 0)
>  -				pm_runtime_put(dev);
>  +put_bridge:
>  +			if (bref > 0)
>  +				pm_runtime_put(bdev);
>   		} else {
>   			list_del(&pme_dev->list);
>   			kfree(pme_dev);



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-20 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-13 23:30 linux-next: manual merge of the pm tree with the pci-current tree Stephen Rothwell
2024-02-14  7:09 ` Sakari Ailus
2024-02-20 15:36 ` Bjorn Helgaas

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).