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: Improve logs for cycle detection

The links in a cycle are not all logged in a consistent manner or not
logged at all. Make them consistent by adding a "cycle:" string and log all
the link in the cycles (even the child ==> parent dependency) so that it's
easier to debug cycle detection code. Also, mark the start and end of a
cycle so it's easy to tell when multiple cycles are logged back to back.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Tested-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://lore.kernel.org/r/20240202095636.868578-4-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Saravana Kannan and committed by
Greg Kroah-Hartman
6e7ad1ae 6442d79d

+9 -2
+9 -2
drivers/base/core.c
··· 125 125 */ 126 126 static void __fwnode_link_cycle(struct fwnode_link *link) 127 127 { 128 - pr_debug("%pfwf: Relaxing link with %pfwf\n", 128 + pr_debug("%pfwf: cycle: depends on %pfwf\n", 129 129 link->consumer, link->supplier); 130 130 link->flags |= FWLINK_FLAG_CYCLE; 131 131 } ··· 1945 1945 1946 1946 /* Termination condition. */ 1947 1947 if (sup_dev == con) { 1948 + pr_debug("----- cycle: start -----\n"); 1948 1949 ret = true; 1949 1950 goto out; 1950 1951 } ··· 1977 1976 else 1978 1977 par_dev = fwnode_get_next_parent_dev(sup_handle); 1979 1978 1980 - if (par_dev && __fw_devlink_relax_cycles(con, par_dev->fwnode)) 1979 + if (par_dev && __fw_devlink_relax_cycles(con, par_dev->fwnode)) { 1980 + pr_debug("%pfwf: cycle: child of %pfwf\n", sup_handle, 1981 + par_dev->fwnode); 1981 1982 ret = true; 1983 + } 1982 1984 1983 1985 if (!sup_dev) 1984 1986 goto out; ··· 1997 1993 1998 1994 if (__fw_devlink_relax_cycles(con, 1999 1995 dev_link->supplier->fwnode)) { 1996 + pr_debug("%pfwf: cycle: depends on %pfwf\n", sup_handle, 1997 + dev_link->supplier->fwnode); 2000 1998 fw_devlink_relax_link(dev_link); 2001 1999 dev_link->flags |= DL_FLAG_CYCLE; 2002 2000 ret = true; ··· 2078 2072 if (__fw_devlink_relax_cycles(con, sup_handle)) { 2079 2073 __fwnode_link_cycle(link); 2080 2074 flags = fw_devlink_get_flags(link->flags); 2075 + pr_debug("----- cycle: end -----\n"); 2081 2076 dev_info(con, "Fixed dependency cycle(s) with %pfwf\n", 2082 2077 sup_handle); 2083 2078 }