From: Greg KH <gregkh@linuxfoundation.org>
To: Wang Wensheng <wangwensheng4@huawei.com>
Cc: rafael@kernel.org, dakr@kernel.org, tglx@linutronix.de,
saravanak@google.com, robh@kernel.org, broonie@kernel.org,
linux-kernel@vger.kernel.org, chenjun102@huawei.com
Subject: Re: [PATCH 2/3] driver core: Introduce fw_devlink_relax_consumers helper
Date: Thu, 14 Aug 2025 13:39:02 +0200 [thread overview]
Message-ID: <2025081429-lair-esophagus-eb8b@gregkh> (raw)
In-Reply-To: <20250814111023.2693-3-wangwensheng4@huawei.com>
On Thu, Aug 14, 2025 at 07:10:22PM +0800, Wang Wensheng wrote:
> Some devices are added during its parent's probe and will never get
> bound to a driver. In this case, with fw_devlink set to "rpm",
> which is the default value, its consumers will be deferred probe
> until deferred_probe_timeout when fw_devlink_drivers_done() would
> relax the devlinks to the suplier.
>
> Use this function to relax the consumer devlinks, just like what we
> do for the unmatched devices in fw_devlink_drivers_done(), so that
> the consumer devices would be probed not that later.
>
> Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
> ---
> drivers/base/core.c | 22 ++++++++++++++++++++++
> include/linux/device.h | 1 +
> 2 files changed, 23 insertions(+)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index d22d6b23e758..2f7101ad9d11 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1754,6 +1754,28 @@ static void fw_devlink_relax_link(struct device_link *link)
> dev_name(link->supplier));
> }
>
> +/**
> + * fw_devlink_relax_consumers - Relax the devlinks with all its consumers
> + * @dev: Device whose consumer devlinks will be relaxed
> + *
> + * Some devices are added during its parent's probe and will never get bound
> + * to a driver. In this case its consumers will be deferred probe until
> + * deferred_probe_timeout.
> + *
> + * Use this function to relax the consumer devlinks so that the consumers
> + * device would be probed not that later.
> + */
> +void fw_devlink_relax_consumers(struct device *dev)
> +{
> + struct device_link *link;
> +
> + device_links_write_lock();
> + list_for_each_entry(link, &dev->links.consumers, s_node)
> + fw_devlink_relax_link(link);
> + device_links_write_unlock();
> +}
> +EXPORT_SYMBOL_GPL(fw_devlink_relax_consumers);
We currently do not export any "fw_" functions from the driver core, why
do that now? This feels wrong as this should all be "internal" to the
driver core, no driver should be calling this.
thanks,
greg k-h
next prev parent reply other threads:[~2025-08-14 11:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 11:10 [PATCH 0/3] Fix issues for device probe Wang Wensheng
2025-08-14 11:10 ` [PATCH 1/3] driver core: Fix concurrent problem of deferred_probe_extend_timeout() Wang Wensheng
2025-08-14 11:37 ` Greg KH
2025-08-14 12:45 ` wangwensheng (C)
2025-08-14 11:37 ` Greg KH
2025-08-14 11:10 ` [PATCH 2/3] driver core: Introduce fw_devlink_relax_consumers helper Wang Wensheng
2025-08-14 11:39 ` Greg KH [this message]
2025-08-14 17:54 ` Saravana Kannan
2025-08-14 11:10 ` [PATCH 3/3] irqchip/mbigen: Use fw_devlink_relax_consumers() helper Wang Wensheng
2025-08-14 11:39 ` Greg KH
2025-08-14 18:05 ` Saravana Kannan
2025-08-15 2:15 ` wangwensheng (C)
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=2025081429-lair-esophagus-eb8b@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=chenjun102@huawei.com \
--cc=dakr@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=tglx@linutronix.de \
--cc=wangwensheng4@huawei.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
all inboxes | Powered by JetHome®