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 v2 3/5] i3c: master: Move bus_init error suppression
Date: Fri, 13 Mar 2026 20:45:10 +0200 [thread overview]
Message-ID: <60121846-a19e-40f4-b626-fecbfce833dc@intel.com> (raw)
In-Reply-To: <20260312-ad4062-positive-error-fix-v2-3-1c933b5c7ed8@analog.com>
On 12/03/2026 18:38, Jorge Marques wrote:
> Prepares to fix improper Mx positive error propagation in later commits
Prepares -> Prepare
> by handling Mx error codes where the i3c_ccc_cmd command is allocated.
> The CCC DISEC to broadcast address is invoked with
> i3c_master_enec_disec_locked() and yields error I3C_ERROR_M2 if there
> are no devices active on the bus. This is expected at the bus
> initialization stage, where it is not known yet that there are no active
> devices on the bus. Add bool suppress_m2 argument to
> i3c_master_enec_disec_locked() and update the call site at
> i3c_master_bus_init() with the exact corner case to not require
> propagating positive Mx error codes. Other call site should not suppress
> the error code, for example, if a driver requests to peripheral to
> disable events and the transfer is not acknowledged, this is an error
> and should not proceed.
>
> Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/i3c/master.c | 23 +++++++++++++++--------
> 1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index d4f9e7df4adc5..bc1189afaed81 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -1059,7 +1059,8 @@ int i3c_master_entdaa_locked(struct i3c_master_controller *master)
> EXPORT_SYMBOL_GPL(i3c_master_entdaa_locked);
>
> static int i3c_master_enec_disec_locked(struct i3c_master_controller *master,
> - u8 addr, bool enable, u8 evts)
> + u8 addr, bool enable, u8 evts,
> + bool suppress_m2)
> {
> struct i3c_ccc_events *events;
> struct i3c_ccc_cmd_dest dest;
> @@ -1079,6 +1080,9 @@ static int i3c_master_enec_disec_locked(struct i3c_master_controller *master,
> ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
> i3c_ccc_cmd_dest_cleanup(&dest);
>
> + if (suppress_m2 && ret && cmd.err == I3C_ERROR_M2)
> + ret = 0;
> +
> return ret;
> }
>
> @@ -1099,7 +1103,7 @@ static int i3c_master_enec_disec_locked(struct i3c_master_controller *master,
> int i3c_master_disec_locked(struct i3c_master_controller *master, u8 addr,
> u8 evts)
> {
> - return i3c_master_enec_disec_locked(master, addr, false, evts);
> + return i3c_master_enec_disec_locked(master, addr, false, evts, false);
> }
> EXPORT_SYMBOL_GPL(i3c_master_disec_locked);
>
> @@ -1120,7 +1124,7 @@ EXPORT_SYMBOL_GPL(i3c_master_disec_locked);
> int i3c_master_enec_locked(struct i3c_master_controller *master, u8 addr,
> u8 evts)
> {
> - return i3c_master_enec_disec_locked(master, addr, true, evts);
> + return i3c_master_enec_disec_locked(master, addr, true, evts, false);
> }
> EXPORT_SYMBOL_GPL(i3c_master_enec_locked);
>
> @@ -2108,11 +2112,14 @@ static int i3c_master_bus_init(struct i3c_master_controller *master)
> goto err_bus_cleanup;
> }
>
> - /* Disable all slave events before starting DAA. */
> - ret = i3c_master_disec_locked(master, I3C_BROADCAST_ADDR,
> - I3C_CCC_EVENT_SIR | I3C_CCC_EVENT_MR |
> - I3C_CCC_EVENT_HJ);
> - if (ret && ret != I3C_ERROR_M2)
> + /*
> + * 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_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;
>
> /*
>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2026-03-13 18:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 16:38 [PATCH v2 0/5] Fix paths unexpectedly returning Mx error codes Jorge Marques
2026-03-12 16:38 ` [PATCH v2 1/5] i3c: master: Move rstdaa error suppression Jorge Marques
2026-03-13 18:43 ` Adrian Hunter
2026-03-18 14:16 ` Frank Li
2026-03-12 16:38 ` [PATCH v2 2/5] i3c: master: Move entdaa " Jorge Marques
2026-03-13 18:43 ` Adrian Hunter
2026-03-18 14:17 ` Frank Li
2026-03-12 16:38 ` [PATCH v2 3/5] i3c: master: Move bus_init " Jorge Marques
2026-03-13 18:45 ` Adrian Hunter [this message]
2026-03-18 14:18 ` Frank Li
2026-03-12 16:38 ` [PATCH v2 4/5] i3c: master: Fix error codes at send_ccc_cmd Jorge Marques
2026-03-13 18:45 ` Adrian Hunter
2026-03-23 16:04 ` Jorge Marques
2026-03-18 14:27 ` Frank Li
2026-03-23 16:04 ` Jorge Marques
2026-03-12 16:38 ` [PATCH v2 5/5] i3c: master: adi: Fix error propagation for CCCs Jorge Marques
2026-03-12 19:58 ` Frank Li
2026-03-13 18:46 ` Adrian Hunter
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=60121846-a19e-40f4-b626-fecbfce833dc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox