mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Defa Li (李德发)" <Defa.Li@mediatek.com>
To: Mukesh Savaliya <mukesh.savaliya@oss.qualcomm.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Frank Li <Frank.Li@nxp.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>
Cc: "linux-i3c@lists.infradead.org" <linux-i3c@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	wsd_upstream <wsd_upstream@mediatek.com>,
	"Mingchang Jia (贾明昌)" <Mingchang.Jia@mediatek.com>,
	"Yuhan Wei (魏玉晗)" <Yuhan.Wei@mediatek.com>,
	"Hao Lin (林浩)" <Hao.Lin@mediatek.com>
Subject: Re: [PATCH] i3c: master: Disable slave events before RSTDAA
Date: Fri, 27 Nov 2026 08:17:31 +0000	[thread overview]
Message-ID: <81fb06c49403d1c1e577d846ed5d8f0b266eb194.camel@mediatek.com> (raw)

Hi Mukesh,

On Thu, 2026-11-19 at 12:41 +0530, Mukesh Savaliya wrote:
> 
> External email : Please do not click links or open attachments until you
> have verified the sender or the content.
> 
> 
> On 11/6/2026 11:52 AM, Defa Li wrote:
> > Bus initialization sends RSTDAA before disabling slave events. A hot-
> > join
> > or other slave event may occur after RSTDAA and interfere with the
> > following DISEC command or the remaining initialization.
> > 
> > Send broadcast DISEC before RSTDAA to disable SIR, master request, and
> > hot-join events before resetting dynamic addresses. This prevents
> > slave
> > events from disrupting bus initialization.
> > 
> 
> While the sequence you suggested making sense to me, but i am wondering
> before bus_init, are there really a target device getting powered up who
> can generate hotjoin ?
> 
> MY understanding is, post master registration and bus_init only target
> devices should start life, isn't it ?
> 

This patch is not intended to address any target device behaviors that
occur before bus_init itself.

Our actual hardware testing revealed that some target devices will
actively trigger a Hot-Join request within a short window after receiving
the RSTDAA CCC. By sending the broadcast DISEC first, we ensure that no
such Hot-Join requests can be fired after RSTDAA, successfully preventing
this issue.

Therefore, sending broadcast DISEC before RSTDAA makes the entire
initialization sequence much more robust.

> 
> > Signed-off-by: Defa Li <defa.li@mediatek.com>
> > ---
> >   drivers/i3c/master.c | 16 ++++++++--------
> >   1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> > index 01e05bad8661..4fdc8f721364 100644
> > --- a/drivers/i3c/master.c
> > +++ b/drivers/i3c/master.c
> > @@ -2571,10 +2571,12 @@ static int i3c_master_bus_init(struct
> > i3c_master_controller *master)
> >       }
> > 
> >       /*
> > -      * Reset all dynamic address that may have been assigned before
> > -      * (assigned by the bootloader for example).
> > +      * Disable all slave events before starting DAA. When no active
> > device
> > +      * is on the bus, returns Mx error code M2, this error is
> > ignored.
> >        */
> > -     ret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR);
> > +     ret = i3c_master_enec_disec_locked(master, I3C_BROADCAST_ADDR,
> > false,
> > +                                        I3C_CCC_EVENT_SIR |
> > I3C_CCC_EVENT_MR |
> > +                                        I3C_CCC_EVENT_HJ, true);
> >       if (ret)
> >               goto err_bus_cleanup;
> > 
> > @@ -2585,12 +2587,10 @@ static int i3c_master_bus_init(struct
> > i3c_master_controller *master)
> >       }
> > 
> >       /*
> > -      * Disable all slave events before starting DAA. When no active
> > device
> > -      * is on the bus, returns Mx error code M2, this error is
> > ignored.
> > +      * Reset all dynamic address that may have been assigned before
> > +      * (assigned by the bootloader for example).
> >        */
> > -     ret = i3c_master_enec_disec_locked(master, I3C_BROADCAST_ADDR,
> > false,
> > -                                        I3C_CCC_EVENT_SIR |
> > I3C_CCC_EVENT_MR |
> > -                                        I3C_CCC_EVENT_HJ, true);
> > +     ret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR);
> >       if (ret)
> >               goto err_bus_cleanup;
> > 
> 

Thanks,
Defa


             reply	other threads:[~2026-11-27  8:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  8:17 Defa Li (李德发) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-11-06  6:22 Defa Li
2026-11-19  7:11 ` Mukesh Savaliya
2026-11-23 19:54 ` Frank Li

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=81fb06c49403d1c1e577d846ed5d8f0b266eb194.camel@mediatek.com \
    --to=defa.li@mediatek.com \
    --cc=Frank.Li@nxp.com \
    --cc=Hao.Lin@mediatek.com \
    --cc=Mingchang.Jia@mediatek.com \
    --cc=Yuhan.Wei@mediatek.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mukesh.savaliya@oss.qualcomm.com \
    --cc=wsd_upstream@mediatek.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®