mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arun Iyengar via B4 Relay <devnull+aiyengar1990.gmail.com@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 "Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	 Johan Hovold <johan@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>
Cc: driver-core@lists.linux.dev, linux-kernel@vger.kernel.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: [PATCH] driver core: fw_devlink: Don't report refused sync_state-only links as errors
Date: Tue, 10 Nov 2026 07:11:59 +0000	[thread overview]
Message-ID: <20261110-fw-devlink-sync-state-v1-1-6385be961c2b@gmail.com> (raw)

From: Arun Iyengar <aiyengar1990@gmail.com>

A SYNC_STATE_ONLY device link is refused by device_link_add() once the
consumer has already probed, since such a link only orders sync_state()
callbacks and would be useless. This legitimately happens when a consumer
that probes early (for example the Rockchip power domain provider, whose
domains reference a PMIC regulator through domain-supply) is inferred to
depend on a supplier device that is added later, and results in boot-time
"Failed to create device link (0x180)" errors for a harmless condition.

Log the refusal of a sync_state-only link at debug level and keep the error
for links that matter for probe ordering.

Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
Tested on an Orange Pi 5 (RK3588S): the three "Failed to create device
link (0x180)" lines that the Rockchip power controller logged on every
boot (suppliers: the RK806 PMIC on SPI and an RK8602 on I2C, referenced
through domain-supply of two of its power domains) are gone, and the
regulators are still acquired and held by those domains.

This patch was developed with Claude (Anthropic) as a coding assistant:
it wrote the code and the commit message, and I reviewed and tested it
as described above.
---
 drivers/base/core.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index bf97b06337a1..4cdfc156ffbc 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2241,8 +2241,20 @@ static int fw_devlink_create_devlink(struct device *con,
 		}
 
 		if (con != sup_dev && !device_link_add(con, sup_dev, flags)) {
-			dev_err(con, "Failed to create device link (0x%x) with supplier %s for %pfwf\n",
-				flags, dev_name(sup_dev), link->consumer);
+			/*
+			 * A SYNC_STATE_ONLY link only orders sync_state() and
+			 * is refused once the consumer has probed. That is
+			 * expected when a consumer that probes early (e.g. a
+			 * power domain provider referencing a regulator
+			 * supplier that is added later) is linked to a late
+			 * supplier, so don't report it as an error.
+			 */
+			if (device_link_flag_is_sync_state_only(flags))
+				dev_dbg(con, "Not creating sync_state-only device link (0x%x) with supplier %s for %pfwf\n",
+					flags, dev_name(sup_dev), link->consumer);
+			else
+				dev_err(con, "Failed to create device link (0x%x) with supplier %s for %pfwf\n",
+					flags, dev_name(sup_dev), link->consumer);
 			ret = -EINVAL;
 		}
 

---
base-commit: ec1db86e7bb3ec13c90456efac43659a723ac068
change-id: 20261110-fw-devlink-sync-state-f71babbf968b

Best regards,
--  
Arun Iyengar <aiyengar1990@gmail.com>



                 reply	other threads:[~2026-11-10  7:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261110-fw-devlink-sync-state-v1-1-6385be961c2b@gmail.com \
    --to=devnull+aiyengar1990.gmail.com@kernel.org \
    --cc=aiyengar1990@gmail.com \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=johan@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=rafael@kernel.org \
    /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

all inboxes | Powered by JetHome®