From: Adrian Hunter <adrian.hunter@intel.com>
To: "Jorge Marques" <jorge.marques@analog.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Frank Li" <Frank.Li@nxp.com>,
"Przemysław Gaj" <pgaj@cadence.com>
Cc: <linux-i3c@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH 2/5] i3c: master: Move entdaa error suppression
Date: Tue, 10 Mar 2026 21:13:56 +0200 [thread overview]
Message-ID: <648bb51c-6c29-4412-adef-c1915b4f9c8f@intel.com> (raw)
In-Reply-To: <20260308-ad4062-positive-error-fix-v1-2-72d3c5290b4a@analog.com>
On 08/03/2026 18:47, Jorge Marques wrote:
> The CCC ENTDAA is invoked with i3c_master_entdaa_locked and yields
> error I3C_ERROR_M2 if there are no devices active on the bus.
> Some controllers may also yield if there are no more devices need an
> dynamic address, since the sequence do always end in a NACK.
>
> Handle inside i3c_master_entdaa_locked, checking cmd->err directly.
Commit message has the same issues as patch 1
And the pertinent fact that there are only 2 call sites of
i3c_master_entdaa_locked() and both are dealt with.
>
> Signed-off-by: Jorge Marques <jorge.marques@analog.com>
> ---
> drivers/i3c/master.c | 7 +++++--
> drivers/i3c/master/adi-i3c-master.c | 3 +--
> drivers/i3c/master/i3c-master-cdns.c | 2 +-
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 31822fd5ffde..ce1898345810 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -1036,8 +1036,7 @@ static int i3c_master_rstdaa_locked(struct i3c_master_controller *master,
> *
> * This function must be called with the bus lock held in write mode.
> *
> - * Return: 0 in case of success, a positive I3C error code if the error is
> - * one of the official Mx error codes, and a negative error code otherwise.
> + * Return: 0 in case of success, or a negative error code otherwise.
That comment change seems premature. Mx (x!=2) error codes are propagated
until patch 4
> */
> int i3c_master_entdaa_locked(struct i3c_master_controller *master)
> {
> @@ -1050,6 +1049,10 @@ int i3c_master_entdaa_locked(struct i3c_master_controller *master)
> ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
> i3c_ccc_cmd_dest_cleanup(&dest);
>
> + /* No active devices need an address. */
> + if (ret && cmd.err == I3C_ERROR_M2)
> + ret = 0;
> +
> return ret;
> }
> EXPORT_SYMBOL_GPL(i3c_master_entdaa_locked);
> diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c
> index 6616f751075a..fb9a48830446 100644
> --- a/drivers/i3c/master/adi-i3c-master.c
> +++ b/drivers/i3c/master/adi-i3c-master.c
> @@ -655,8 +655,7 @@ static int adi_i3c_master_do_daa(struct i3c_master_controller *m)
>
> writel(irq_mask, master->regs + REG_IRQ_MASK);
>
> - /* DAA always finishes with CE2_ERROR or NACK_RESP */
> - if (ret && ret != I3C_ERROR_M2)
> + if (ret)
> return ret;
>
> /* Add I3C devices discovered */
> diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
> index b78aebf6b2ca..5cfec6761494 100644
> --- a/drivers/i3c/master/i3c-master-cdns.c
> +++ b/drivers/i3c/master/i3c-master-cdns.c
> @@ -1143,7 +1143,7 @@ static int cdns_i3c_master_do_daa(struct i3c_master_controller *m)
> }
>
> ret = i3c_master_entdaa_locked(&master->base);
> - if (ret && ret != I3C_ERROR_M2)
> + if (ret)
> return ret;
>
> newdevs = readl(master->regs + DEVS_CTRL) & DEVS_CTRL_DEVS_ACTIVE_MASK;
>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
WARNING: multiple messages have this Message-ID (diff)
From: Adrian Hunter <adrian.hunter@intel.com>
To: "Jorge Marques" <jorge.marques@analog.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Frank Li" <Frank.Li@nxp.com>,
"Przemysław Gaj" <pgaj@cadence.com>
Cc: <linux-i3c@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH 2/5] i3c: master: Move entdaa error suppression
Date: Tue, 10 Mar 2026 21:13:56 +0200 [thread overview]
Message-ID: <648bb51c-6c29-4412-adef-c1915b4f9c8f@intel.com> (raw)
In-Reply-To: <20260308-ad4062-positive-error-fix-v1-2-72d3c5290b4a@analog.com>
On 08/03/2026 18:47, Jorge Marques wrote:
> The CCC ENTDAA is invoked with i3c_master_entdaa_locked and yields
> error I3C_ERROR_M2 if there are no devices active on the bus.
> Some controllers may also yield if there are no more devices need an
> dynamic address, since the sequence do always end in a NACK.
>
> Handle inside i3c_master_entdaa_locked, checking cmd->err directly.
Commit message has the same issues as patch 1
And the pertinent fact that there are only 2 call sites of
i3c_master_entdaa_locked() and both are dealt with.
>
> Signed-off-by: Jorge Marques <jorge.marques@analog.com>
> ---
> drivers/i3c/master.c | 7 +++++--
> drivers/i3c/master/adi-i3c-master.c | 3 +--
> drivers/i3c/master/i3c-master-cdns.c | 2 +-
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 31822fd5ffde..ce1898345810 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -1036,8 +1036,7 @@ static int i3c_master_rstdaa_locked(struct i3c_master_controller *master,
> *
> * This function must be called with the bus lock held in write mode.
> *
> - * Return: 0 in case of success, a positive I3C error code if the error is
> - * one of the official Mx error codes, and a negative error code otherwise.
> + * Return: 0 in case of success, or a negative error code otherwise.
That comment change seems premature. Mx (x!=2) error codes are propagated
until patch 4
> */
> int i3c_master_entdaa_locked(struct i3c_master_controller *master)
> {
> @@ -1050,6 +1049,10 @@ int i3c_master_entdaa_locked(struct i3c_master_controller *master)
> ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
> i3c_ccc_cmd_dest_cleanup(&dest);
>
> + /* No active devices need an address. */
> + if (ret && cmd.err == I3C_ERROR_M2)
> + ret = 0;
> +
> return ret;
> }
> EXPORT_SYMBOL_GPL(i3c_master_entdaa_locked);
> diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c
> index 6616f751075a..fb9a48830446 100644
> --- a/drivers/i3c/master/adi-i3c-master.c
> +++ b/drivers/i3c/master/adi-i3c-master.c
> @@ -655,8 +655,7 @@ static int adi_i3c_master_do_daa(struct i3c_master_controller *m)
>
> writel(irq_mask, master->regs + REG_IRQ_MASK);
>
> - /* DAA always finishes with CE2_ERROR or NACK_RESP */
> - if (ret && ret != I3C_ERROR_M2)
> + if (ret)
> return ret;
>
> /* Add I3C devices discovered */
> diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
> index b78aebf6b2ca..5cfec6761494 100644
> --- a/drivers/i3c/master/i3c-master-cdns.c
> +++ b/drivers/i3c/master/i3c-master-cdns.c
> @@ -1143,7 +1143,7 @@ static int cdns_i3c_master_do_daa(struct i3c_master_controller *m)
> }
>
> ret = i3c_master_entdaa_locked(&master->base);
> - if (ret && ret != I3C_ERROR_M2)
> + if (ret)
> return ret;
>
> newdevs = readl(master->regs + DEVS_CTRL) & DEVS_CTRL_DEVS_ACTIVE_MASK;
>
next prev parent reply other threads:[~2026-03-10 19:14 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-08 16:47 [PATCH 0/5] Fix paths unexpectedly returning Mx error codes Jorge Marques
2026-03-08 16:47 ` Jorge Marques
2026-03-08 16:47 ` [PATCH 1/5] i3c: master: Move rstdaa error suppression Jorge Marques
2026-03-08 16:47 ` Jorge Marques
2026-03-09 11:39 ` Adrian Hunter
2026-03-09 11:39 ` Adrian Hunter
2026-03-09 12:17 ` Jorge Marques
2026-03-09 12:17 ` Jorge Marques
2026-03-09 12:34 ` Adrian Hunter
2026-03-09 12:34 ` Adrian Hunter
2026-03-10 8:05 ` Jorge Marques
2026-03-10 8:05 ` Jorge Marques
2026-03-10 19:13 ` Adrian Hunter
2026-03-10 19:13 ` Adrian Hunter
2026-03-10 19:13 ` Adrian Hunter
2026-03-10 19:13 ` Adrian Hunter
2026-03-08 16:47 ` [PATCH 2/5] i3c: master: Move entdaa " Jorge Marques
2026-03-08 16:47 ` Jorge Marques
2026-03-10 19:13 ` Adrian Hunter [this message]
2026-03-10 19:13 ` Adrian Hunter
2026-03-08 16:47 ` [PATCH 3/5] i3c: master: Move bus_init " Jorge Marques
2026-03-08 16:47 ` Jorge Marques
2026-03-10 19:14 ` Adrian Hunter
2026-03-10 19:14 ` Adrian Hunter
2026-03-08 16:47 ` [PATCH 4/5] i3c: master: Negative error codes at send_ccc_cmd Jorge Marques
2026-03-08 16:47 ` Jorge Marques
2026-03-10 19:14 ` Adrian Hunter
2026-03-10 19:14 ` Adrian Hunter
2026-03-08 16:47 ` [PATCH 5/5] i3c: master: adi: Return xfer->ret at send CCC Jorge Marques
2026-03-08 16:47 ` Jorge Marques
2026-03-10 19:15 ` Adrian Hunter
2026-03-10 19:15 ` Adrian Hunter
2026-03-12 15:50 ` Jorge Marques
2026-03-12 15:50 ` Jorge Marques
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=648bb51c-6c29-4412-adef-c1915b4f9c8f@intel.com \
--to=adrian.hunter@intel.com \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=dan.carpenter@linaro.org \
--cc=jic23@kernel.org \
--cc=jorge.marques@analog.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pgaj@cadence.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.