mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: "David Nyström" <david.nystrom@est.tech>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org,
	Joshua Yeong <joshua.yeong@starfivetech.com>
Subject: Re: [PATCH v3] i3c: master: Add sysfs option to rescan bus via entdaa
Date: Fri, 23 Jan 2026 11:19:07 -0500	[thread overview]
Message-ID: <aXOfe/T0gPPbTiHx@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260123-i3c_rescan-v3-1-026429fa0c65@est.tech>

On Fri, Jan 23, 2026 at 08:55:37AM +0100, David Nyström wrote:
> Add the ability to rescan the i3c bus from userspace, i.e. provoke
> an ENTDDA. The usecase could be f.ex. an i3cdev userspace driver
> for a device with broken hotjoin support. If the i3c device
> boots slowly, it might be miss the DDA during boot.

AI helpped rephrase

Allow userspace to request a dynamic address assignment, which is
useful for devices with broken hot-join support or devices that boot
slowly and may miss the initial DDA during system startup.

Need update ABI document

Documentation/ABI/testing/sysfs-bus-i3c

Frank
>
> Signed-off-by: David Nyström <david.nystrom@est.tech>
> ---
> Changes in v3:
> - Rename sysfs entry from rescan to entdda, Comment: Joshua Yeong
> - Link to v2: https://patch.msgid.link/20260122-i3c_rescan-v2-1-84c74a483f03@est.tech
>
> Changes in v2:
> - Improved the commit message with "why".
> - Link to v1: https://patch.msgid.link/20260122-i3c_rescan-v1-1-0c17071e232b@est.tech
> ---
>  drivers/i3c/master.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 80dda0e85558..a1d816634a25 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -758,6 +758,29 @@ static ssize_t dev_nack_retry_count_store(struct device *dev,
>
>  static DEVICE_ATTR_RW(dev_nack_retry_count);
>
> +static ssize_t entdaa_store(struct device *dev,
> +			    struct device_attribute *attr,
> +			    const char *buf, size_t count)
> +{
> +	struct i3c_master_controller *master = dev_to_i3cmaster(dev);
> +	unsigned long val;
> +	int ret;
> +
> +	ret = kstrtoul(buf, 0, &val);
> +	if (ret)
> +		return ret;
> +
> +	if (val) {
> +		ret = i3c_master_do_daa(master);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	return count;
> +}
> +
> +static DEVICE_ATTR_WO(entdaa);
> +
>  static struct attribute *i3c_masterdev_attrs[] = {
>  	&dev_attr_mode.attr,
>  	&dev_attr_current_master.attr,
> @@ -769,6 +792,7 @@ static struct attribute *i3c_masterdev_attrs[] = {
>  	&dev_attr_dynamic_address.attr,
>  	&dev_attr_hdrcap.attr,
>  	&dev_attr_hotjoin.attr,
> +	&dev_attr_entdaa.attr,
>  	NULL,
>  };
>  ATTRIBUTE_GROUPS(i3c_masterdev);
>
> ---
> base-commit: e3b32dcb9f23e3c3927ef3eec6a5842a988fb574
> change-id: 20260116-i3c_rescan-4921d0b41a00
>
> Best regards,
> --
> David Nyström <david.nystrom@est.tech>
>

      reply	other threads:[~2026-01-23 16:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23  7:55 David Nyström
2026-01-23 16:19 ` Frank Li [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=aXOfe/T0gPPbTiHx@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=david.nystrom@est.tech \
    --cc=joshua.yeong@starfivetech.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.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®