Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

driver core: fw_devlink: Allow firmware to mark devices as best effort

When firmware sets the FWNODE_FLAG_BEST_EFFORT flag for a fwnode,
fw_devlink will do a best effort ordering for that device where it'll
only enforce the probe/suspend/resume ordering of that device with
suppliers that have drivers. The driver of that device can then decide
if it wants to defer probe or probe without the suppliers.

This will be useful for avoid probe delays of the console device that
were caused by commit 71066545b48e ("driver core: Set
fw_devlink.strict=1 by default").

Fixes: 71066545b48e ("driver core: Set fw_devlink.strict=1 by default")
Reported-by: Sascha Hauer <sha@pengutronix.de>
Reported-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20220623080344.783549-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Saravana Kannan and committed by
Greg Kroah-Hartman
8f486cab 1d25b84e

+6 -1
+2 -1
drivers/base/core.c
··· 968 968 969 969 static bool dev_is_best_effort(struct device *dev) 970 970 { 971 - return fw_devlink_best_effort && dev->can_match; 971 + return (fw_devlink_best_effort && dev->can_match) || 972 + (dev->fwnode && (dev->fwnode->flags & FWNODE_FLAG_BEST_EFFORT)); 972 973 } 973 974 974 975 /**
+4
include/linux/fwnode.h
··· 27 27 * driver needs its child devices to be bound with 28 28 * their respective drivers as soon as they are 29 29 * added. 30 + * BEST_EFFORT: The fwnode/device needs to probe early and might be missing some 31 + * suppliers. Only enforce ordering with suppliers that have 32 + * drivers. 30 33 */ 31 34 #define FWNODE_FLAG_LINKS_ADDED BIT(0) 32 35 #define FWNODE_FLAG_NOT_DEVICE BIT(1) 33 36 #define FWNODE_FLAG_INITIALIZED BIT(2) 34 37 #define FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD BIT(3) 38 + #define FWNODE_FLAG_BEST_EFFORT BIT(4) 35 39 36 40 struct fwnode_handle { 37 41 struct fwnode_handle *secondary;