linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the driver-core tree with the rcu tree
@ 2023-02-10  1:48 Stephen Rothwell
  2023-02-10  6:55 ` Paul E. McKenney
  2023-02-10  7:18 ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Rothwell @ 2023-02-10  1:48 UTC (permalink / raw)
  To: Greg KH, Paul E. McKenney
  Cc: Greg Kroah-Hartman, Linux Kernel Mailing List,
	Linux Next Mailing List, Saravana Kannan

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

Hi all,

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

  drivers/base/core.c

between commit:

  dc7c31b07ade ("drivers/base: Remove CONFIG_SRCU")

from the rcu tree and commit:

  3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links")

from the driver-core 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/base/core.c
index bb36aca8d1b7,2712a1a1e959..000000000000
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@@ -181,6 -202,52 +202,51 @@@ void fw_devlink_purge_absent_suppliers(
  }
  EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
  
+ /**
+  * __fwnode_links_move_consumers - Move consumer from @from to @to fwnode_handle
+  * @from: move consumers away from this fwnode
+  * @to: move consumers to this fwnode
+  *
+  * Move all consumer links from @from fwnode to @to fwnode.
+  */
+ static void __fwnode_links_move_consumers(struct fwnode_handle *from,
+ 					  struct fwnode_handle *to)
+ {
+ 	struct fwnode_link *link, *tmp;
+ 
+ 	list_for_each_entry_safe(link, tmp, &from->consumers, s_hook) {
+ 		__fwnode_link_add(link->consumer, to, link->flags);
+ 		__fwnode_link_del(link);
+ 	}
+ }
+ 
+ /**
+  * __fw_devlink_pickup_dangling_consumers - Pick up dangling consumers
+  * @fwnode: fwnode from which to pick up dangling consumers
+  * @new_sup: fwnode of new supplier
+  *
+  * If the @fwnode has a corresponding struct device and the device supports
+  * probing (that is, added to a bus), then we want to let fw_devlink create
+  * MANAGED device links to this device, so leave @fwnode and its descendant's
+  * fwnode links alone.
+  *
+  * Otherwise, move its consumers to the new supplier @new_sup.
+  */
+ static void __fw_devlink_pickup_dangling_consumers(struct fwnode_handle *fwnode,
+ 						   struct fwnode_handle *new_sup)
+ {
+ 	struct fwnode_handle *child;
+ 
+ 	if (fwnode->dev && fwnode->dev->bus)
+ 		return;
+ 
+ 	fwnode->flags |= FWNODE_FLAG_NOT_DEVICE;
+ 	__fwnode_links_move_consumers(fwnode, new_sup);
+ 
+ 	fwnode_for_each_available_child_node(fwnode, child)
+ 		__fw_devlink_pickup_dangling_consumers(child, new_sup);
+ }
+ 
 -#ifdef CONFIG_SRCU
  static DEFINE_MUTEX(device_links_lock);
  DEFINE_STATIC_SRCU(device_links_srcu);
  

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

^ permalink raw reply	[flat|nested] 6+ messages in thread
* linux-next: manual merge of the driver-core tree with the rcu tree
@ 2019-08-13  5:50 Stephen Rothwell
  2019-08-13  8:50 ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2019-08-13  5:50 UTC (permalink / raw)
  To: Greg KH, Paul E. McKenney
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Joel Fernandes (Google),
	Rafael J. Wysocki

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

Hi all,

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

  drivers/base/power/runtime.c

between commit:

  4a3a5474b4c1 ("driver/core: Convert to use built-in RCU list checking")

from the rcu tree and commit:

  515db266a9da ("driver core: Remove device link creation limitation")

from the driver-core 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/base/power/runtime.c
index 50def99df970,45a8fbe6987a..000000000000
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@@ -1642,9 -1640,8 +1642,9 @@@ void pm_runtime_clean_up_links(struct d
  
  	idx = device_links_read_lock();
  
 -	list_for_each_entry_rcu(link, &dev->links.consumers, s_node) {
 +	list_for_each_entry_rcu(link, &dev->links.consumers, s_node,
 +				device_links_read_lock_held()) {
- 		if (link->flags & DL_FLAG_STATELESS)
+ 		if (!(link->flags & DL_FLAG_MANAGED))
  			continue;
  
  		while (refcount_dec_not_one(&link->rpm_active))

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

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

end of thread, other threads:[~2023-02-10  7:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10  1:48 linux-next: manual merge of the driver-core tree with the rcu tree Stephen Rothwell
2023-02-10  6:55 ` Paul E. McKenney
2023-02-10  7:18 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2019-08-13  5:50 Stephen Rothwell
2019-08-13  8:50 ` Rafael J. Wysocki
2019-08-13 14:22   ` Paul E. McKenney

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