From f8fb576658a3e19796e2e1a12a5ec8f44dac02b6 Mon Sep 17 00:00:00 2001 From: Saravana Kannan Date: Fri, 3 Mar 2023 16:53:54 -0800 Subject: driver core: Make state_synced device attribute writeable If the file is written to and sync_state() hasn't been called for the device yet, then call sync_state() for the device independent of the state of its consumers. This is useful for supplier devices that have one or more consumers that don't have a driver but the consumers are in a state that don't use the resources supplied by the supplier device. This gives finer grained control than using the fw_devlink.sync_state=timeout kernel commandline parameter. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20230304005355.746421-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/base/core.c') diff --git a/drivers/base/core.c b/drivers/base/core.c index 871e6513a6c8..fe74a786e2c3 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1160,10 +1160,7 @@ static void device_links_flush_sync_list(struct list_head *list, if (dev != dont_lock_dev) device_lock(dev); - if (dev->bus->sync_state) - dev->bus->sync_state(dev); - else if (dev->driver && dev->driver->sync_state) - dev->driver->sync_state(dev); + dev_sync_state(dev); if (dev != dont_lock_dev) device_unlock(dev); -- cgit v1.2.3