Skip to contentSkip to conversation

driver core: fw_devlink: Detect cycles when the supplier never gets a device

RFC PATCH In review Saravana Kannan 2 participants 3 messages Oct 25, 2024 – Oct 26, 2024 Driver core

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 driver core: fw_devlink: Detect cycles when the supplier never gets a device

Sometimes the supplier fwnode never gets a device created for it. Instead, the supplier fwnode is represented by the device that corresponds a parent/ancestor fwnode.

In these cases, we currently don't do any cycle detection because the cycle detection logic is only run when a device link is created between the devices that correspond to the actual consumer and supplier fwnodes.

To detect these cycles correctly, run cycle detection logic even when creating SYNC_STATE_ONLY proxy device links from a device that is the parent of the consumer.

---
Tomi,

I didn't have a chance yet to test this on my end. But I expect that this will allow the display to probe in your single-link case without having to add post-init-providers. You should still add it for better probe/suspend/resume/shutdown ordering.

While you test this, can you also do a diff of with and without this change? It shouldn't have significant differences (other than the ones with actual cycles):

ls -1 /sys/class/devlink

Greg,

This is RFC because I haven't tested it on my end. I need to do that before I'd be okay merging this.

Thanks,
Saravana

 drivers/base/core.c | 45 +++++++++++++++++----------------------------
 1 file changed, 17 insertions(+), 28 deletions(-)
drivers/base/core.c +17 -28
index 3b13fed1c3e3..cf20101c74ac 100644
@@ -1990,10 +1990,10 @@ static struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwn
  *
  * Return true if one or more cycles were found. Otherwise, return false.
  */
