From: sashiko-bot@kernel.org
To: "Xu Yang" <xu.yang_2@nxp.com>
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH] driver core: avoid repeatedly printing the same 'Fixed dependency' log
Date: Sat, 09 May 2026 11:43:15 +0000 [thread overview]
Message-ID: <20260509114316.13B4AC2BCB2@smtp.kernel.org> (raw)
In-Reply-To: <20260509111728.4123331-1-xu.yang_2@nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Moving `pr_info()` into `__fwnode_link_cycle()` causes log spam and highly misleading dependency cycle logs during initial cycle detection.
--
commit b7864d7a5daadca2b750e1e3f78ba9cec6f247d5
Author: Xu Yang <xu.yang_2@nxp.com>
driver core: avoid repeatedly printing the same 'Fixed dependency' log
This commit attempts to deduplicate "Fixed dependency cycle" logs by moving
the print statement into __fwnode_link_cycle() and gating it behind the
FWLINK_FLAG_CYCLE flag check.
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -127,7 +127,13 @@ static void __fwnode_link_cycle(struct fwnode_link *link)
> {
> pr_debug("%pfwf: cycle: depends on %pfwf\n",
> link->consumer, link->supplier);
> +
> + if (link->flags & FWLINK_FLAG_CYCLE)
> + return;
> +
> link->flags |= FWLINK_FLAG_CYCLE;
> + pr_info("%pfwf: Fixed dependency cycle(s) with %pfwf\n",
> + link->consumer, link->supplier);
> }
When moving this pr_info() into __fwnode_link_cycle(), does this cause the
log to be printed for every intermediate edge in the cycle?
__fw_devlink_relax_cycles() unwinds the recursion and calls
__fwnode_link_cycle() for each link involved in the cycle:
__fw_devlink_relax_cycles() {
...
list_for_each_entry(link, &sup_handle->suppliers, c_hook) {
if (link->flags & FWLINK_FLAG_IGNORE)
continue;
if (__fw_devlink_relax_cycles(con_handle, link->supplier)) {
__fwnode_link_cycle(link);
ret = true;
}
}
...
}
Because of this recursive unwinding, won't this change print the
"Fixed dependency cycle(s)" message for every node involved in a newly
detected cycle, rather than just the specific link that closed it?
Could this lead to more confusing log spam by flagging older, valid
dependencies as the source of the cycle?
[ ... ]
> @@ -2140,8 +2146,6 @@ static int fw_devlink_create_devlink(struct device *con,
> if (__fw_devlink_relax_cycles(link->consumer, sup_handle)) {
> __fwnode_link_cycle(link);
> pr_debug("----- cycle: end -----\n");
> - pr_info("%pfwf: Fixed dependency cycle(s) with %pfwf\n",
> - link->consumer, sup_handle);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260509111728.4123331-1-xu.yang_2@nxp.com?part=1
prev parent reply other threads:[~2026-05-09 11:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-09 11:17 [PATCH] driver core: avoid repeatedly printing the same 'Fixed dependency' log Xu Yang
2026-05-09 11:43 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260509114316.13B4AC2BCB2@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko@lists.linux.dev \
--cc=xu.yang_2@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox