From: Meagan Lloyd <meaganlloyd@linux.microsoft.com>
To: Frank Li <Frank.li@nxp.com>
Cc: "David Nyström" <david.nystrom@est.tech>,
"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 v4] i3c: master: Add sysfs option to rescan bus via entdaa
Date: Thu, 5 Feb 2026 14:45:50 -0800 [thread overview]
Message-ID: <9cd39bad-a526-4695-8dfe-5882ad15f4f9@linux.microsoft.com> (raw)
In-Reply-To: <aYTC5uZ8U-BbkPpS@lizhi-Precision-Tower-5810>
On 2/5/2026 8:18 AM, Frank Li wrote:
> On Wed, Feb 04, 2026 at 03:49:35PM -0800, Meagan Lloyd wrote:
>> On 1/26/2026 6:50 PM, Meagan Lloyd wrote:
>>> On 1/26/2026 9:18 AM, Frank Li wrote:
>>>> On Mon, Jan 26, 2026 at 09:37:01AM +0100, David Nyström wrote:
>>>>> Allow userspace to request dynamic address assignment, which is
>>>>> useful for i3cdev devices with broken hot-join support.
>>>>> This will assign dynamic addresses to all devices on the I3C bus
>>>>> which are currently unassigned.
>>>> Reviewed-by: Frank Li <Frank.Li@nxp.com>
>>>>> Signed-off-by: David Nyström <david.nystrom@est.tech>
>>>>> ---
>>>>> Changes in v4:
>>>>> - Improved commit message, once more. Comment: Frank Li
>>>>> - Added required documentation for sysfs addition. Comment: Frank Li
>>>>> - Link to v3: https://patch.msgid.link/20260123-i3c_rescan-v3-1-026429fa0c65@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
>>>>> ---
>>>>> Documentation/ABI/testing/sysfs-bus-i3c | 19 +++++++++++++++++++
>>>>> drivers/i3c/master.c | 24 ++++++++++++++++++++++++
>>>>> 2 files changed, 43 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/ABI/testing/sysfs-bus-i3c b/Documentation/ABI/testing/sysfs-bus-i3c
>>>>> index c1e048957a01..040824ac7401 100644
>>>>> --- a/Documentation/ABI/testing/sysfs-bus-i3c
>>>>> +++ b/Documentation/ABI/testing/sysfs-bus-i3c
>>>>> @@ -172,3 +172,22 @@ Description:
>>>>> the automatic retries. Exist only when I3C constroller supports
>>>>> this retry on nack feature.
>>>>>
>>>>> +What: /sys/bus/i3c/devices/i3c-<bus-id>/entdaa
>>>>> +KernelVersion: 6.20
>>>>> +Contact: linux-i3c@vger.kernel.org
>>>>> +Description:
>>>>> + Write-only attribute that triggers a Dynamic Address Assignment
>>>>> + (DAA) procedure which discovers new I3C devices on the bus.
>>>>> + Writing any non-zero value to this attribute
>>>>> + causes the master controller to broadcast an ENTDAA
>>>>> + (Enter Dynamic Address Assignment) Common Command Code(CCC) on
>>>>> + the bus.
>>>>> +
>>>>> + This is useful for discovering I3C devices that were not present
>>>>> + during initial bus initialization and are unable to issue
>>>>> + Hot-Join. Only devices without a currently assigned dynamic address
>>>>> + will respond to the ENTDAA broadcast and be assigned addresses.
>>>>> +
>>>>> + Note that this mechanism is distinct from Hot-Join, since this is
>>>>> + controller-initiated discovery, while Hot-Join is device-initiated
>>>>> + method to provoke controller discovery procedure.
>>>>> 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;
>>>>> + }
>>>>> +
>>> Why not use kstrtobool and return -EINVAL for inputs that evaluate to false?
>>>
>>>>> + 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,
>>> Is 'entdaa' the best naming here? Keeping it general i.e. 'daa' or 'trigger_daa' would be more flexible/extensible in my opinion.
>> On second thought, I guess this sysfs attribute doesn't need to be extensible. For example, if a need arises to issue SETDASA or SETAASA before ENTDAA is issued, we'd create separate sysfs attributes for those & they could be used beforehand.
>>
>> Indeed, it does seem that .do_daa is intended for the ENTDAA mechanism in Dynamic Address Assignment. My suggestion would still be for a generic naming like 'daa' rather than a direct reference to the ENTDAA CCC since other CCCs can still happen on the code path depending on the controller driver's implementation. For example, other CCCs on the path currently include SETNEWDA, DEFSLVS, ENEC. What are your thoughts?
> I vote do_daa, which is easy to understand by user who has less i3c background
> knowledge.
I like your suggestion. do_daa is straightforward and appropriate since
that's the function that is directly called here.
> Please wrap your reply.
ack, thank you!
Meagan
>
> Frank
>> Meagan
>>
>>>>> NULL,
>>>>> };
>>>>> ATTRIBUTE_GROUPS(i3c_masterdev);
>>>>>
>>>>> ---
>>>>> base-commit: e3b32dcb9f23e3c3927ef3eec6a5842a988fb574
>>>>> change-id: 20260116-i3c_rescan-4921d0b41a00
>>>>>
>>>>> Best regards,
>>>>> --
>>>>> David Nyström <david.nystrom@est.tech>
>>>>>
>>>>>
>>>>> --
>>>>> linux-i3c mailing list
>>>>> linux-i3c@lists.infradead.org
>>>>> http://lists.infradead.org/mailman/listinfo/linux-i3c
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
prev parent reply other threads:[~2026-02-05 22:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 8:37 [PATCH v4] i3c: master: Add sysfs option to rescan bus via entdaa David Nyström
2026-01-26 17:18 ` Frank Li
2026-01-27 2:50 ` Meagan Lloyd
2026-02-04 23:49 ` Meagan Lloyd
2026-02-05 16:18 ` Frank Li
2026-02-05 22:45 ` Meagan Lloyd [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=9cd39bad-a526-4695-8dfe-5882ad15f4f9@linux.microsoft.com \
--to=meaganlloyd@linux.microsoft.com \
--cc=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