driver core: Handle cycles in device links created by fw_devlink
authorSaravana Kannan <saravanak@google.com>
Fri, 18 Dec 2020 03:17:02 +0000 (19:17 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Jan 2021 20:04:25 +0000 (21:04 +0100)
commitb0e2fa4f611bb9ab22928605d5b1c7fd44e73955
tree33394fd533f69f33d1a9e77ff9fe6e786b3f73fb
parentb90fb8f66c617806a0548c273f562caea4741433
driver core: Handle cycles in device links created by fw_devlink

Sometimes, firmware can have cyclic dependencies between devices. But
one or more of those dependencies in the cycle are false dependencies
that don't affect the probing of the device.

fw_devlink can detect some of these false dependencies using logic. But
when it can't, we don't want to block probing of the devices in this
cyclic dependency.

So, instead of using normal device links for the devices in this cycle,
we need to switch to SYNC_STATE_ONLY device links between these devices.
This is so that sync_state() callback correctness is still maintained
while we allow these device to probe.

This is functionally similar to switching to fw_devlink=permissive just
for the devices in the cycle.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20201218031703.3053753-5-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c