-static bool __fw_devlink_relax_cycles(struct device *con,
+static bool __fw_devlink_relax_cycles(struct fwnode_handle *con_handle,
 				 struct fwnode_handle *sup_handle)
 {
-	struct device *sup_dev = NULL, *par_dev = NULL;
+	struct device *sup_dev = NULL, *par_dev = NULL, *con_dev = NULL;
 	struct fwnode_link *link;
 	struct device_link *dev_link;
 	bool ret = false;
@@ -2010,22 +2010,22 @@ static bool __fw_devlink_relax_cycles(struct device *con,
 
 	sup_handle->flags |= FWNODE_FLAG_VISITED;
 
-	sup_dev = get_dev_from_fwnode(sup_handle);
-
 	/* Termination condition. */
-	if (sup_dev == con) {
+	if (sup_handle == con_handle) {
 		pr_debug("----- cycle: start -----\n");
 		ret = true;
 		goto out;
 	}
 
+	sup_dev = get_dev_from_fwnode(sup_handle);
+	con_dev = get_dev_from_fwnode(con_handle);
 	/*
 	 * If sup_dev is bound to a driver and @con hasn't started binding to a
 	 * driver, sup_dev can't be a consumer of @con. So, no need to check
 	 * further.
 	 */
 	if (sup_dev && sup_dev->links.status ==  DL_DEV_DRIVER_BOUND &&
-	    con->links.status == DL_DEV_NO_DRIVER) {
+	    con_dev->links.status == DL_DEV_NO_DRIVER) {
 		ret = false;
 		goto out;
 	}
@@ -2034,7 +2034,7 @@ static bool __fw_devlink_relax_cycles(struct device *con,
 		if (link->flags & FWLINK_FLAG_IGNORE)
 			continue;
 
-		if (__fw_devlink_relax_cycles(con, link->supplier)) {
+		if (__fw_devlink_relax_cycles(con_handle, link->supplier)) {
 			__fwnode_link_cycle(link);
 			ret = true;
 		}
@@ -2049,7 +2049,7 @@ static bool __fw_devlink_relax_cycles(struct device *con,
 	else
 		par_dev = fwnode_get_next_parent_dev(sup_handle);
 
-	if (par_dev && __fw_devlink_relax_cycles(con, par_dev->fwnode)) {
+	if (par_dev && __fw_devlink_relax_cycles(con_handle, par_dev->fwnode)) {
 		pr_debug("%pfwf: cycle: child of %pfwf\n", sup_handle,
 			 par_dev->fwnode);
 		ret = true;
@@ -2067,7 +2067,7 @@ static bool __fw_devlink_relax_cycles(struct device *con,
 		    !(dev_link->flags & DL_FLAG_CYCLE))
 			continue;
 
-		if (__fw_devlink_relax_cycles(con,
+		if (__fw_devlink_relax_cycles(con_handle,
 					      dev_link->supplier->fwnode)) {
 			pr_debug("%pfwf: cycle: depends on %pfwf\n", sup_handle,
 				 dev_link->supplier->fwnode);
@@ -2139,26 +2139,15 @@ static int fw_devlink_create_devlink(struct device *con,
 	    fwnode_is_ancestor_of(sup_handle, con->fwnode))
 		return -EINVAL;
 
-	/*
-	 * SYNC_STATE_ONLY device links don't block probing and supports cycles.
-	 * So, one might expect that cycle detection isn't necessary for them.
-	 * However, if the device link was marked as SYNC_STATE_ONLY because
-	 * it's part of a cycle, then we still need to do cycle detection. This
-	 * is because the consumer and supplier might be part of multiple cycles
-	 * and we need to detect all those cycles.
-	 */
-	if (!device_link_flag_is_sync_state_only(flags) ||
-	    flags & DL_FLAG_CYCLE) {
-		device_links_write_lock();
-		if (__fw_devlink_relax_cycles(con, sup_handle)) {
-			__fwnode_link_cycle(link);
-			flags = fw_devlink_get_flags(link->flags);
-			pr_debug("----- cycle: end -----\n");
-			dev_info(con, "Fixed dependency cycle(s) with %pfwf\n",
-				 sup_handle);
-		}
-		device_links_write_unlock();
+	device_links_write_lock();
+	if (__fw_devlink_relax_cycles(link->consumer, sup_handle)) {
+		__fwnode_link_cycle(link);
+		flags = fw_devlink_get_flags(link->flags);
+		pr_debug("----- cycle: end -----\n");
+		pr_info("%pfwf: Fixed dependency cycle(s) with %pfwf\n",
+			link->consumer, sup_handle);
 	}
+	device_links_write_unlock();
 
 	if (sup_handle->flags & FWNODE_FLAG_NOT_DEVICE)
 		sup_dev = fwnode_get_next_parent_dev(sup_handle);
Signature · 1 line
2.47.0.163.g1226f6d8fa-goog
#1 lore raw
Quoted 72 lines · Saravana Kannan

Sometimes the supplier fwnode never gets a device created for it. Instead, the supplier fwnode is represented by the device that corresponds a parent/ancestor fwnode.

In these cases, we currently don't do any cycle detection because the cycle detection logic is only run when a device link is created between the devices that correspond to the actual consumer and supplier fwnodes.

To detect these cycles correctly, run cycle detection logic even when creating SYNC_STATE_ONLY proxy device links from a device that is the parent of the consumer.

---
Tomi,

I didn't have a chance yet to test this on my end. But I expect that this will allow the display to probe in your single-link case without having to add post-init-providers. You should still add it for better probe/suspend/resume/shutdown ordering.

While you test this, can you also do a diff of with and without this change? It shouldn't have significant differences (other than the ones with actual cycles):

ls -1 /sys/class/devlink

Greg,

This is RFC because I haven't tested it on my end. I need to do that before I'd be okay merging this.

Thanks,
Saravana

 drivers/base/core.c | 45 +++++++++++++++++----------------------------
 1 file changed, 17 insertions(+), 28 deletions(-)
drivers/base/core.c +3 -5
index 3b13fed1c3e3..cf20101c74ac 100644
@@ -1990,10 +1990,10 @@ static struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwn
  *
  * Return true if one or more cycles were found. Otherwise, return false.
  */
-static bool __fw_devlink_relax_cycles(struct device *con,
+static bool __fw_devlink_relax_cycles(struct fwnode_handle *con_handle,
                                 struct fwnode_handle *sup_handle)
 {
-       struct device *sup_dev = NULL, *par_dev = NULL;
+       struct device *sup_dev = NULL, *par_dev = NULL, *con_dev = NULL;
        struct fwnode_link *link;
        struct device_link *dev_link;
        bool ret = false;
@@ -2010,22 +2010,22 @@ static bool __fw_devlink_relax_cycles(struct device *con,
 
        sup_handle->flags |= FWNODE_FLAG_VISITED;
 
-       sup_dev = get_dev_from_fwnode(sup_handle);
-
        /* Termination condition. */
-       if (sup_dev == con) {
+       if (sup_handle == con_handle) {
                pr_debug("----- cycle: start -----\n");
                ret = true;
                goto out;
        }
 

drivers/base/core.c static bool __fw_devlink_relax_cycles(struct device *con, · line 2028

Quoted 10 lines
drivers/base/core.c +3 -1
+       sup_dev = get_dev_from_fwnode(sup_handle);
+       con_dev = get_dev_from_fwnode(con_handle);
        /*
         * If sup_dev is bound to a driver and @con hasn't started binding to a
         * driver, sup_dev can't be a consumer of @con. So, no need to check
         * further.
         */
        if (sup_dev && sup_dev->links.status ==  DL_DEV_DRIVER_BOUND &&
-           con->links.status == DL_DEV_NO_DRIVER) {
+           con_dev->links.status == DL_DEV_NO_DRIVER) {

This needs to be changed to the following to avoid a NULL deref:

con_dev && con_dev->links.status == DL_DEV_NO_DRIVER) {

My preliminary testing looks good. Once I'm happy with my tests, I'll fix this and send out a v2.

Tomi, if this fixes your issue, please give a Tested-by:

-Saravana

Quoted 68 lines
drivers/base/core.c +11 -23
                ret = false;
                goto out;
        }
@@ -2034,7 +2034,7 @@ static bool __fw_devlink_relax_cycles(struct device *con,
                if (link->flags & FWLINK_FLAG_IGNORE)
                        continue;
 
-               if (__fw_devlink_relax_cycles(con, link->supplier)) {
+               if (__fw_devlink_relax_cycles(con_handle, link->supplier)) {
                        __fwnode_link_cycle(link);
                        ret = true;
                }
@@ -2049,7 +2049,7 @@ static bool __fw_devlink_relax_cycles(struct device *con,
        else
                par_dev = fwnode_get_next_parent_dev(sup_handle);
 
-       if (par_dev && __fw_devlink_relax_cycles(con, par_dev->fwnode)) {
+       if (par_dev && __fw_devlink_relax_cycles(con_handle, par_dev->fwnode)) {
                pr_debug("%pfwf: cycle: child of %pfwf\n", sup_handle,
                         par_dev->fwnode);
                ret = true;
@@ -2067,7 +2067,7 @@ static bool __fw_devlink_relax_cycles(struct device *con,
                    !(dev_link->flags & DL_FLAG_CYCLE))
                        continue;
 
-               if (__fw_devlink_relax_cycles(con,
+               if (__fw_devlink_relax_cycles(con_handle,
                                              dev_link->supplier->fwnode)) {
                        pr_debug("%pfwf: cycle: depends on %pfwf\n", sup_handle,
                                 dev_link->supplier->fwnode);
@@ -2139,26 +2139,15 @@ static int fw_devlink_create_devlink(struct device *con,
            fwnode_is_ancestor_of(sup_handle, con->fwnode))
                return -EINVAL;
 
-       /*
-        * SYNC_STATE_ONLY device links don't block probing and supports cycles.
-        * So, one might expect that cycle detection isn't necessary for them.
-        * However, if the device link was marked as SYNC_STATE_ONLY because
-        * it's part of a cycle, then we still need to do cycle detection. This
-        * is because the consumer and supplier might be part of multiple cycles
-        * and we need to detect all those cycles.
-        */
-       if (!device_link_flag_is_sync_state_only(flags) ||
-           flags & DL_FLAG_CYCLE) {
-               device_links_write_lock();
-               if (__fw_devlink_relax_cycles(con, sup_handle)) {
-                       __fwnode_link_cycle(link);
-                       flags = fw_devlink_get_flags(link->flags);
-                       pr_debug("----- cycle: end -----\n");
-                       dev_info(con, "Fixed dependency cycle(s) with %pfwf\n",
-                                sup_handle);
-               }
-               device_links_write_unlock();
+       device_links_write_lock();
+       if (__fw_devlink_relax_cycles(link->consumer, sup_handle)) {
+               __fwnode_link_cycle(link);
+               flags = fw_devlink_get_flags(link->flags);
+               pr_debug("----- cycle: end -----\n");
+               pr_info("%pfwf: Fixed dependency cycle(s) with %pfwf\n",
+                       link->consumer, sup_handle);
        }
+       device_links_write_unlock();
 
        if (sup_handle->flags & FWNODE_FLAG_NOT_DEVICE)
                sup_dev = fwnode_get_next_parent_dev(sup_handle);
--

2.47.0.163.g1226f6d8fa-goog

#2 lore raw
In reply to Saravana Kannan
kernel test robot noticed the following build warnings:

Hi Saravana,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings:

[auto build test WARNING on driver-core/driver-core-testing]
[also build test WARNING on driver-core/driver-core-next driver-core/driver-core-linus linus/master v6.12-rc4 next-20241025] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Saravana-Kannan/driver-core-fw_devlink-Detect-cycles-when-the-supplier-never-gets-a-device/20241026-063850
base:   driver-core/driver-core-testing
patch link:    https://lore.kernel.org/r/20241025223721.184998-1-saravanak%40google.com
patch subject: [RFC PATCH v1] driver core: fw_devlink: Detect cycles when the supplier never gets a device
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20241027/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241027/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/base/core.c:1995: warning: Function parameter or struct member 'con_handle' not described in '__fw_devlink_relax_cycles'
>> drivers/base/core.c:1995: warning: Excess function parameter 'con' description in '__fw_devlink_relax_cycles'

vim +1995 drivers/base/core.c

411c0d58ca6faa Saravana Kannan 2023-02-06  1972  
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  1973  /**
3fb16866b51ded Saravana Kannan 2023-02-06  1974   * __fw_devlink_relax_cycles - Relax and mark dependency cycles.
3fb16866b51ded Saravana Kannan 2023-02-06  1975   * @con: Potential consumer device.
3fb16866b51ded Saravana Kannan 2023-02-06  1976   * @sup_handle: Potential supplier's fwnode.
3fb16866b51ded Saravana Kannan 2023-02-06  1977   *
3fb16866b51ded Saravana Kannan 2023-02-06  1978   * Needs to be called with fwnode_lock and device link lock held.
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  1979   *
3fb16866b51ded Saravana Kannan 2023-02-06  1980   * Check if @sup_handle or any of its ancestors or suppliers direct/indirectly
3fb16866b51ded Saravana Kannan 2023-02-06  1981   * depend on @con. This function can detect multiple cyles between @sup_handle
3fb16866b51ded Saravana Kannan 2023-02-06  1982   * and @con. When such dependency cycles are found, convert all device links
3fb16866b51ded Saravana Kannan 2023-02-06  1983   * created solely by fw_devlink into SYNC_STATE_ONLY device links. Also, mark
3fb16866b51ded Saravana Kannan 2023-02-06  1984   * all fwnode links in the cycle with FWLINK_FLAG_CYCLE so that when they are
3fb16866b51ded Saravana Kannan 2023-02-06  1985   * converted into a device link in the future, they are created as
3fb16866b51ded Saravana Kannan 2023-02-06  1986   * SYNC_STATE_ONLY device links. This is the equivalent of doing
3fb16866b51ded Saravana Kannan 2023-02-06  1987   * fw_devlink=permissive just between the devices in the cycle. We need to do
3fb16866b51ded Saravana Kannan 2023-02-06  1988   * this because, at this point, fw_devlink can't tell which of these
3fb16866b51ded Saravana Kannan 2023-02-06  1989   * dependencies is not a real dependency.
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  1990   *
3fb16866b51ded Saravana Kannan 2023-02-06  1991   * Return true if one or more cycles were found. Otherwise, return false.
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  1992   */
9b8595e1a045f8 Saravana Kannan 2024-10-25  1993  static bool __fw_devlink_relax_cycles(struct fwnode_handle *con_handle,
3fb16866b51ded Saravana Kannan 2023-02-06  1994  				 struct fwnode_handle *sup_handle)
b0e2fa4f611bb9 Saravana Kannan 2020-12-17 @1995  {
9b8595e1a045f8 Saravana Kannan 2024-10-25  1996  	struct device *sup_dev = NULL, *par_dev = NULL, *con_dev = NULL;
3fb16866b51ded Saravana Kannan 2023-02-06  1997  	struct fwnode_link *link;
3fb16866b51ded Saravana Kannan 2023-02-06  1998  	struct device_link *dev_link;
3fb16866b51ded Saravana Kannan 2023-02-06  1999  	bool ret = false;
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2000  
3fb16866b51ded Saravana Kannan 2023-02-06  2001  	if (!sup_handle)
3fb16866b51ded Saravana Kannan 2023-02-06  2002  		return false;
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2003  
3fb16866b51ded Saravana Kannan 2023-02-06  2004  	/*
3fb16866b51ded Saravana Kannan 2023-02-06  2005  	 * We aren't trying to find all cycles. Just a cycle between con and
3fb16866b51ded Saravana Kannan 2023-02-06  2006  	 * sup_handle.
3fb16866b51ded Saravana Kannan 2023-02-06  2007  	 */
3fb16866b51ded Saravana Kannan 2023-02-06  2008  	if (sup_handle->flags & FWNODE_FLAG_VISITED)
3fb16866b51ded Saravana Kannan 2023-02-06  2009  		return false;
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2010  
3fb16866b51ded Saravana Kannan 2023-02-06  2011  	sup_handle->flags |= FWNODE_FLAG_VISITED;
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2012  
3fb16866b51ded Saravana Kannan 2023-02-06  2013  	/* Termination condition. */
9b8595e1a045f8 Saravana Kannan 2024-10-25  2014  	if (sup_handle == con_handle) {
6e7ad1aebb4fc9 Saravana Kannan 2024-02-02  2015  		pr_debug("----- cycle: start -----\n");
3fb16866b51ded Saravana Kannan 2023-02-06  2016  		ret = true;
3fb16866b51ded Saravana Kannan 2023-02-06  2017  		goto out;
3fb16866b51ded Saravana Kannan 2023-02-06  2018  	}
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2019  
9b8595e1a045f8 Saravana Kannan 2024-10-25  2020  	sup_dev = get_dev_from_fwnode(sup_handle);
9b8595e1a045f8 Saravana Kannan 2024-10-25  2021  	con_dev = get_dev_from_fwnode(con_handle);
3fb16866b51ded Saravana Kannan 2023-02-06  2022  	/*
3fb16866b51ded Saravana Kannan 2023-02-06  2023  	 * If sup_dev is bound to a driver and @con hasn't started binding to a
3fb16866b51ded Saravana Kannan 2023-02-06  2024  	 * driver, sup_dev can't be a consumer of @con. So, no need to check
3fb16866b51ded Saravana Kannan 2023-02-06  2025  	 * further.
3fb16866b51ded Saravana Kannan 2023-02-06  2026  	 */
3fb16866b51ded Saravana Kannan 2023-02-06  2027  	if (sup_dev && sup_dev->links.status ==  DL_DEV_DRIVER_BOUND &&
9b8595e1a045f8 Saravana Kannan 2024-10-25  2028  	    con_dev->links.status == DL_DEV_NO_DRIVER) {
3fb16866b51ded Saravana Kannan 2023-02-06  2029  		ret = false;
3fb16866b51ded Saravana Kannan 2023-02-06  2030  		goto out;
3fb16866b51ded Saravana Kannan 2023-02-06  2031  	}
3fb16866b51ded Saravana Kannan 2023-02-06  2032  
3fb16866b51ded Saravana Kannan 2023-02-06  2033  	list_for_each_entry(link, &sup_handle->suppliers, c_hook) {
b7e1241d8f77ed Saravana Kannan 2024-03-04  2034  		if (link->flags & FWLINK_FLAG_IGNORE)
b7e1241d8f77ed Saravana Kannan 2024-03-04  2035  			continue;
b7e1241d8f77ed Saravana Kannan 2024-03-04  2036  
9b8595e1a045f8 Saravana Kannan 2024-10-25  2037  		if (__fw_devlink_relax_cycles(con_handle, link->supplier)) {
3fb16866b51ded Saravana Kannan 2023-02-06  2038  			__fwnode_link_cycle(link);
3fb16866b51ded Saravana Kannan 2023-02-06  2039  			ret = true;
3fb16866b51ded Saravana Kannan 2023-02-06  2040  		}
3fb16866b51ded Saravana Kannan 2023-02-06  2041  	}
3fb16866b51ded Saravana Kannan 2023-02-06  2042  
3fb16866b51ded Saravana Kannan 2023-02-06  2043  	/*
3fb16866b51ded Saravana Kannan 2023-02-06  2044  	 * Give priority to device parent over fwnode parent to account for any
3fb16866b51ded Saravana Kannan 2023-02-06  2045  	 * quirks in how fwnodes are converted to devices.
3fb16866b51ded Saravana Kannan 2023-02-06  2046  	 */
3fb16866b51ded Saravana Kannan 2023-02-06  2047  	if (sup_dev)
3fb16866b51ded Saravana Kannan 2023-02-06  2048  		par_dev = get_device(sup_dev->parent);
3fb16866b51ded Saravana Kannan 2023-02-06  2049  	else
3fb16866b51ded Saravana Kannan 2023-02-06  2050  		par_dev = fwnode_get_next_parent_dev(sup_handle);
3fb16866b51ded Saravana Kannan 2023-02-06  2051  
9b8595e1a045f8 Saravana Kannan 2024-10-25  2052  	if (par_dev && __fw_devlink_relax_cycles(con_handle, par_dev->fwnode)) {
6e7ad1aebb4fc9 Saravana Kannan 2024-02-02  2053  		pr_debug("%pfwf: cycle: child of %pfwf\n", sup_handle,
6e7ad1aebb4fc9 Saravana Kannan 2024-02-02  2054  			 par_dev->fwnode);
3fb16866b51ded Saravana Kannan 2023-02-06  2055  		ret = true;
6e7ad1aebb4fc9 Saravana Kannan 2024-02-02  2056  	}
3fb16866b51ded Saravana Kannan 2023-02-06  2057  
3fb16866b51ded Saravana Kannan 2023-02-06  2058  	if (!sup_dev)
3fb16866b51ded Saravana Kannan 2023-02-06  2059  		goto out;
3fb16866b51ded Saravana Kannan 2023-02-06  2060  
3fb16866b51ded Saravana Kannan 2023-02-06  2061  	list_for_each_entry(dev_link, &sup_dev->links.suppliers, c_node) {
3fb16866b51ded Saravana Kannan 2023-02-06  2062  		/*
3fb16866b51ded Saravana Kannan 2023-02-06  2063  		 * Ignore a SYNC_STATE_ONLY flag only if it wasn't marked as
3fb16866b51ded Saravana Kannan 2023-02-06  2064  		 * such due to a cycle.
3fb16866b51ded Saravana Kannan 2023-02-06  2065  		 */
3fb16866b51ded Saravana Kannan 2023-02-06  2066  		if (device_link_flag_is_sync_state_only(dev_link->flags) &&
3fb16866b51ded Saravana Kannan 2023-02-06  2067  		    !(dev_link->flags & DL_FLAG_CYCLE))
3fb16866b51ded Saravana Kannan 2023-02-06  2068  			continue;
3fb16866b51ded Saravana Kannan 2023-02-06  2069  
9b8595e1a045f8 Saravana Kannan 2024-10-25  2070  		if (__fw_devlink_relax_cycles(con_handle,
3fb16866b51ded Saravana Kannan 2023-02-06  2071  					      dev_link->supplier->fwnode)) {
6e7ad1aebb4fc9 Saravana Kannan 2024-02-02  2072  			pr_debug("%pfwf: cycle: depends on %pfwf\n", sup_handle,
6e7ad1aebb4fc9 Saravana Kannan 2024-02-02  2073  				 dev_link->supplier->fwnode);
3fb16866b51ded Saravana Kannan 2023-02-06  2074  			fw_devlink_relax_link(dev_link);
3fb16866b51ded Saravana Kannan 2023-02-06  2075  			dev_link->flags |= DL_FLAG_CYCLE;
3fb16866b51ded Saravana Kannan 2023-02-06  2076  			ret = true;
3fb16866b51ded Saravana Kannan 2023-02-06  2077  		}
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2078  	}
3fb16866b51ded Saravana Kannan 2023-02-06  2079  
3fb16866b51ded Saravana Kannan 2023-02-06  2080  out:
3fb16866b51ded Saravana Kannan 2023-02-06  2081  	sup_handle->flags &= ~FWNODE_FLAG_VISITED;
3fb16866b51ded Saravana Kannan 2023-02-06  2082  	put_device(sup_dev);
3fb16866b51ded Saravana Kannan 2023-02-06  2083  	put_device(par_dev);
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2084  	return ret;
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2085  }
b0e2fa4f611bb9 Saravana Kannan 2020-12-17  2086  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki