alistair23-linux/drivers/of
Saravana Kannan bb278b149d of: property: Improve cycle detection when one of the devices is never added
Consider this example where -> means LHS device is a consumer of RHS
device and indentation represents "child of" of the previous device.

Device A -> Device C

Device B -> Device A
	Device C

Without this commit:
1. Device A is added.
2. Device A is added to waiting for supplier list (Device C)
3. Device B is added
4. Device B is linked as a consumer to Device A
5. Device A doesn't probe because it's waiting for Device C to be added.
6. Device B doesn't probe because Device A hasn't probed.
7. Device C will never be added because it's parent hasn't probed.

So, Device A, B and C will be in a probe/add deadlock.

This commit detects this scenario and stops trying to create a device
link between Device A and Device C since doing so would create the
following cycle:
Device A -> Devic C -(parent)-> Device B -> Device A.

With this commit:
1. Device A is added.
3. Device B is added
4. Device B is linked as a consumer to Device A
5. Device A probes.
6. Device B probes because Device A has probed.
7. Device C is added and probed.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20200610011934.49795-3-saravanak@google.com
Signed-off-by: Rob Herring <robh@kernel.org>
2020-06-17 16:11:18 -06:00
..
unittest-data of: unittest: kmemleak in duplicate property update 2020-04-17 08:31:34 -05:00
address.c of/address: Support multiple 'dma-ranges' entries 2020-02-14 15:27:08 -06:00
base.c ARM: SoC-related driver updates 2020-02-08 14:04:19 -08:00
device.c treewide: remove redundant IS_ERR() before error code check 2020-02-04 03:05:27 +00:00
dynamic.c of: of_detach_node() remove unneeded local return variable 2020-04-14 07:59:54 -05:00
fdt.c of/fdt: Remove redundant kbasename function call 2020-05-28 20:57:17 -06:00
fdt_address.c
irq.c
Kconfig
kobj.c of: Fix a refcounting bug in __of_attach_node_sysfs() 2020-05-27 19:30:25 -06:00
Makefile
of_mdio.c net: mdio: of: export part of of_mdiobus_register_phy() 2020-04-22 19:41:26 -07:00
of_net.c
of_numa.c
of_private.h of: of_private.h: Replace zero-length array with flexible-array member 2020-03-31 09:03:34 -06:00
of_reserved_mem.c of: reserved_mem: Fix typo in the too-many-regions message 2020-06-15 11:28:22 -06:00
overlay.c of: overlay: kmemleak in dup_and_fixup_symbol_prop() 2020-04-17 08:31:34 -05:00
pdt.c
platform.c Driver core patches for 5.8-rc1 2020-06-07 10:53:36 -07:00
property.c of: property: Improve cycle detection when one of the devices is never added 2020-06-17 16:11:18 -06:00
resolver.c of: overlay: log the error cause on resolver failure 2020-03-02 11:32:44 -06:00
unittest.c of: unittest: kmemleak in duplicate property update 2020-04-17 08:31:34 -05:00