CIP-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S
@ 2026-11-17 11:48 Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 01/34] i3c: master: Add i3c_master_do_daa_ext() for post-hibernation address recovery Claudiu Beznea
                   ` (29 more replies)
  0 siblings, 30 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

Hi,

Series backports the I3C support for the Renesas RZ/G3S.

Please provide your feedback.

Thank you,
Claudiu

Adrian Hunter (1):
  i3c: master: Add i3c_master_do_daa_ext() for post-hibernation address
    recovery

Biju Das (2):
  pinctrl: renesas: rzg2l: Make QSPI register handling conditional
  arm64: dts: renesas: r9a08g045: Move max-frequency to SoC dtsi

Claudiu Beznea (24):
  i3c: renesas: Check that the transfer is valid before accessing it
  i3c: renesas: Restore STDBR and EXTBR registers on resume
  i3c: renesas: Follow the reset deassert order used in probe
  i3c: renesas: Reconfigure the DATBAS register on re-attach
  i3c: renesas: Reset the controller on resume
  i3c: renesas: Perform Dynamic Address Assignment on resume
  i3c: renesas: Clean DATBAS register on detach
  i3c: renesas: Fix out-of-bounds access for newdevs mask
  i3c: renesas: Use reset_control_bulk_{assert, deassert}()
  i3c: renesas: Return immediately if there is no transfer
  i3c: renesas: Follow a unified pattern for transfer and command
    initialization
  i3c: renesas: Drop the explicit memset() call
  i3c: renesas: Update HW registers after SW computations are done
  i3c: renesas: Organize structures to avoid unnecessary padding
  i3c: renesas: Use the "dev_name:irq_name" format for the interrupt
    name
  i3c: renesas: Drop unnecessary tab
  i3c: renesas: Add runtime PM support
  i3c: renesas: Drop unused structure member 'resuming'
  pinctrl: renesas: rzg2l: Keep member documentation aligned
  pinctrl: renesas: rzg2l: Generalize power source code
  pinctrl: renesas: rzg2l: Drop defines present in struct rzg2l_hwcfg
  pinctrl: renesas: rzg2l: Unify power source handling
  pinctrl: renesas: rzg2l: Add RZ/G3S support for selecting I3C power
    source
  arm64: dts: renesas: rzg3s-smarc-som: Enable I3C

Felix Gu (1):
  i3c: master: renesas: Use __free(kfree) for xfer cleanup in
    renesas_i3c_send_ccc_cmd()

Geert Uytterhoeven (2):
  pinctrl: renesas: rzg2l: Fix type in .pin_config_group_get() callback
  arm64: dts: renesas: r9a08g045: Add missing hypervisor virtual timer
    IRQ

Kuninori Morimoto (1):
  arm64: dts: renesas: r9a08g045: Move interrupt-parent to root node

Quynh Nguyen (1):
  arm64: dts: renesas: r9a08g045: Add I3C node

Tommaso Merciai (1):
  i3c: renesas: Don't register devices when ENTDAA times out

Wolfram Sang (1):
  clk: renesas: r9a08g045: Add I3C clocks and resets

 arch/arm64/boot/dts/renesas/r9a08g045.dtsi    |  52 ++-
 .../boot/dts/renesas/rzg3s-smarc-som.dtsi     |  21 +-
 .../boot/dts/renesas/rzg3s-smarc-switches.h   |   4 +
 arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi  |   1 -
 drivers/clk/renesas/r9a08g045-cpg.c           |   7 +
 drivers/i3c/master.c                          |  44 ++
 drivers/i3c/master/renesas-i3c.c              | 429 ++++++++++++------
 drivers/pinctrl/renesas/pinctrl-rzg2l.c       | 285 ++++++++----
 include/linux/i3c/master.h                    |   1 +
 9 files changed, 623 insertions(+), 221 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 01/34] i3c: master: Add i3c_master_do_daa_ext() for post-hibernation address recovery
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 02/34] i3c: master: renesas: Use __free(kfree) for xfer cleanup in renesas_i3c_send_ccc_cmd() Claudiu Beznea
                   ` (28 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Adrian Hunter <adrian.hunter@intel.com>

commit c481ef12e713fb7c292d04f53b3532ac0804ab3d upstream.

After system hibernation, I3C Dynamic Addresses may be reassigned at boot
and no longer match the values recorded before suspend. Introduce
i3c_master_do_daa_ext() to handle this situation.

The restore procedure is straightforward: issue a Reset Dynamic Address
Assignment (RSTDAA), then run the standard DAA sequence. The existing DAA
logic already supports detecting and updating devices whose dynamic
addresses differ from previously known values.

Refactor the DAA path by introducing a shared helper used by both the
normal i3c_master_do_daa() path and the new extended restore function,
and correct the kernel-doc in the process.

Export i3c_master_do_daa_ext() so that master drivers can invoke it from
their PM restore callbacks.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260123063325.8210-2-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[claudiu.beznea:
 - kept the i3c_master_do_daa() definition untouched
 - dropped i3c_master_rpm_{get,put}() from i3c_master_do_daa_ext()
   implementation since there is no rpm code implemented in the bus code
   from v6.1 CIP]
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master.c       | 44 ++++++++++++++++++++++++++++++++++++++
 include/linux/i3c/master.h |  1 +
 2 files changed, 45 insertions(+)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 6767232dcb3e..d5fb2adf5565 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1651,6 +1651,50 @@ i3c_master_register_new_i3c_devs(struct i3c_master_controller *master)
 	}
 }
 
+/**
+ * i3c_master_do_daa_ext() - Dynamic Address Assignment (extended version)
+ * @master: controller
+ * @rstdaa: whether to first perform Reset of Dynamic Addresses (RSTDAA)
+ *
+ * Perform Dynamic Address Assignment with optional support for System
+ * Hibernation (@rstdaa is true).
+ *
+ * After System Hibernation, Dynamic Addresses can have been reassigned at boot
+ * time to different values. A simple strategy is followed to handle that.
+ * Perform a Reset of Dynamic Addresses (RSTDAA) followed by the normal DAA
+ * procedure which has provision for reassigning addresses that differ from the
+ * previously recorded addresses.
+ *
+ * Return: a 0 in case of success, an negative error code otherwise.
+ */
+int i3c_master_do_daa_ext(struct i3c_master_controller *master, bool rstdaa)
+{
+	int rstret = 0;
+	int ret;
+
+	i3c_bus_maintenance_lock(&master->bus);
+
+	if (rstdaa) {
+		rstret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR);
+		if (rstret == I3C_ERROR_M2)
+			rstret = 0;
+	}
+
+	ret = master->ops->do_daa(master);
+
+	i3c_bus_maintenance_unlock(&master->bus);
+
+	if (ret)
+		return ret;
+
+	i3c_bus_normaluse_lock(&master->bus);
+	i3c_master_register_new_i3c_devs(master);
+	i3c_bus_normaluse_unlock(&master->bus);
+
+	return rstret ?: ret;
+}
+EXPORT_SYMBOL_GPL(i3c_master_do_daa_ext);
+
 /**
  * i3c_master_do_daa() - do a DAA (Dynamic Address Assignment)
  * @master: master doing the DAA
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index 1dde400afaf6..3ff402f8380b 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -590,6 +590,7 @@ int i3c_master_get_free_addr(struct i3c_master_controller *master,
 int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
 				  u8 addr);
 int i3c_master_do_daa(struct i3c_master_controller *master);
+int i3c_master_do_daa_ext(struct i3c_master_controller *master, bool rstdaa);
 struct i3c_dma *i3c_master_dma_map_single(struct device *dev, void *ptr,
 					  size_t len, bool force_bounce,
 					  enum dma_data_direction dir);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 02/34] i3c: master: renesas: Use __free(kfree) for xfer cleanup in renesas_i3c_send_ccc_cmd()
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 01/34] i3c: master: Add i3c_master_do_daa_ext() for post-hibernation address recovery Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 03/34] i3c: renesas: Check that the transfer is valid before accessing it Claudiu Beznea
                   ` (27 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Felix Gu <ustc.gu@gmail.com>

commit 57c91ca3dd87e58d635ecbcf9635aaead2f2b1de upstream.

Use __free(kfree) for automatic cleanup, matching the pattern already
used in other functions in this driver.

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260406-renesas-v3-2-4b724d7708f4@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 16c9b54057a9..9c438b162250 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -749,7 +749,6 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
 					   struct i3c_ccc_cmd *ccc)
 {
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
-	struct renesas_i3c_xfer *xfer;
 	struct renesas_i3c_cmd *cmd;
 	int ret, pos = 0;
 
@@ -759,7 +758,7 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
 			return pos;
 	}
 
-	xfer = renesas_i3c_alloc_xfer(i3c, 1);
+	struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1);
 	if (!xfer)
 		return -ENOMEM;
 
@@ -808,8 +807,6 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
 	if (ret)
 		ccc->err = I3C_ERROR_M2;
 
-	kfree(xfer);
-
 	return ret;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 03/34] i3c: renesas: Check that the transfer is valid before accessing it
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 01/34] i3c: master: Add i3c_master_do_daa_ext() for post-hibernation address recovery Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 02/34] i3c: master: renesas: Use __free(kfree) for xfer cleanup in renesas_i3c_send_ccc_cmd() Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 04/34] i3c: renesas: Restore STDBR and EXTBR registers on resume Claudiu Beznea
                   ` (26 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 5f1a76ecfe90544a28d657306c9b3caa66ba0e63 upstream.

The Renesas I3C driver uses an asynchronous model to transfer data. It
prepares a struct renesas_i3c_xfer, enqueues it, and waits for completion.
The interrupt handler dequeues the transfer, updates/uses it, and signals
the waiting thread.

If the completion times out, the waiting thread dequeues the transfer and
free it. If an interrupt fires after that, the handler may access freed
memory, leading to crashes.

Check that the transfer is still valid before accessing it in the
interrupt handler. With it clear any status flags and disable all
the interrupts to avoid triggering the same interrupts again.

Fixes: d028219a9f14 ("i3c: master: Add basic driver for the Renesas I3C controller")
Cc: stable@vger.kernel.org
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-2-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 52 +++++++++++++++++++++++++++-----
 1 file changed, 45 insertions(+), 7 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 9c438b162250..ffe3f0d9d5ce 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -434,6 +434,21 @@ static void renesas_i3c_enqueue_xfer(struct renesas_i3c *i3c, struct renesas_i3c
 	}
 }
 
+static void renesas_i3c_irqs_mask_and_clear_locked(struct renesas_i3c *i3c)
+{
+	/* Disable all the interrupts. */
+	renesas_writel(i3c->regs, BIE, 0);
+	renesas_writel(i3c->regs, NTIE, 0);
+
+	/* Clear normal transfer status flags. */
+	renesas_writel(i3c->regs, NTST, 0);
+
+	/* Clear bus status flags. */
+	renesas_writel(i3c->regs, BST, 0);
+	/* Read back registers to confirm writes have fully propagated. */
+	renesas_readl(i3c->regs, BST);
+}
+
 static void renesas_i3c_wait_xfer(struct renesas_i3c *i3c, struct renesas_i3c_xfer *xfer)
 {
 	unsigned long time_left;
@@ -1015,6 +1030,11 @@ static irqreturn_t renesas_i3c_tx_isr(int irq, void *data)
 
 	scoped_guard(spinlock, &i3c->xferqueue.lock) {
 		xfer = i3c->xferqueue.cur;
+		if (!xfer) {
+			renesas_i3c_irqs_mask_and_clear_locked(i3c);
+			return IRQ_HANDLED;
+		}
+
 		cmd = xfer->cmds;
 
 		if (xfer->is_i2c_xfer) {
@@ -1055,6 +1075,11 @@ static irqreturn_t renesas_i3c_resp_isr(int irq, void *data)
 
 	scoped_guard(spinlock, &i3c->xferqueue.lock) {
 		xfer = i3c->xferqueue.cur;
+		if (!xfer) {
+			renesas_i3c_irqs_mask_and_clear_locked(i3c);
+			return IRQ_HANDLED;
+		}
+
 		cmd = xfer->cmds;
 
 		/* Clear the Respone Queue Full status flag*/
@@ -1139,6 +1164,11 @@ static irqreturn_t renesas_i3c_tend_isr(int irq, void *data)
 
 	scoped_guard(spinlock, &i3c->xferqueue.lock) {
 		xfer = i3c->xferqueue.cur;
+		if (!xfer) {
+			renesas_i3c_irqs_mask_and_clear_locked(i3c);
+			return IRQ_HANDLED;
+		}
+
 		cmd = xfer->cmds;
 
 		if (xfer->is_i2c_xfer) {
@@ -1185,6 +1215,11 @@ static irqreturn_t renesas_i3c_rx_isr(int irq, void *data)
 
 	scoped_guard(spinlock, &i3c->xferqueue.lock) {
 		xfer = i3c->xferqueue.cur;
+		if (!xfer) {
+			renesas_i3c_irqs_mask_and_clear_locked(i3c);
+			return IRQ_HANDLED;
+		}
+
 		cmd = xfer->cmds;
 
 		if (xfer->is_i2c_xfer) {
@@ -1235,15 +1270,13 @@ static irqreturn_t renesas_i3c_stop_isr(int irq, void *data)
 	struct renesas_i3c_xfer *xfer;
 
 	scoped_guard(spinlock, &i3c->xferqueue.lock) {
-		xfer = i3c->xferqueue.cur;
-
-		/* read back registers to confirm writes have fully propagated */
-		renesas_writel(i3c->regs, BST, 0);
-		renesas_readl(i3c->regs, BST);
-		renesas_writel(i3c->regs, BIE, 0);
-		renesas_clear_bit(i3c->regs, NTST, NTST_TDBEF0 | NTST_RDBFF0);
+		renesas_i3c_irqs_mask_and_clear_locked(i3c);
 		renesas_clear_bit(i3c->regs, SCSTRCTL, SCSTRCTL_RWE);
 
+		xfer = i3c->xferqueue.cur;
+		if (!xfer)
+			return IRQ_HANDLED;
+
 		xfer->ret = 0;
 		complete(&xfer->comp);
 	}
@@ -1260,6 +1293,11 @@ static irqreturn_t renesas_i3c_start_isr(int irq, void *data)
 
 	scoped_guard(spinlock, &i3c->xferqueue.lock) {
 		xfer = i3c->xferqueue.cur;
+		if (!xfer) {
+			renesas_i3c_irqs_mask_and_clear_locked(i3c);
+			return IRQ_HANDLED;
+		}
+
 		cmd = xfer->cmds;
 
 		if (xfer->is_i2c_xfer) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 04/34] i3c: renesas: Restore STDBR and EXTBR registers on resume
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (2 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 03/34] i3c: renesas: Check that the transfer is valid before accessing it Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 05/34] i3c: renesas: Follow the reset deassert order used in probe Claudiu Beznea
                   ` (25 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 21cded44e69c630799e65baadb72ad123d1347c8 upstream.

The Renesas RZ/G3S supports a power saving state where power to the most
SoC componentes (including I3C) is lost.

The STDBR and EXTBR are configured in initialization phase though the
struct i3c_master_controller_ops::bus_init. Set them on resume function
as well to keep the same state of the controller after a suspend with
power loss and a similar initialization sequence as in bus_init.

Fixes: e7218986319b ("i3c: renesas: Add suspend/resume support")
Cc: stable@vger.kernel.org
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-3-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index ffe3f0d9d5ce..6c85cb059e8a 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -261,6 +261,7 @@ struct renesas_i3c {
 	u32 dyn_addr;
 	u32 i2c_STDBR;
 	u32 i3c_STDBR;
+	u32 extbr;
 	unsigned long rate;
 	u8 addrs[RENESAS_I3C_MAX_DEVS];
 	struct renesas_i3c_xferqueue xferqueue;
@@ -623,10 +624,9 @@ static int renesas_i3c_bus_init(struct i3c_master_controller *m)
 	renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
 
 	/* Extended Bit Rate setting */
-	renesas_writel(i3c->regs, EXTBR, EXTBR_EBRLO(od_low_ticks) |
-					   EXTBR_EBRHO(od_high_ticks) |
-					   EXTBR_EBRLP(pp_low_ticks) |
-					   EXTBR_EBRHP(pp_high_ticks));
+	i3c->extbr = EXTBR_EBRLO(od_low_ticks) | EXTBR_EBRHO(od_high_ticks) |
+		     EXTBR_EBRLP(pp_low_ticks) | EXTBR_EBRHP(pp_high_ticks);
+	renesas_writel(i3c->regs, EXTBR, i3c->extbr);
 
 	renesas_writel(i3c->regs, REFCKCTL, REFCKCTL_IREFCKS(cks));
 	i3c->refclk_div = cks;
@@ -1494,6 +1494,8 @@ static int renesas_i3c_resume_noirq(struct device *dev)
 		goto err_tresetn;
 
 	/* Re-store I3C registers value. */
+	renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
+	renesas_writel(i3c->regs, EXTBR, i3c->extbr);
 	renesas_writel(i3c->regs, REFCKCTL,
 		       REFCKCTL_IREFCKS(i3c->refclk_div));
 	renesas_writel(i3c->regs, MSDVAD, MSDVAD_MDYADV |
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 05/34] i3c: renesas: Follow the reset deassert order used in probe
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (3 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 04/34] i3c: renesas: Restore STDBR and EXTBR registers on resume Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 06/34] i3c: renesas: Reconfigure the DATBAS register on re-attach Claudiu Beznea
                   ` (24 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 7b15ca2615ec41fb428eb9af71bf3ebc95021201 upstream.

Use the same reset deassert order in the resume and probe paths to avoid
potential failures due to ordering differences.

Fixes: e7218986319b ("i3c: renesas: Add suspend/resume support")
Cc: stable@vger.kernel.org
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-4-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 6c85cb059e8a..910c8e543865 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -1481,17 +1481,17 @@ static int renesas_i3c_resume_noirq(struct device *dev)
 	struct renesas_i3c *i3c = dev_get_drvdata(dev);
 	int i, ret;
 
-	ret = reset_control_deassert(i3c->presetn);
+	ret = reset_control_deassert(i3c->tresetn);
 	if (ret)
 		return ret;
 
-	ret = reset_control_deassert(i3c->tresetn);
+	ret = reset_control_deassert(i3c->presetn);
 	if (ret)
-		goto err_presetn;
+		goto err_tresetn;
 
 	ret = clk_bulk_enable(i3c->num_clks, i3c->clks);
 	if (ret)
-		goto err_tresetn;
+		goto err_presetn;
 
 	/* Re-store I3C registers value. */
 	renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
@@ -1512,10 +1512,10 @@ static int renesas_i3c_resume_noirq(struct device *dev)
 
 	return 0;
 
-err_tresetn:
-	reset_control_assert(i3c->tresetn);
 err_presetn:
 	reset_control_assert(i3c->presetn);
+err_tresetn:
+	reset_control_assert(i3c->tresetn);
 	return ret;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 06/34] i3c: renesas: Reconfigure the DATBAS register on re-attach
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (4 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 05/34] i3c: renesas: Follow the reset deassert order used in probe Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 07/34] i3c: renesas: Reset the controller on resume Claudiu Beznea
                   ` (23 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 1364afd3e2e76e007a2c07ec95704d56980226f0 upstream.

During re-attach, the device may change its position in the i3c->addrs[]
array. As a result, it may use a different Device Address Table Basic
Register (DATBAS), which needs to be reconfigured.

Reconfigure the DATBAS register on re-attach. Along with it update
software caches.

Fixes: d028219a9f14 ("i3c: master: Add basic driver for the Renesas I3C controller")
Cc: stable@vger.kernel.org
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-5-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 910c8e543865..c1f08110575c 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -908,10 +908,26 @@ static int renesas_i3c_reattach_i3c_dev(struct i3c_dev_desc *dev,
 	struct i3c_master_controller *m = i3c_dev_get_master(dev);
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
 	struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
+	int pos;
+
+	pos = renesas_i3c_get_free_pos(i3c);
+
+	if (data->index > pos && pos >= 0) {
+		renesas_writel(i3c->regs, DATBAS(data->index), 0);
+		i3c->addrs[data->index] = 0;
+		i3c->free_pos |= BIT(data->index);
+
+		data->index = pos;
+		i3c->free_pos &= ~BIT(data->index);
+	}
 
 	i3c->addrs[data->index] = dev->info.dyn_addr ? dev->info.dyn_addr :
 							dev->info.static_addr;
 
+	renesas_writel(i3c->regs, DATBAS(data->index),
+		       DATBAS_DVSTAD(dev->info.static_addr) |
+		       datbas_dvdyad_with_parity(i3c->addrs[data->index]));
+
 	return 0;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 07/34] i3c: renesas: Reset the controller on resume
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (5 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 06/34] i3c: renesas: Reconfigure the DATBAS register on re-attach Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 08/34] i3c: renesas: Perform Dynamic Address Assignment " Claudiu Beznea
                   ` (22 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 27cf0ad162f1a4526a86fc2ec24d84a4a98ac1dd upstream.

Reset the controller on resume after enabling the clocks to follow the
same sequence as in probe and avoid potential ordering related failures.

With it, renesas_i3c_reset() was updated to use read_poll_timeout_atomic(),
as the driver's resume callback is executed during the noirq phase of
resume, where interrupts are disabled.

Fixes: e7218986319b ("i3c: renesas: Add suspend/resume support")
Cc: stable@vger.kernel.org
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-6-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index c1f08110575c..65344e73b1a0 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -496,8 +496,8 @@ static int renesas_i3c_reset(struct renesas_i3c *i3c)
 	renesas_writel(i3c->regs, BCTL, 0);
 	renesas_set_bit(i3c->regs, RSTCTL, RSTCTL_RI3CRST);
 
-	return read_poll_timeout(renesas_readl, val, !(val & RSTCTL_RI3CRST),
-				 0, 1000, false, i3c->regs, RSTCTL);
+	return read_poll_timeout_atomic(renesas_readl, val, !(val & RSTCTL_RI3CRST),
+					0, 1000, false, i3c->regs, RSTCTL);
 }
 
 static void renesas_i3c_hw_init(struct renesas_i3c *i3c)
@@ -1509,6 +1509,10 @@ static int renesas_i3c_resume_noirq(struct device *dev)
 	if (ret)
 		goto err_presetn;
 
+	ret = renesas_i3c_reset(i3c);
+	if (ret)
+		goto err_clks_disable;
+
 	/* Re-store I3C registers value. */
 	renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
 	renesas_writel(i3c->regs, EXTBR, i3c->extbr);
@@ -1528,6 +1532,8 @@ static int renesas_i3c_resume_noirq(struct device *dev)
 
 	return 0;
 
+err_clks_disable:
+	clk_bulk_disable(i3c->num_clks, i3c->clks);
 err_presetn:
 	reset_control_assert(i3c->presetn);
 err_tresetn:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 08/34] i3c: renesas: Perform Dynamic Address Assignment on resume
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (6 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 07/34] i3c: renesas: Reset the controller on resume Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 09/34] i3c: renesas: Clean DATBAS register on detach Claudiu Beznea
                   ` (21 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit fbf26154c47953d08c60fb402ab19c5c56c3779f upstream.

The Renesas RZ/G3S SoC supports a power saving mode where power to most
SoC components, including I3C, is turned off.

On systems where the I3C devices also loses power during suspend (e.g. NXP
P3T1085UK-ARD connected to the PMOD1_6A connector of the RZ SMARC Carrier
2 + Renesas RZ/G3S SMARC SOM), the devices becomes unreachable after
resume.

Running DAA in the controller resume path restores communication. However,
DAA relies on interrupts for TX/RX, which are not available in the noirq
suspend/resume phase (unless they are wakeup interrupts). For this, the
suspend/resume callbacks were moved out of the noirq phase. Currently,
there is no identified use case on either the Renesas RZ/G3S or Renesas
RZ/G3E SoCs that requires the controller suspend/resume hooks to be part of
the noirq suspend/resume phase.

Since renesas_i3c_reset() is not called anymore in atomic context
update it to use read_poll_timeout().

Along with this, struct renesas_i3c::DATBASn and its usage were removed,
as they are no longer needed.

Fixes: e7218986319b ("i3c: renesas: Add suspend/resume support")
Cc: stable@vger.kernel.org
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-7-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 38 +++++++++++++-------------------
 1 file changed, 15 insertions(+), 23 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 65344e73b1a0..24129e942f2c 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -266,7 +266,6 @@ struct renesas_i3c {
 	u8 addrs[RENESAS_I3C_MAX_DEVS];
 	struct renesas_i3c_xferqueue xferqueue;
 	void __iomem *regs;
-	u32 *DATBASn;
 	struct clk_bulk_data *clks;
 	struct reset_control *presetn;
 	struct reset_control *tresetn;
@@ -496,8 +495,8 @@ static int renesas_i3c_reset(struct renesas_i3c *i3c)
 	renesas_writel(i3c->regs, BCTL, 0);
 	renesas_set_bit(i3c->regs, RSTCTL, RSTCTL_RI3CRST);
 
-	return read_poll_timeout_atomic(renesas_readl, val, !(val & RSTCTL_RI3CRST),
-					0, 1000, false, i3c->regs, RSTCTL);
+	return read_poll_timeout(renesas_readl, val, !(val & RSTCTL_RI3CRST),
+				 0, 1000, false, i3c->regs, RSTCTL);
 }
 
 static void renesas_i3c_hw_init(struct renesas_i3c *i3c)
@@ -1443,12 +1442,6 @@ static int renesas_i3c_probe(struct platform_device *pdev)
 	i3c->maxdevs = RENESAS_I3C_MAX_DEVS;
 	i3c->free_pos = GENMASK(i3c->maxdevs - 1, 0);
 
-	/* Allocate dynamic Device Address Table backup. */
-	i3c->DATBASn = devm_kzalloc(&pdev->dev, sizeof(u32) * i3c->maxdevs,
-				    GFP_KERNEL);
-	if (!i3c->DATBASn)
-		return -ENOMEM;
-
 	return i3c_master_register(&i3c->base, &pdev->dev, &renesas_i3c_ops, false);
 }
 
@@ -1461,17 +1454,13 @@ static int renesas_i3c_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int renesas_i3c_suspend_noirq(struct device *dev)
+static int renesas_i3c_suspend(struct device *dev)
 {
 	struct renesas_i3c *i3c = dev_get_drvdata(dev);
-	int i, ret;
+	int ret;
 
 	i2c_mark_adapter_suspended(&i3c->base.i2c);
 
-	/* Store Device Address Table values. */
-	for (i = 0; i < i3c->maxdevs; i++)
-		i3c->DATBASn[i] = renesas_readl(i3c->regs, DATBAS(i));
-
 	ret = reset_control_assert(i3c->presetn);
 	if (ret)
 		goto err_mark_resumed;
@@ -1492,10 +1481,10 @@ static int renesas_i3c_suspend_noirq(struct device *dev)
 	return ret;
 }
 
-static int renesas_i3c_resume_noirq(struct device *dev)
+static int renesas_i3c_resume(struct device *dev)
 {
 	struct renesas_i3c *i3c = dev_get_drvdata(dev);
-	int i, ret;
+	int ret;
 
 	ret = reset_control_deassert(i3c->tresetn);
 	if (ret)
@@ -1521,15 +1510,19 @@ static int renesas_i3c_resume_noirq(struct device *dev)
 	renesas_writel(i3c->regs, MSDVAD, MSDVAD_MDYADV |
 		       MSDVAD_MDYAD(i3c->dyn_addr));
 
-	/* Restore Device Address Table values. */
-	for (i = 0; i < i3c->maxdevs; i++)
-		renesas_writel(i3c->regs, DATBAS(i), i3c->DATBASn[i]);
-
 	/* I3C hw init. */
 	renesas_i3c_hw_init(i3c);
 
+	ret = i3c_master_do_daa_ext(&i3c->base, true);
+	if (ret)
+		dev_err(dev, "DAA failed on resume, ret=%d", ret);
+
 	i2c_mark_adapter_resumed(&i3c->base.i2c);
 
+	/*
+	 * I3C devices may have retained their dynamic address anyway. Do not
+	 * fail the resume because of DAA error.
+	 */
 	return 0;
 
 err_clks_disable:
@@ -1542,8 +1535,7 @@ static int renesas_i3c_resume_noirq(struct device *dev)
 }
 
 static const struct dev_pm_ops renesas_i3c_pm_ops = {
-	NOIRQ_SYSTEM_SLEEP_PM_OPS(renesas_i3c_suspend_noirq,
-				  renesas_i3c_resume_noirq)
+	SYSTEM_SLEEP_PM_OPS(renesas_i3c_suspend, renesas_i3c_resume)
 };
 
 static const struct of_device_id renesas_i3c_of_ids[] = {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 09/34] i3c: renesas: Clean DATBAS register on detach
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (7 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 08/34] i3c: renesas: Perform Dynamic Address Assignment " Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 10/34] i3c: renesas: Fix out-of-bounds access for newdevs mask Claudiu Beznea
                   ` (20 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 797ed83c0cd495be4b345750c59e0363bf4d6207 upstream.

The controller uses DATBAS registers on TX/RX logic. Clean the DATBAS
register for the detached I3C device to avoid issues.

Fixes: d028219a9f14 ("i3c: master: Add basic driver for the Renesas I3C controller")
Cc: stable@vger.kernel.org
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-8-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 24129e942f2c..e11ef02b5282 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -936,6 +936,8 @@ static void renesas_i3c_detach_i3c_dev(struct i3c_dev_desc *dev)
 	struct i3c_master_controller *m = i3c_dev_get_master(dev);
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
 
+	renesas_writel(i3c->regs, DATBAS(data->index), 0);
+
 	i3c_dev_set_master_data(dev, NULL);
 	i3c->addrs[data->index] = 0;
 	i3c->free_pos |= BIT(data->index);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 10/34] i3c: renesas: Fix out-of-bounds access for newdevs mask
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (8 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 09/34] i3c: renesas: Clean DATBAS register on detach Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 11/34] i3c: renesas: Use reset_control_bulk_{assert, deassert}() Claudiu Beznea
                   ` (19 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 50dec95c9d1f1f82819bc898ef2b60fa83fd4ccd upstream.

When software initiates DAA (Dynamic Address Assignment), the controller
reports the result via the NRSPQP (Normal Response Queue Port Register).
The data length field of the response descriptor, which is accessible
through the NRSPQP register, indicates the number of devices remaining
after DAA. Consequently, when the bus is empty, this field contains the
maximum number of devices supported by the controller (8 for the Renesas
I3C controller).

Adjust the condition that computes the newly discovered devices bitmask
to prevent an out-of-bounds when the I3C bus is empty.

Fixes: e7218986319b ("i3c: renesas: Add suspend/resume support")
Cc: stable@vger.kernel.org
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-9-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index e11ef02b5282..30b204fd44ef 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -704,7 +704,11 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 
 	renesas_i3c_wait_xfer(i3c, xfer);
 
-	newdevs = GENMASK(i3c->maxdevs - cmd->rx_count - 1, 0);
+	if (cmd->rx_count >= i3c->maxdevs)
+		newdevs = 0;
+	else
+		newdevs = GENMASK(i3c->maxdevs - cmd->rx_count - 1, 0);
+
 	newdevs &= ~olddevs;
 
 	for (pos = 0; pos < i3c->maxdevs; pos++) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 11/34] i3c: renesas: Use reset_control_bulk_{assert, deassert}()
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (9 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 10/34] i3c: renesas: Fix out-of-bounds access for newdevs mask Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 12/34] i3c: renesas: Return immediately if there is no transfer Claudiu Beznea
                   ` (18 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 35e9bb2be1a20561e2cc19ca79c88c009f65c5f4 upstream.

Use reset_control_bulk_assert() and reset_control_bulk_deassert() in the
suspend and resume paths to simplify the code.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-10-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 30b204fd44ef..4c31f11b29d1 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -1463,24 +1463,22 @@ static int renesas_i3c_remove(struct platform_device *pdev)
 static int renesas_i3c_suspend(struct device *dev)
 {
 	struct renesas_i3c *i3c = dev_get_drvdata(dev);
+	struct reset_control_bulk_data resets[] = {
+		{ .rstc = i3c->presetn },
+		{ .rstc = i3c->tresetn },
+	};
 	int ret;
 
 	i2c_mark_adapter_suspended(&i3c->base.i2c);
 
-	ret = reset_control_assert(i3c->presetn);
+	ret = reset_control_bulk_assert(ARRAY_SIZE(resets), resets);
 	if (ret)
 		goto err_mark_resumed;
 
-	ret = reset_control_assert(i3c->tresetn);
-	if (ret)
-		goto err_presetn;
-
 	clk_bulk_disable(i3c->num_clks, i3c->clks);
 
 	return 0;
 
-err_presetn:
-	reset_control_deassert(i3c->presetn);
 err_mark_resumed:
 	i2c_mark_adapter_resumed(&i3c->base.i2c);
 
@@ -1490,19 +1488,19 @@ static int renesas_i3c_suspend(struct device *dev)
 static int renesas_i3c_resume(struct device *dev)
 {
 	struct renesas_i3c *i3c = dev_get_drvdata(dev);
+	struct reset_control_bulk_data resets[] = {
+		{ .rstc = i3c->presetn },
+		{ .rstc = i3c->tresetn },
+	};
 	int ret;
 
-	ret = reset_control_deassert(i3c->tresetn);
+	ret = reset_control_bulk_deassert(ARRAY_SIZE(resets), resets);
 	if (ret)
 		return ret;
 
-	ret = reset_control_deassert(i3c->presetn);
-	if (ret)
-		goto err_tresetn;
-
 	ret = clk_bulk_enable(i3c->num_clks, i3c->clks);
 	if (ret)
-		goto err_presetn;
+		goto err_resets_asserted;
 
 	ret = renesas_i3c_reset(i3c);
 	if (ret)
@@ -1533,10 +1531,8 @@ static int renesas_i3c_resume(struct device *dev)
 
 err_clks_disable:
 	clk_bulk_disable(i3c->num_clks, i3c->clks);
-err_presetn:
-	reset_control_assert(i3c->presetn);
-err_tresetn:
-	reset_control_assert(i3c->tresetn);
+err_resets_asserted:
+	reset_control_bulk_assert(ARRAY_SIZE(resets), resets);
 	return ret;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 12/34] i3c: renesas: Return immediately if there is no transfer
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (10 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 11/34] i3c: renesas: Use reset_control_bulk_{assert, deassert}() Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 13/34] i3c: renesas: Follow a unified pattern for transfer and command initialization Claudiu Beznea
                   ` (17 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 33b5ecc5a16e270c8e0dd9835e7d9d2522f64129 upstream.

There is no need to allocate a transfer structure when i2c_nxfers is zero.
Return immediately instead of unnecessarily allocating memory.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-11-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 4c31f11b29d1..297bcad0ceef 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -958,13 +958,13 @@ static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
 	u8 start_bit = CNDCTL_STCND;
 	int i;
 
+	if (!i2c_nxfers)
+		return 0;
+
 	struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1);
 	if (!xfer)
 		return -ENOMEM;
 
-	if (!i2c_nxfers)
-		return 0;
-
 	renesas_i3c_bus_enable(m, false);
 
 	init_completion(&xfer->comp);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 13/34] i3c: renesas: Follow a unified pattern for transfer and command initialization
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (11 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 12/34] i3c: renesas: Return immediately if there is no transfer Claudiu Beznea
@ 2026-11-17 11:48 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 14/34] i3c: renesas: Drop the explicit memset() call Claudiu Beznea
                   ` (16 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:48 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 234a26e6febcf789d9f6779d67c01e3d0c1df5bc upstream.

Follow a unified pattern for transfer and command initialization across
the driver. This keeps the code cleaner and easier to follow. Also, in
some cases the I3C device was enabled before the transfer data structure
was even allocated.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-12-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 297bcad0ceef..fa686b538b46 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -664,6 +664,10 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 	if (!xfer)
 		return -ENOMEM;
 
+	init_completion(&xfer->comp);
+	cmd = xfer->cmds;
+	cmd->rx_count = 0;
+
 	/* Enable I3C bus. */
 	renesas_i3c_bus_enable(m, true);
 
@@ -685,10 +689,6 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 		renesas_writel(i3c->regs, DATBAS(pos), datbas_dvdyad_with_parity(ret));
 	}
 
-	init_completion(&xfer->comp);
-	cmd = xfer->cmds;
-	cmd->rx_count = 0;
-
 	ret = renesas_i3c_get_free_pos(i3c);
 	if (ret < 0)
 		return ret;
@@ -780,13 +780,13 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
 	if (!xfer)
 		return -ENOMEM;
 
-	renesas_i3c_bus_enable(m, true);
-
 	init_completion(&xfer->comp);
 	cmd = xfer->cmds;
 	cmd->rnw = ccc->rnw;
 	cmd->cmd0 = 0;
 
+	renesas_i3c_bus_enable(m, true);
+
 	/* Calculate the command descriptor. */
 	switch (ccc->id) {
 	case I3C_CCC_SETDASA:
@@ -836,15 +836,15 @@ static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer
 	struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
 	int i;
 
-	/* Enable I3C bus. */
-	renesas_i3c_bus_enable(m, true);
-
 	struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1);
 	if (!xfer)
 		return -ENOMEM;
 
 	init_completion(&xfer->comp);
 
+	/* Enable I3C bus. */
+	renesas_i3c_bus_enable(m, true);
+
 	for (i = 0; i < i3c_nxfers; i++) {
 		struct renesas_i3c_cmd *cmd = xfer->cmds;
 
@@ -965,12 +965,12 @@ static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
 	if (!xfer)
 		return -ENOMEM;
 
-	renesas_i3c_bus_enable(m, false);
-
 	init_completion(&xfer->comp);
 	xfer->is_i2c_xfer = true;
 	cmd = xfer->cmds;
 
+	renesas_i3c_bus_enable(m, false);
+
 	if (!(renesas_readl(i3c->regs, BCST) & BCST_BFREF)) {
 		cmd->err = -EBUSY;
 		return cmd->err;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 14/34] i3c: renesas: Drop the explicit memset() call
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (12 preceding siblings ...)
  2026-11-17 11:48 ` [PATCH 6.1.y-cip 13/34] i3c: renesas: Follow a unified pattern for transfer and command initialization Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 15/34] i3c: renesas: Update HW registers after SW computations are done Claudiu Beznea
                   ` (15 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 5e0b4ae8017782c5495f96f924b28fa447682a36 upstream.

Drop the explicit memset() call on struct i3c_device_info object, as it is
already initialized at declaration through compiler initialization.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-13-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index fa686b538b46..cf6b1489b17e 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -640,7 +640,6 @@ static int renesas_i3c_bus_init(struct i3c_master_controller *m)
 	i3c->dyn_addr = ret;
 	renesas_writel(i3c->regs, MSDVAD, MSDVAD_MDYAD(ret) | MSDVAD_MDYADV);
 
-	memset(&info, 0, sizeof(info));
 	info.dyn_addr = ret;
 	return i3c_master_set_info(&i3c->base, &info);
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 15/34] i3c: renesas: Update HW registers after SW computations are done
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (13 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 14/34] i3c: renesas: Drop the explicit memset() call Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 16/34] i3c: renesas: Organize structures to avoid unnecessary padding Claudiu Beznea
                   ` (14 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 826a7d3d5ff2296d021a6a4521544b852609047a upstream.

renesas_i3c_bus_init() performs a number of computations and software
cache updates, interleaving them with hardware register writes. While
this works today, it makes it harder to minimize the time the controller
must remain powered when runtime PM is introduced.

Perform all software computations and cache updates first, then update
the hardware registers. This prepares for future runtime PM support.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-14-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index cf6b1489b17e..82ee131cf565 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -566,10 +566,6 @@ static int renesas_i3c_bus_init(struct i3c_master_controller *m)
 	if (!i3c->rate)
 		return -EINVAL;
 
-	ret = renesas_i3c_reset(i3c);
-	if (ret)
-		return ret;
-
 	i2c_total_ticks = DIV_ROUND_UP(i3c->rate, bus->scl_rate.i2c);
 	i3c_total_ticks = DIV_ROUND_UP(i3c->rate, bus->scl_rate.i3c);
 
@@ -620,27 +616,31 @@ static int renesas_i3c_bus_init(struct i3c_master_controller *m)
 			STDBR_SBRHO(double_SBR, od_high_ticks) |
 			STDBR_SBRLP(pp_low_ticks) |
 			STDBR_SBRHP(pp_high_ticks);
-	renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
 
 	/* Extended Bit Rate setting */
 	i3c->extbr = EXTBR_EBRLO(od_low_ticks) | EXTBR_EBRHO(od_high_ticks) |
 		     EXTBR_EBRLP(pp_low_ticks) | EXTBR_EBRHP(pp_high_ticks);
-	renesas_writel(i3c->regs, EXTBR, i3c->extbr);
-
-	renesas_writel(i3c->regs, REFCKCTL, REFCKCTL_IREFCKS(cks));
-	i3c->refclk_div = cks;
-
-	/* I3C hw init*/
-	renesas_i3c_hw_init(i3c);
 
 	ret = i3c_master_get_free_addr(m, 0);
 	if (ret < 0)
 		return ret;
 
+	info.dyn_addr = ret;
 	i3c->dyn_addr = ret;
-	renesas_writel(i3c->regs, MSDVAD, MSDVAD_MDYAD(ret) | MSDVAD_MDYADV);
+	i3c->refclk_div = cks;
+
+	ret = renesas_i3c_reset(i3c);
+	if (ret)
+		return ret;
+
+	renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
+	renesas_writel(i3c->regs, EXTBR, i3c->extbr);
+	renesas_writel(i3c->regs, REFCKCTL, REFCKCTL_IREFCKS(cks));
+	renesas_writel(i3c->regs, MSDVAD, MSDVAD_MDYAD(i3c->dyn_addr) | MSDVAD_MDYADV);
+
+	/* I3C hw init*/
+	renesas_i3c_hw_init(i3c);
 
-	info.dyn_addr = ret;
 	return i3c_master_set_info(&i3c->base, &info);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 16/34] i3c: renesas: Organize structures to avoid unnecessary padding
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (14 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 15/34] i3c: renesas: Update HW registers after SW computations are done Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 17/34] i3c: renesas: Use the "dev_name:irq_name" format for the interrupt name Claudiu Beznea
                   ` (13 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 42a6f531c950c8b8009d938b3e51fed3533a1a3c upstream.

Reorder structure members to reduce padding and improve memory layout.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-15-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 82ee131cf565..2f6df04c9317 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -222,19 +222,19 @@ enum renesas_i3c_event {
 };
 
 struct renesas_i3c_cmd {
+	const void *tx_buf;
+	void *rx_buf;
+	/* i2c xfer */
+	u8 *i2c_buf;
+	const struct i2c_msg *msg;
+	int i2c_bytes_left;
+	int i2c_is_last;
 	u32 cmd0;
 	u32 len;
-	const void *tx_buf;
 	u32 tx_count;
-	void *rx_buf;
 	u32 rx_count;
 	u32 err;
 	u8 rnw;
-	/* i2c xfer */
-	int i2c_bytes_left;
-	int i2c_is_last;
-	u8 *i2c_buf;
-	const struct i2c_msg *msg;
 };
 
 struct renesas_i3c_xfer {
@@ -254,21 +254,22 @@ struct renesas_i3c_xferqueue {
 };
 
 struct renesas_i3c {
+	void __iomem *regs;
+	struct clk_bulk_data *clks;
+	struct reset_control *presetn;
+	struct reset_control *tresetn;
+	struct renesas_i3c_xferqueue xferqueue;
 	struct i3c_master_controller base;
+	u8 addrs[RENESAS_I3C_MAX_DEVS];
+	unsigned long rate;
 	enum i3c_internal_state internal_state;
-	u16 maxdevs;
+	bool resuming;
 	u32 free_pos;
 	u32 dyn_addr;
 	u32 i2c_STDBR;
 	u32 i3c_STDBR;
 	u32 extbr;
-	unsigned long rate;
-	u8 addrs[RENESAS_I3C_MAX_DEVS];
-	struct renesas_i3c_xferqueue xferqueue;
-	void __iomem *regs;
-	struct clk_bulk_data *clks;
-	struct reset_control *presetn;
-	struct reset_control *tresetn;
+	u16 maxdevs;
 	u8 num_clks;
 	u8 refclk_div;
 };
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 17/34] i3c: renesas: Use the "dev_name:irq_name" format for the interrupt name
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (15 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 16/34] i3c: renesas: Organize structures to avoid unnecessary padding Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 18/34] i3c: renesas: Drop unnecessary tab Claudiu Beznea
                   ` (12 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 0c863015fcd6d58843f0f012b69ae9e22c00d9dc upstream.

Use the "dev_name:irq_name" format for the interrupt names. This makes it
easier to identify interrupts in systems where multiple devices may request
interrupts with the same name.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-16-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 2f6df04c9317..46f0b1fd6538 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -1433,12 +1433,19 @@ static int renesas_i3c_probe(struct platform_device *pdev)
 		return ret;
 
 	for (i = 0; i < ARRAY_SIZE(renesas_i3c_irqs); i++) {
+		const char *irqname;
+
 		ret = platform_get_irq_byname(pdev, renesas_i3c_irqs[i].name);
 		if (ret < 0)
 			return ret;
 
+		irqname = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s:%s", dev_name(&pdev->dev),
+					 renesas_i3c_irqs[i].desc);
+		if (!irqname)
+			return -ENOMEM;
+
 		ret = devm_request_irq(&pdev->dev, ret, renesas_i3c_irqs[i].isr,
-				       0, renesas_i3c_irqs[i].desc, i3c);
+				       0, irqname, i3c);
 		if (ret)
 			return ret;
 	}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 18/34] i3c: renesas: Drop unnecessary tab
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (16 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 17/34] i3c: renesas: Use the "dev_name:irq_name" format for the interrupt name Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 19/34] i3c: renesas: Add runtime PM support Claudiu Beznea
                   ` (11 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 46fa00a6c42251870551802b724027a10119d788 upstream.

Remove an unnecessary tab to make the code cleaner.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-17-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 46f0b1fd6538..5137549b5067 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -110,7 +110,7 @@
 #define  NCMDQP_DATA_LENGTH(x)	FIELD_PREP(GENMASK(31, 16), x)
 
 #define NRSPQP			0x154 /* Normal Respone Queue */
-#define  NRSPQP_NO_ERROR			0
+#define  NRSPQP_NO_ERROR		0
 #define  NRSPQP_ERROR_CRC		1
 #define  NRSPQP_ERROR_PARITY		2
 #define  NRSPQP_ERROR_FRAME		3
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 19/34] i3c: renesas: Add runtime PM support
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (17 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 18/34] i3c: renesas: Drop unnecessary tab Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 20/34] i3c: renesas: Drop unused structure member 'resuming' Claudiu Beznea
                   ` (10 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 4af1aacc580c1633be5d7b37b5847ba91c6ad97f upstream.

On the SoCs where the Renesas I3C driver is enabled (RZ/G3S and RZ/G3E),
the clocks of the IP are managed through a clock PM domain. To keep the
I3C code simpler, the explicit clock handling was dropped along with the
addition of runtime PM support, in favor of the runtime PM APIs. Only the
code for getting tclk was preserved, as it is necessary to compute the
I3C clock rate.

All the APIs provided to the I3C subsystem through struct
i3c_master_controller_ops are guarded with runtime PM APIs to
enable/disable the controller at runtime.

As the Renesas I3C driver implements an asynchronous transmit model by
preparing a transfer and waiting for its completion through the ISR,
renesas_i3c_abort_xfer() was added to disable interrupts and clear any
pending IRQ status bits when there is no completion in the defined
timeout. Along with this, renesas_i3c_wait_xfer() return type was changed
to unsigned long.

Add runtime PM support for the Renesas I3C driver.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260713130545.568657-18-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[claudiu.beznea:
 - fix conflict in renesas_i3c_attach_i3c_dev() by using kzalloc() instead
   of kzalloc_obj()
 - replaced PM_RUNTIME_ACQUIRE_IF_ENABLED_AUTOSUSPEND() and
   PM_RUNTIME_ACQUIRE_ERR() with pm_runtime_resume_and_get(),
   pm_runtime_mark_last_busy(), pm_runtime_put_autosuspend()]
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 194 ++++++++++++++++++++++++-------
 1 file changed, 155 insertions(+), 39 deletions(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 5137549b5067..251f130abf3a 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -23,6 +23,7 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/reset.h>
 #include <linux/slab.h>
 #include "../internals.h"
@@ -200,8 +201,6 @@
 #define RENESAS_I3C_MAX_DEVS	8
 #define I2C_INIT_MSG		-1
 
-#define RENESAS_I3C_TCLK_IDX	1
-
 enum i3c_internal_state {
 	I3C_INTERNAL_STATE_DISABLED,
 	I3C_INTERNAL_STATE_CONTROLLER_IDLE,
@@ -255,9 +254,10 @@ struct renesas_i3c_xferqueue {
 
 struct renesas_i3c {
 	void __iomem *regs;
-	struct clk_bulk_data *clks;
+	struct clk *tclk;
 	struct reset_control *presetn;
 	struct reset_control *tresetn;
+	struct device *dev;
 	struct renesas_i3c_xferqueue xferqueue;
 	struct i3c_master_controller base;
 	u8 addrs[RENESAS_I3C_MAX_DEVS];
@@ -270,7 +270,6 @@ struct renesas_i3c {
 	u32 i3c_STDBR;
 	u32 extbr;
 	u16 maxdevs;
-	u8 num_clks;
 	u8 refclk_div;
 };
 
@@ -450,7 +449,14 @@ static void renesas_i3c_irqs_mask_and_clear_locked(struct renesas_i3c *i3c)
 	renesas_readl(i3c->regs, BST);
 }
 
-static void renesas_i3c_wait_xfer(struct renesas_i3c *i3c, struct renesas_i3c_xfer *xfer)
+static void renesas_i3c_irqs_mask_and_clear(struct renesas_i3c *i3c)
+{
+	guard(spinlock_irqsave)(&i3c->xferqueue.lock);
+
+	renesas_i3c_irqs_mask_and_clear_locked(i3c);
+}
+
+static unsigned long renesas_i3c_wait_xfer(struct renesas_i3c *i3c, struct renesas_i3c_xfer *xfer)
 {
 	unsigned long time_left;
 
@@ -459,6 +465,8 @@ static void renesas_i3c_wait_xfer(struct renesas_i3c *i3c, struct renesas_i3c_xf
 	time_left = wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000));
 	if (!time_left)
 		renesas_i3c_dequeue_xfer(i3c, xfer);
+
+	return time_left;
 }
 
 static void renesas_i3c_set_prts(struct renesas_i3c *i3c, u32 val)
@@ -492,12 +500,22 @@ static void renesas_i3c_bus_enable(struct i3c_master_controller *m, bool i3c_mod
 static int renesas_i3c_reset(struct renesas_i3c *i3c)
 {
 	u32 val;
+	int ret;
+
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (ret)
+		return ret;
 
 	renesas_writel(i3c->regs, BCTL, 0);
 	renesas_set_bit(i3c->regs, RSTCTL, RSTCTL_RI3CRST);
 
-	return read_poll_timeout(renesas_readl, val, !(val & RSTCTL_RI3CRST),
-				 0, 1000, false, i3c->regs, RSTCTL);
+	ret = read_poll_timeout(renesas_readl, val, !(val & RSTCTL_RI3CRST),
+				0, 1000, false, i3c->regs, RSTCTL);
+
+	pm_runtime_mark_last_busy(i3c->dev);
+	pm_runtime_put_autosuspend(i3c->dev);
+
+	return ret;
 }
 
 static void renesas_i3c_hw_init(struct renesas_i3c *i3c)
@@ -563,7 +581,7 @@ static int renesas_i3c_bus_init(struct i3c_master_controller *m)
 	int od_high_ticks, od_low_ticks, i2c_total_ticks;
 	int ret;
 
-	i3c->rate = clk_get_rate(i3c->clks[RENESAS_I3C_TCLK_IDX].clk);
+	i3c->rate = clk_get_rate(i3c->tclk);
 	if (!i3c->rate)
 		return -EINVAL;
 
@@ -634,6 +652,10 @@ static int renesas_i3c_bus_init(struct i3c_master_controller *m)
 	if (ret)
 		return ret;
 
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (ret)
+		return ret;
+
 	renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
 	renesas_writel(i3c->regs, EXTBR, i3c->extbr);
 	renesas_writel(i3c->regs, REFCKCTL, REFCKCTL_IREFCKS(cks));
@@ -642,7 +664,12 @@ static int renesas_i3c_bus_init(struct i3c_master_controller *m)
 	/* I3C hw init*/
 	renesas_i3c_hw_init(i3c);
 
-	return i3c_master_set_info(&i3c->base, &info);
+	ret = i3c_master_set_info(&i3c->base, &info);
+
+	pm_runtime_mark_last_busy(i3c->dev);
+	pm_runtime_put_autosuspend(i3c->dev);
+
+	return ret;
 }
 
 static void renesas_i3c_bus_cleanup(struct i3c_master_controller *m)
@@ -656,6 +683,7 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 {
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
 	struct renesas_i3c_cmd *cmd;
+	unsigned long time_left;
 	u32 olddevs, newdevs;
 	u8 last_addr = 0, pos;
 	int ret;
@@ -668,6 +696,10 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 	cmd = xfer->cmds;
 	cmd->rx_count = 0;
 
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (ret)
+		return ret;
+
 	/* Enable I3C bus. */
 	renesas_i3c_bus_enable(m, true);
 
@@ -680,8 +712,10 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 			continue;
 
 		ret = i3c_master_get_free_addr(m, last_addr + 1);
-		if (ret < 0)
-			return -ENOSPC;
+		if (ret < 0) {
+			ret = -ENOSPC;
+			goto rpm_put;
+		}
 
 		i3c->addrs[pos] = ret;
 		last_addr = ret;
@@ -691,7 +725,7 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 
 	ret = renesas_i3c_get_free_pos(i3c);
 	if (ret < 0)
-		return ret;
+		goto rpm_put;
 
 	/*
 	 * Setup the command descriptor to start the ENTDAA command
@@ -702,7 +736,9 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 		    NCMDQP_CMD(I3C_CCC_ENTDAA) | NCMDQP_DEV_INDEX(ret) |
 		    NCMDQP_DEV_COUNT(i3c->maxdevs - ret) | NCMDQP_TOC;
 
-	renesas_i3c_wait_xfer(i3c, xfer);
+	time_left = renesas_i3c_wait_xfer(i3c, xfer);
+	if (!time_left)
+		renesas_i3c_irqs_mask_and_clear(i3c);
 
 	if (cmd->rx_count >= i3c->maxdevs)
 		newdevs = 0;
@@ -716,7 +752,11 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 			i3c_master_add_i3c_dev_locked(m, i3c->addrs[pos]);
 	}
 
-	return 0;
+rpm_put:
+	pm_runtime_mark_last_busy(i3c->dev);
+	pm_runtime_put_autosuspend(i3c->dev);
+
+	return ret < 0 ? ret : 0;
 }
 
 static bool renesas_i3c_supports_ccc_cmd(struct i3c_master_controller *m,
@@ -768,6 +808,7 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
 {
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
 	struct renesas_i3c_cmd *cmd;
+	unsigned long time_left;
 	int ret, pos = 0;
 
 	if (ccc->id & I3C_CCC_DIRECT) {
@@ -785,6 +826,10 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
 	cmd->rnw = ccc->rnw;
 	cmd->cmd0 = 0;
 
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (ret)
+		return ret;
+
 	renesas_i3c_bus_enable(m, true);
 
 	/* Calculate the command descriptor. */
@@ -819,12 +864,17 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
 		}
 	}
 
-	renesas_i3c_wait_xfer(i3c, xfer);
+	time_left = renesas_i3c_wait_xfer(i3c, xfer);
+	if (!time_left)
+		renesas_i3c_irqs_mask_and_clear(i3c);
 
 	ret = xfer->ret;
 	if (ret)
 		ccc->err = I3C_ERROR_M2;
 
+	pm_runtime_mark_last_busy(i3c->dev);
+	pm_runtime_put_autosuspend(i3c->dev);
+
 	return ret;
 }
 
@@ -834,7 +884,9 @@ static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer
 	struct i3c_master_controller *m = i3c_dev_get_master(dev);
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
 	struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
-	int i;
+	unsigned long time_left;
+	bool xfer_failed = false;
+	int i, ret;
 
 	struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1);
 	if (!xfer)
@@ -842,6 +894,10 @@ static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer
 
 	init_completion(&xfer->comp);
 
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (ret)
+		return ret;
+
 	/* Enable I3C bus. */
 	renesas_i3c_bus_enable(m, true);
 
@@ -873,9 +929,17 @@ static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer
 				renesas_set_bit(i3c->regs, NTIE, NTIE_TDBEIE0);
 		}
 
-		renesas_i3c_wait_xfer(i3c, xfer);
+		time_left = renesas_i3c_wait_xfer(i3c, xfer);
+		if (!time_left)
+			xfer_failed = true;
 	}
 
+	if (xfer_failed)
+		renesas_i3c_irqs_mask_and_clear(i3c);
+
+	pm_runtime_mark_last_busy(i3c->dev);
+	pm_runtime_put_autosuspend(i3c->dev);
+
 	return 0;
 }
 
@@ -884,15 +948,21 @@ static int renesas_i3c_attach_i3c_dev(struct i3c_dev_desc *dev)
 	struct i3c_master_controller *m = i3c_dev_get_master(dev);
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
 	struct renesas_i3c_i2c_dev_data *data;
-	int pos;
+	int pos, ret;
 
 	pos = renesas_i3c_get_free_pos(i3c);
 	if (pos < 0)
 		return pos;
 
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (ret)
+		return ret;
+
 	data = kzalloc(sizeof(*data), GFP_KERNEL);
-	if (!data)
-		return -ENOMEM;
+	if (!data) {
+		ret = -ENOMEM;
+		goto rpm_put;
+	}
 
 	data->index = pos;
 	i3c->addrs[pos] = dev->info.dyn_addr ? : dev->info.static_addr;
@@ -902,7 +972,11 @@ static int renesas_i3c_attach_i3c_dev(struct i3c_dev_desc *dev)
 				    datbas_dvdyad_with_parity(i3c->addrs[pos]));
 	i3c_dev_set_master_data(dev, data);
 
-	return 0;
+rpm_put:
+	pm_runtime_mark_last_busy(i3c->dev);
+	pm_runtime_put_autosuspend(i3c->dev);
+
+	return ret;
 }
 
 static int renesas_i3c_reattach_i3c_dev(struct i3c_dev_desc *dev,
@@ -911,7 +985,11 @@ static int renesas_i3c_reattach_i3c_dev(struct i3c_dev_desc *dev,
 	struct i3c_master_controller *m = i3c_dev_get_master(dev);
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
 	struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
-	int pos;
+	int pos, ret;
+
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (ret)
+		return ret;
 
 	pos = renesas_i3c_get_free_pos(i3c);
 
@@ -931,6 +1009,9 @@ static int renesas_i3c_reattach_i3c_dev(struct i3c_dev_desc *dev,
 		       DATBAS_DVSTAD(dev->info.static_addr) |
 		       datbas_dvdyad_with_parity(i3c->addrs[data->index]));
 
+	pm_runtime_mark_last_busy(i3c->dev);
+	pm_runtime_put_autosuspend(i3c->dev);
+
 	return 0;
 }
 
@@ -939,13 +1020,21 @@ static void renesas_i3c_detach_i3c_dev(struct i3c_dev_desc *dev)
 	struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
 	struct i3c_master_controller *m = i3c_dev_get_master(dev);
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
+	int ret;
 
-	renesas_writel(i3c->regs, DATBAS(data->index), 0);
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (!ret)
+		renesas_writel(i3c->regs, DATBAS(data->index), 0);
 
 	i3c_dev_set_master_data(dev, NULL);
 	i3c->addrs[data->index] = 0;
 	i3c->free_pos |= BIT(data->index);
 	kfree(data);
+
+	if (!ret) {
+		pm_runtime_mark_last_busy(i3c->dev);
+		pm_runtime_put_autosuspend(i3c->dev);
+	}
 }
 
 static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
@@ -956,7 +1045,9 @@ static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
 	struct renesas_i3c *i3c = to_renesas_i3c(m);
 	struct renesas_i3c_cmd *cmd;
 	u8 start_bit = CNDCTL_STCND;
-	int i;
+	unsigned long time_left;
+	bool xfer_failed = false;
+	int i, ret;
 
 	if (!i2c_nxfers)
 		return 0;
@@ -969,11 +1060,15 @@ static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
 	xfer->is_i2c_xfer = true;
 	cmd = xfer->cmds;
 
+	ret = pm_runtime_resume_and_get(i3c->dev);
+	if (ret)
+		return ret;
+
 	renesas_i3c_bus_enable(m, false);
 
 	if (!(renesas_readl(i3c->regs, BCST) & BCST_BFREF)) {
 		cmd->err = -EBUSY;
-		return cmd->err;
+		goto rpm_put;
 	}
 
 	renesas_writel(i3c->regs, BST, 0);
@@ -995,7 +1090,9 @@ static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
 
 		renesas_set_bit(i3c->regs, NTSTE, NTSTE_TDBEE0);
 
-		wait_for_completion_timeout(&xfer->comp, m->i2c.timeout);
+		time_left = wait_for_completion_timeout(&xfer->comp, m->i2c.timeout);
+		if (!time_left)
+			xfer_failed = true;
 
 		if (cmd->err)
 			break;
@@ -1004,6 +1101,14 @@ static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
 	}
 
 	renesas_i3c_dequeue_xfer(i3c, xfer);
+
+	if (xfer_failed)
+		renesas_i3c_irqs_mask_and_clear(i3c);
+
+rpm_put:
+	pm_runtime_mark_last_busy(i3c->dev);
+	pm_runtime_put_autosuspend(i3c->dev);
+
 	return cmd->err;
 }
 
@@ -1390,12 +1495,16 @@ static int renesas_i3c_probe(struct platform_device *pdev)
 	if (IS_ERR(i3c->regs))
 		return PTR_ERR(i3c->regs);
 
-	ret = devm_clk_bulk_get_all_enabled(&pdev->dev, &i3c->clks);
-	if (ret <= RENESAS_I3C_TCLK_IDX)
-		return dev_err_probe(&pdev->dev, ret < 0 ? ret : -EINVAL,
-				     "Failed to get clocks (need > %d, got %d)\n",
-				     RENESAS_I3C_TCLK_IDX, ret);
-	i3c->num_clks = ret;
+	i3c->tclk = devm_clk_get(&pdev->dev, "tclk");
+	if (IS_ERR(i3c->tclk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(i3c->tclk), "Failed to get tclk");
+
+	i3c->dev = &pdev->dev;
+	pm_runtime_set_autosuspend_delay(&pdev->dev, 300);
+	pm_runtime_use_autosuspend(&pdev->dev);
+	ret = devm_pm_runtime_enable(&pdev->dev);
+	if (ret)
+		return ret;
 
 	i3c->tresetn = devm_reset_control_get_optional_exclusive(&pdev->dev, "tresetn");
 	if (IS_ERR(i3c->tresetn))
@@ -1482,8 +1591,6 @@ static int renesas_i3c_suspend(struct device *dev)
 	if (ret)
 		goto err_mark_resumed;
 
-	clk_bulk_disable(i3c->num_clks, i3c->clks);
-
 	return 0;
 
 err_mark_resumed:
@@ -1505,13 +1612,13 @@ static int renesas_i3c_resume(struct device *dev)
 	if (ret)
 		return ret;
 
-	ret = clk_bulk_enable(i3c->num_clks, i3c->clks);
+	ret = renesas_i3c_reset(i3c);
 	if (ret)
 		goto err_resets_asserted;
 
-	ret = renesas_i3c_reset(i3c);
+	ret = pm_runtime_resume_and_get(dev);
 	if (ret)
-		goto err_clks_disable;
+		goto err_resets_asserted;
 
 	/* Re-store I3C registers value. */
 	renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
@@ -1530,15 +1637,24 @@ static int renesas_i3c_resume(struct device *dev)
 
 	i2c_mark_adapter_resumed(&i3c->base.i2c);
 
+	pm_runtime_mark_last_busy(dev);
+	pm_runtime_put_autosuspend(dev);
+
 	/*
 	 * I3C devices may have retained their dynamic address anyway. Do not
 	 * fail the resume because of DAA error.
 	 */
 	return 0;
 
-err_clks_disable:
-	clk_bulk_disable(i3c->num_clks, i3c->clks);
 err_resets_asserted:
+	/*
+	 * If this happens, there is no way to recover from this state without
+	 * reloading the driver. We want to avoid keeping the reset line
+	 * deasserted unnecessarily. The runtime paths will still work correctly
+	 * even if the IP registers are accessed while reset is asserted (e.g.
+	 * if a runtime path is triggered after a failed resume). Checked on
+	 * RZ/G3S.
+	 */
 	reset_control_bulk_assert(ARRAY_SIZE(resets), resets);
 	return ret;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 20/34] i3c: renesas: Drop unused structure member 'resuming'
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (18 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 19/34] i3c: renesas: Add runtime PM support Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 21/34] i3c: renesas: Don't register devices when ENTDAA times out Claudiu Beznea
                   ` (9 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 2cdb9c2138bef5f767dd786431fd6ca7581177aa upstream.

The struct renesas_i3c::resuming is a leftover from a rebase. It is not
used anywhere within the driver. Drop it.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260721191618.1850795-1-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 251f130abf3a..3764d7ba0a2e 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -263,7 +263,6 @@ struct renesas_i3c {
 	u8 addrs[RENESAS_I3C_MAX_DEVS];
 	unsigned long rate;
 	enum i3c_internal_state internal_state;
-	bool resuming;
 	u32 free_pos;
 	u32 dyn_addr;
 	u32 i2c_STDBR;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 21/34] i3c: renesas: Don't register devices when ENTDAA times out
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (19 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 20/34] i3c: renesas: Drop unused structure member 'resuming' Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 22/34] pinctrl: renesas: rzg2l: Fix type in .pin_config_group_get() callback Claudiu Beznea
                   ` (8 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>

commit b6e56fd8c8a8ac7992868a28702192372ab04015 upstream.

renesas_i3c_daa() derives the number of newly assigned dynamic addresses
from cmd->rx_count, which the response ISR sets to the number of address
slots ENTDAA left unassigned. It starts out as zero, which already means
"every address was assigned", so a timed out transfer leaves that value
in place and it gets used as a result.

On a bus with no target connected the ENTDAA times out and the driver
registers RENESAS_I3C_MAX_DEVS devices that are not there, each costing
the core two seconds on a GETPID that can only time out:

  i3c i3c-0: Failed to add I3C device at address 9, error -110
  ...
  i3c i3c-0: Failed to add I3C device at address 16, error -110

Start from maxdevs instead: no address is assigned before ENTDAA runs,
and the existing rx_count >= maxdevs check then reports an empty bus.

Fixes: d028219a9f14 ("i3c: master: Add basic driver for the Renesas I3C controller")
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260731070150.2519825-1-tommaso.merciai.xr@bp.renesas.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 3764d7ba0a2e..da19c2d6a0b1 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -693,7 +693,7 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 
 	init_completion(&xfer->comp);
 	cmd = xfer->cmds;
-	cmd->rx_count = 0;
+	cmd->rx_count = i3c->maxdevs;
 
 	ret = pm_runtime_resume_and_get(i3c->dev);
 	if (ret)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 22/34] pinctrl: renesas: rzg2l: Fix type in .pin_config_group_get() callback
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (20 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 21/34] i3c: renesas: Don't register devices when ENTDAA times out Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 23/34] pinctrl: renesas: rzg2l: Keep member documentation aligned Claudiu Beznea
                   ` (7 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Geert Uytterhoeven <geert+renesas@glider.be>

commit f246b6c2bdeca803364af9789309559e5274fa34 upstream.

On 64-bit platforms, "unsigned long" is 64-bit.  Hence checking if all
"unsigned long" configuration values are equal should be done using an
"unsigned long" temporary.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/6befae30f129daffd94f7a9507d874443e444a21.1777562725.git.geert+renesas@glider.be
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 773926f8da6a..32f508231ade 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -1644,8 +1644,9 @@ static int rzg2l_pinctrl_pinconf_group_get(struct pinctrl_dev *pctldev,
 					   unsigned int group,
 					   unsigned long *config)
 {
+	unsigned long prev_config = 0;
 	const unsigned int *pins;
-	unsigned int i, npins, prev_config = 0;
+	unsigned int i, npins;
 	int ret;
 
 	ret = pinctrl_generic_get_group_pins(pctldev, group, &pins, &npins);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 23/34] pinctrl: renesas: rzg2l: Keep member documentation aligned
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (21 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 22/34] pinctrl: renesas: rzg2l: Fix type in .pin_config_group_get() callback Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 24/34] pinctrl: renesas: rzg2l: Make QSPI register handling conditional Claudiu Beznea
                   ` (6 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit b3ea1cac08b25aad9e0a360c694198b37e35706a upstream.

Keep the documentation for struct rzg2l_pinctrl_reg_cache members aligned
with the struct member order.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20260528080439.615958-4-claudiu.beznea@kernel.org
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[claudiu.beznea: dropped other_poc since it is not present]
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 32f508231ade..4bf3cd11f39a 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -318,8 +318,8 @@ struct rzg2l_pinctrl_pin_settings {
  * @pmc: PMC registers cache
  * @pfc: PFC registers cache
  * @iolh: IOLH registers cache
- * @pupd: PUPD registers cache
  * @ien: IEN registers cache
+ * @pupd: PUPD registers cache
  * @smt: SMT registers cache
  * @sd_ch: SD_CH registers cache
  * @eth_poc: ET_POC registers cache
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 24/34] pinctrl: renesas: rzg2l: Make QSPI register handling conditional
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (22 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 23/34] pinctrl: renesas: rzg2l: Keep member documentation aligned Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 25/34] pinctrl: renesas: rzg2l: Generalize power source code Claudiu Beznea
                   ` (5 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Biju Das <biju.das.jz@bp.renesas.com>

commit 55793d3ddf774e9bbeed3c940fb19d6c1124b6d3 upstream.

The QSPI register at offset 0x3008 is not present on all SoCs supported by
the RZ/G2L pinctrl driver. Unconditionally reading and writing this
register during suspend/resume on hardware that lacks it can cause
undefined behaviour.

Add a qspi field to rzg2l_register_offsets to allow per-SoC declaration of
the QSPI register offset, and guard the suspend/resume accesses with a
check on that field. Populate the offset only for the RZ/{G2L,G2LC,G2UL,
Five} hardware configuration, which is where the register is known to
exist.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260430093422.74812-3-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 4bf3cd11f39a..855c8aa8225f 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -144,7 +144,7 @@
 #define SMT(off)		(0x3400 + (off) * 8)
 #define SD_CH(off, ch)		((off) + (ch) * 4)
 #define ETH_POC(off, ch)	((off) + (ch) * 4)
-#define QSPI			(0x3008)
+#define QSPI			(0x3008) /* known on RZ/{G2L,G2LC,G2UL,Five} only */
 
 #define PVDD_2500		2	/* I/O domain voltage 2.5V */
 #define PVDD_1800		1	/* I/O domain voltage <= 1.8V */
@@ -219,12 +219,14 @@ static const struct pin_config_item renesas_rzv2h_conf_items[] = {
  * @sd_ch: SD_CH register offset
  * @eth_poc: ETH_POC register offset
  * @oen: OEN register offset
+ * @qspi: QSPI register offset
  */
 struct rzg2l_register_offsets {
 	u16 pwpr;
 	u16 sd_ch;
 	u16 eth_poc;
 	u16 oen;
+	u16 qspi;
 };
 
 /**
@@ -3201,7 +3203,8 @@ static int rzg2l_pinctrl_suspend_noirq(struct device *dev)
 			cache->eth_poc[i] = readb(pctrl->base + ETH_POC(regs->eth_poc, i));
 	}
 
-	cache->qspi = readb(pctrl->base + QSPI);
+	if (regs->qspi)
+		cache->qspi = readb(pctrl->base + regs->qspi);
 	cache->oen = readb(pctrl->base + pctrl->data->hwcfg->regs.oen);
 
 	if (!atomic_read(&pctrl->wakeup_path))
@@ -3227,7 +3230,8 @@ static int rzg2l_pinctrl_resume_noirq(struct device *dev)
 			return ret;
 	}
 
-	writeb(cache->qspi, pctrl->base + QSPI);
+	if (regs->qspi)
+		writeb(cache->qspi, pctrl->base + regs->qspi);
 
 	raw_spin_lock_irqsave(&pctrl->lock, flags);
 	rzg2l_oen_write_with_pwpr(pctrl, cache->oen);
@@ -3285,6 +3289,7 @@ static const struct rzg2l_hwcfg rzg2l_hwcfg = {
 		.sd_ch = 0x3000,
 		.eth_poc = 0x300c,
 		.oen = 0x3018,
+		.qspi = QSPI,
 	},
 	.iolh_groupa_ua = {
 		/* 3v3 power source */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 25/34] pinctrl: renesas: rzg2l: Generalize power source code
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (23 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 24/34] pinctrl: renesas: rzg2l: Make QSPI register handling conditional Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 26/34] pinctrl: renesas: rzg2l: Drop defines present in struct rzg2l_hwcfg Claudiu Beznea
                   ` (4 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 342a7ce6d2f7b13037f0f993ca760779c53834d9 upstream.

The current functions used to get/set the pin power source check the
OTHER_POC register, which is specific to the RZ/G3L SoC only.  To allow
the code to be extended for other power source functionalities (e.g. I3C
on RZ/G3S), generalize the functions used to get/set the pin power
source.

For this, introduce the struct rzg2l_register_masks data structure whose
purpose is to store SoC specific register bit masks.  The members of
this structure are then used in rzg2l_caps_to_pwr_reg() to retrieve the
bitmask corresponding to a SoC specific power source capability.

The conversion between HW specific power source values and SW specific
power source values is now handled through rzg2l_pwr_reg_val_to_ps() and
rzg2l_ps_to_pwr_reg_val().

Finally, to keep the code generic, the register update in
rzg2l_set_power_source() was changed to a read-modify-write approach to
cover all cases.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20260904125425.412632-2-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[claudiu.beznea:
 - fixed conflict
 - dropped sd_ch2 and PIN_CFG_OTHER_POC_MASK specific code
 - dropped RZ/G3L specific code
 - dropped struct rzg2l_register_masks since it is not used]
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 128 +++++++++++++++---------
 1 file changed, 81 insertions(+), 47 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 855c8aa8225f..817d974ef242 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -149,6 +149,7 @@
 #define PVDD_2500		2	/* I/O domain voltage 2.5V */
 #define PVDD_1800		1	/* I/O domain voltage <= 1.8V */
 #define PVDD_3300		0	/* I/O domain voltage >= 3.3V */
+#define PVDD_MASK		0x3
 
 #define PWPR_B0WI		BIT(7)	/* Bit Write Disable */
 #define PWPR_PFCWE		BIT(6)	/* PFC Register Write Enable */
@@ -898,37 +899,37 @@ static void rzg2l_rmw_pin_config(struct rzg2l_pinctrl *pctrl, u32 offset,
 	raw_spin_unlock_irqrestore(&pctrl->lock, flags);
 }
 
-static int rzg2l_caps_to_pwr_reg(const struct rzg2l_register_offsets *regs, u32 caps)
+static int rzg2l_caps_to_pwr_reg(const struct rzg2l_register_offsets *regs,
+				 u32 caps, u16 *offset, u8 *mask)
 {
-	if (caps & PIN_CFG_IO_VMC_SD0)
-		return SD_CH(regs->sd_ch, 0);
-	if (caps & PIN_CFG_IO_VMC_SD1)
-		return SD_CH(regs->sd_ch, 1);
-	if (caps & PIN_CFG_IO_VMC_ETH0)
-		return ETH_POC(regs->eth_poc, 0);
-	if (caps & PIN_CFG_IO_VMC_ETH1)
-		return ETH_POC(regs->eth_poc, 1);
-	if (caps & PIN_CFG_IO_VMC_QSPI)
-		return QSPI;
+	*mask = PVDD_MASK;
+
+	if (caps & PIN_CFG_IO_VMC_SD0) {
+		*offset = SD_CH(regs->sd_ch, 0);
+		return 0;
+	}
+	if (caps & PIN_CFG_IO_VMC_SD1) {
+		*offset = SD_CH(regs->sd_ch, 1);
+		return 0;
+	}
+	if (caps & PIN_CFG_IO_VMC_ETH0) {
+		*offset = ETH_POC(regs->eth_poc, 0);
+		return 0;
+	}
+	if (caps & PIN_CFG_IO_VMC_ETH1) {
+		*offset = ETH_POC(regs->eth_poc, 1);
+		return 0;
+	}
+	if (caps & PIN_CFG_IO_VMC_QSPI) {
+		*offset = regs->qspi;
+		return 0;
+	}
 
 	return -EINVAL;
 }
 
-static int rzg2l_get_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps)
+static int rzg2l_pwr_reg_val_to_ps(u8 val, u32 caps)
 {
-	const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
-	const struct rzg2l_register_offsets *regs = &hwcfg->regs;
-	int pwr_reg;
-	u8 val;
-
-	if (caps & PIN_CFG_SOFT_PS)
-		return pctrl->settings[pin].power_source;
-
-	pwr_reg = rzg2l_caps_to_pwr_reg(regs, caps);
-	if (pwr_reg < 0)
-		return pwr_reg;
-
-	val = readb(pctrl->base + pwr_reg);
 	switch (val) {
 	case PVDD_1800:
 		return 1800;
@@ -936,43 +937,76 @@ static int rzg2l_get_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps
 		return 2500;
 	case PVDD_3300:
 		return 3300;
-	default:
-		/* Should not happen. */
-		return -EINVAL;
 	}
+
+	return -EINVAL;
+}
+
+static int rzg2l_ps_to_pwr_reg_val(u32 ps, u32 caps)
+{
+	switch (ps) {
+	case 1800:
+		return PVDD_1800;
+	case 2500:
+		if (!(caps & (PIN_CFG_IO_VMC_ETH0 | PIN_CFG_IO_VMC_ETH1)))
+			return -EINVAL;
+		return PVDD_2500;
+	case 3300:
+		return PVDD_3300;
+	}
+
+	return -EINVAL;
+}
+
+static int rzg2l_get_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps)
+{
+	const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
+	const struct rzg2l_register_offsets *regs = &hwcfg->regs;
+	u8 mask, val;
+	u16 offset;
+	int ret;
+
+	if (caps & PIN_CFG_SOFT_PS)
+		return pctrl->settings[pin].power_source;
+
+	ret = rzg2l_caps_to_pwr_reg(regs, caps, &offset, &mask);
+	if (ret)
+		return ret;
+
+	val = readb(pctrl->base + offset);
+
+	return rzg2l_pwr_reg_val_to_ps(field_get(mask, val), caps);
 }
 
 static int rzg2l_set_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps, u32 ps)
 {
 	const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
 	const struct rzg2l_register_offsets *regs = &hwcfg->regs;
-	int pwr_reg;
-	u8 val;
+	u16 offset;
+	u8 mask;
+	int ret;
 
 	if (caps & PIN_CFG_SOFT_PS) {
 		pctrl->settings[pin].power_source = ps;
 		return 0;
 	}
 
-	switch (ps) {
-	case 1800:
-		val = PVDD_1800;
-		break;
-	case 2500:
-		val = PVDD_2500;
-		break;
-	case 3300:
-		val = PVDD_3300;
-		break;
-	default:
-		return -EINVAL;
-	}
+	ret = rzg2l_caps_to_pwr_reg(regs, caps, &offset, &mask);
+	if (ret)
+		return ret;
+
+	ret = rzg2l_ps_to_pwr_reg_val(ps, caps);
+	if (ret < 0)
+		return ret;
 
-	pwr_reg = rzg2l_caps_to_pwr_reg(regs, caps);
-	if (pwr_reg < 0)
-		return pwr_reg;
+	scoped_guard(raw_spinlock_irqsave, &pctrl->lock) {
+		u8 tmp = readb(pctrl->base + offset);
+
+		tmp &= ~mask;
+		tmp |= field_prep(mask, ret);
+		writeb(tmp, pctrl->base + offset);
+	}
 
-	writeb(val, pctrl->base + pwr_reg);
 	pctrl->settings[pin].power_source = ps;
 
 	return 0;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 26/34] pinctrl: renesas: rzg2l: Drop defines present in struct rzg2l_hwcfg
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (24 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 25/34] pinctrl: renesas: rzg2l: Generalize power source code Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 27/34] pinctrl: renesas: rzg2l: Unify power source handling Claudiu Beznea
                   ` (3 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 382ec4d1e27a95ef23080c9e3bca8b44d31736f9 upstream.

Drop the QSPI and OTHER_POC register defines, which are SoC specific and
accessible through struct rzg2l_hwcfg::{qspi, other_poc}.  While at it
move the assignement of rzg2l_hwcfg->regs->qspi upper to have the
initializations as sorted (by offsets) as possible.

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20260904125425.412632-3-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[claudiu.beznea: fixed conflict by dropping defines and RZ/G3L code]
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 817d974ef242..da3f984f6038 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -144,7 +144,6 @@
 #define SMT(off)		(0x3400 + (off) * 8)
 #define SD_CH(off, ch)		((off) + (ch) * 4)
 #define ETH_POC(off, ch)	((off) + (ch) * 4)
-#define QSPI			(0x3008) /* known on RZ/{G2L,G2LC,G2UL,Five} only */
 
 #define PVDD_2500		2	/* I/O domain voltage 2.5V */
 #define PVDD_1800		1	/* I/O domain voltage <= 1.8V */
@@ -3321,9 +3320,9 @@ static const struct rzg2l_hwcfg rzg2l_hwcfg = {
 	.regs = {
 		.pwpr = 0x3014,
 		.sd_ch = 0x3000,
+		.qspi = 0x3008,
 		.eth_poc = 0x300c,
 		.oen = 0x3018,
-		.qspi = QSPI,
 	},
 	.iolh_groupa_ua = {
 		/* 3v3 power source */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 27/34] pinctrl: renesas: rzg2l: Unify power source handling
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (25 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 26/34] pinctrl: renesas: rzg2l: Drop defines present in struct rzg2l_hwcfg Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 28/34] pinctrl: renesas: rzg2l: Add RZ/G3S support for selecting I3C power source Claudiu Beznea
                   ` (2 subsequent siblings)
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit 5e1e9d0cd8f366cedac88b7463126da989704e35 upstream.

The previous code handled power sources using a mixture of power
source specific definitions and lookups in the available_ps[] array.
Unify the power source handling by introducing struct
rzg2l_pinctrl_ps_desc, whose purpose is to describe a power source
through its power source value, associated register value, associated
capabilities (e.g. Ethernet), and associated IOLH index.

Introduce two new functions, rzg2l_ps_to_desc() and
rzg2l_pwr_reg_val_to_desc(), using the
RZG2L_PINCTRL_PS_DESC_MEMBER_TO_DESC_FUNC() macro, as their
implementations are similar.

These functions retrieve a power source descriptor based on either a
power source value or a power source register value.  Other functions
that need to perform power source specific operations can call them to
retrieve the corresponding power source descriptor.

The register values for the soft power sources were kept to zero since
they are not used across the driver's code.

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260904125425.412632-4-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[claudiu.beznea:
- fixed conflict by dropping defines and RZ/G3L code
- dropped AWO, WDTOVF and ISO voltage domains
- dropped PIN_CFG_IO_VMC_SD2]
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 146 +++++++++++++++---------
 1 file changed, 92 insertions(+), 54 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index da3f984f6038..faccc764e09c 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -145,9 +145,6 @@
 #define SD_CH(off, ch)		((off) + (ch) * 4)
 #define ETH_POC(off, ch)	((off) + (ch) * 4)
 
-#define PVDD_2500		2	/* I/O domain voltage 2.5V */
-#define PVDD_1800		1	/* I/O domain voltage <= 1.8V */
-#define PVDD_3300		0	/* I/O domain voltage >= 3.3V */
 #define PVDD_MASK		0x3
 
 #define PWPR_B0WI		BIT(7)	/* Bit Write Disable */
@@ -231,12 +228,14 @@ struct rzg2l_register_offsets {
 
 /**
  * enum rzg2l_iolh_index - starting indices in IOLH specific arrays
+ * @RZG2L_IOLH_IDX_NA: index N/A (to be used for error checking)
  * @RZG2L_IOLH_IDX_1V8: starting index for 1V8 power source
  * @RZG2L_IOLH_IDX_2V5: starting index for 2V5 power source
  * @RZG2L_IOLH_IDX_3V3: starting index for 3V3 power source
  * @RZG2L_IOLH_IDX_MAX: maximum index
  */
 enum rzg2l_iolh_index {
+	RZG2L_IOLH_IDX_NA = -1,
 	RZG2L_IOLH_IDX_1V8 = 0,
 	RZG2L_IOLH_IDX_2V5 = 4,
 	RZG2L_IOLH_IDX_3V3 = 8,
@@ -369,7 +368,69 @@ struct rzg2l_pinctrl {
 	atomic_t			wakeup_path;
 };
 
-static const u16 available_ps[] = { 1800, 2500, 3300 };
+/**
+ * struct rzg2l_pinctrl_ps_desc - RZ/G2L power source descriptor
+ * @caps: Capabilities that applies to the power source
+ * @iolh_index: IOLH index
+ * @ps: Power source value
+ * @pwr_reg_val: Power source register value
+ */
+struct rzg2l_pinctrl_ps_desc {
+	u32 caps;
+	enum rzg2l_iolh_index iolh_index;
+	u16 ps;
+	u16 pwr_reg_val;
+};
+
+#define RZG2L_PINCTRL_PS_DESC(_ps, _pwr_reg_val, _caps, _iolh_index) \
+	{ \
+		.ps = _ps, \
+		.pwr_reg_val = _pwr_reg_val, \
+		.caps = _caps, \
+		.iolh_index = _iolh_index, \
+	}
+
+static const struct rzg2l_pinctrl_ps_desc available_ps[] = {
+	/* Ethernet I/O voltage domains */
+	RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_IO_VMC_ETH0 | PIN_CFG_IO_VMC_ETH1,
+			      RZG2L_IOLH_IDX_1V8),
+	RZG2L_PINCTRL_PS_DESC(2500, 2, PIN_CFG_IO_VMC_ETH0 | PIN_CFG_IO_VMC_ETH1,
+			      RZG2L_IOLH_IDX_2V5),
+	RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_IO_VMC_ETH0 | PIN_CFG_IO_VMC_ETH1,
+			      RZG2L_IOLH_IDX_3V3),
+
+	/* SD I/O voltage domains */
+	RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_IO_VMC_SD0 | PIN_CFG_IO_VMC_SD1,
+			      RZG2L_IOLH_IDX_1V8),
+	RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_IO_VMC_SD0 | PIN_CFG_IO_VMC_SD1,
+			      RZG2L_IOLH_IDX_3V3),
+
+	/* QSPI I/O voltage domains */
+	RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_IO_VMC_QSPI, RZG2L_IOLH_IDX_1V8),
+	RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_IO_VMC_QSPI, RZG2L_IOLH_IDX_3V3),
+
+	/* Software voltage domains */
+	RZG2L_PINCTRL_PS_DESC(1800, 0, PIN_CFG_SOFT_PS, RZG2L_IOLH_IDX_1V8),
+	RZG2L_PINCTRL_PS_DESC(2500, 0, PIN_CFG_SOFT_PS, RZG2L_IOLH_IDX_2V5),
+	RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_SOFT_PS, RZG2L_IOLH_IDX_3V3),
+};
+
+#define RZG2L_PINCTRL_PS_DESC_MEMBER_TO_DESC_FUNC(_name, _desc_member, _caps)	\
+static const struct rzg2l_pinctrl_ps_desc *_name(u16 _desc_member, u32 _caps)	\
+{										\
+	for (unsigned int i = 0; i < ARRAY_SIZE(available_ps); i++) {		\
+		if (available_ps[i]._desc_member != _desc_member)		\
+			continue;						\
+										\
+		if (available_ps[i].caps & _caps)				\
+			return &available_ps[i];				\
+	}									\
+										\
+	return NULL;								\
+}
+
+RZG2L_PINCTRL_PS_DESC_MEMBER_TO_DESC_FUNC(rzg2l_ps_to_desc, ps, caps)
+RZG2L_PINCTRL_PS_DESC_MEMBER_TO_DESC_FUNC(rzg2l_pwr_reg_val_to_desc, pwr_reg_val, caps)
 
 static u64 rzg2l_pinctrl_get_variable_pin_cfg(struct rzg2l_pinctrl *pctrl,
 					      u64 pincfg,
@@ -927,34 +988,26 @@ static int rzg2l_caps_to_pwr_reg(const struct rzg2l_register_offsets *regs,
 	return -EINVAL;
 }
 
-static int rzg2l_pwr_reg_val_to_ps(u8 val, u32 caps)
+static int rzg2l_pwr_reg_val_to_ps(u16 pwr_reg_val, u32 caps)
 {
-	switch (val) {
-	case PVDD_1800:
-		return 1800;
-	case PVDD_2500:
-		return 2500;
-	case PVDD_3300:
-		return 3300;
-	}
+	const struct rzg2l_pinctrl_ps_desc *desc;
 
-	return -EINVAL;
+	desc = rzg2l_pwr_reg_val_to_desc(pwr_reg_val, caps);
+	if (!desc)
+		return -EINVAL;
+
+	return desc->ps;
 }
 
-static int rzg2l_ps_to_pwr_reg_val(u32 ps, u32 caps)
+static int rzg2l_ps_to_pwr_reg_val(u16 ps, u32 caps)
 {
-	switch (ps) {
-	case 1800:
-		return PVDD_1800;
-	case 2500:
-		if (!(caps & (PIN_CFG_IO_VMC_ETH0 | PIN_CFG_IO_VMC_ETH1)))
-			return -EINVAL;
-		return PVDD_2500;
-	case 3300:
-		return PVDD_3300;
-	}
+	const struct rzg2l_pinctrl_ps_desc *desc;
 
-	return -EINVAL;
+	desc = rzg2l_ps_to_desc(ps, caps);
+	if (!desc)
+		return -EINVAL;
+
+	return desc->pwr_reg_val;
 }
 
 static int rzg2l_get_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps)
@@ -1011,32 +1064,11 @@ static int rzg2l_set_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps
 	return 0;
 }
 
-static bool rzg2l_ps_is_supported(u16 ps)
+static enum rzg2l_iolh_index rzg2l_ps_to_iolh_idx(u16 ps, u32 caps)
 {
-	unsigned int i;
+	const struct rzg2l_pinctrl_ps_desc *desc = rzg2l_ps_to_desc(ps, caps);
 
-	for (i = 0; i < ARRAY_SIZE(available_ps); i++) {
-		if (available_ps[i] == ps)
-			return true;
-	}
-
-	return false;
-}
-
-static enum rzg2l_iolh_index rzg2l_ps_to_iolh_idx(u16 ps)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(available_ps); i++) {
-		if (available_ps[i] == ps)
-			break;
-	}
-
-	/*
-	 * We multiply with RZG2L_IOLH_MAX_DS_ENTRIES as we have
-	 * RZG2L_IOLH_MAX_DS_ENTRIES DS values per power source
-	 */
-	return i * RZG2L_IOLH_MAX_DS_ENTRIES;
+	return desc ? desc->iolh_index : RZG2L_IOLH_IDX_NA;
 }
 
 static u16 rzg2l_iolh_val_to_ua(const struct rzg2l_hwcfg *hwcfg, u32 caps, u8 val)
@@ -1421,7 +1453,11 @@ static int rzg2l_pinctrl_pinconf_get(struct pinctrl_dev *pctldev,
 		ret = rzg2l_get_power_source(pctrl, _pin, cfg);
 		if (ret < 0)
 			return ret;
-		iolh_idx = rzg2l_ps_to_iolh_idx(ret);
+
+		iolh_idx = rzg2l_ps_to_iolh_idx(ret, cfg);
+		if (iolh_idx == RZG2L_IOLH_IDX_NA)
+			return -EINVAL;
+
 		val = rzg2l_read_pin_config(pctrl, IOLH(off), bit, IOLH_MASK);
 		arg = rzg2l_iolh_val_to_ua(hwcfg, cfg, iolh_idx + val);
 		break;
@@ -1618,8 +1654,7 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev,
 
 	/* Apply power source. */
 	if (settings.power_source != pctrl->settings[_pin].power_source) {
-		ret = rzg2l_ps_is_supported(settings.power_source);
-		if (!ret)
+		if (!rzg2l_ps_to_desc(settings.power_source, cfg))
 			return -EINVAL;
 
 		/* Apply power source. */
@@ -1633,7 +1668,10 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev,
 		enum rzg2l_iolh_index iolh_idx;
 		int val;
 
-		iolh_idx = rzg2l_ps_to_iolh_idx(settings.power_source);
+		iolh_idx = rzg2l_ps_to_iolh_idx(settings.power_source, cfg);
+		if (iolh_idx == RZG2L_IOLH_IDX_NA)
+			return -EINVAL;
+
 		ret = rzg2l_ds_is_supported(pctrl, cfg, iolh_idx,
 					    settings.drive_strength_ua);
 		if (!ret)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 28/34] pinctrl: renesas: rzg2l: Add RZ/G3S support for selecting I3C power source
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (26 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 27/34] pinctrl: renesas: rzg2l: Unify power source handling Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 29/34] clk: renesas: r9a08g045: Add I3C clocks and resets Claudiu Beznea
  2026-11-23 21:16 ` [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Pavel Machek
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

commit ec5202ccfa24791acf64146d5bac6b63ce234f95 upstream.

The Renesas RZ/G3S I3C pins can be powered at either 1.8V or 1.2V.  The
pin controller provides a register to select between these two options.
Update the Renesas RZ/G2L pin controller driver to allow selecting the
I3C power source on RZ/G3S SoC.

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20260904125425.412632-6-claudiu.beznea+renesas@tuxon.dev
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[claudiu.beznea:
 - fixed conflict in the defines code and adjusted PIN_CFG_IO_VMC_I3C to
   use bit 19 instead of 23
 - fixed conflict in rzg2l_register_offsets by keeping only the i3c_set
   member
 - dropped RZ/G3L code from rzg2l_register_masks and get rid of anonimous
   union
 - fixed conflict in available_ps[] by keeping the I3C voltage domain
 - in rzg2l_caps_to_pwr_reg(), rzg2l_pinctrl_suspend_noirq(),
   rzg2l_pinctrl_resume_noirq() fixed conflict by keeping the I3C code only
 - introduced masks member to struct rzg2l_hwcfg as initially presented in
   commit 342a7ce6d2f7 ("pinctrl: renesas: rzg2l: Generalize power source
   code") since this is its first user in v6.1 CIP]
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 42 +++++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index faccc764e09c..fa4d70d043d8 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -62,6 +62,7 @@
 #define PIN_CFG_SMT			BIT(16)	/* Schmitt-trigger input control */
 #define PIN_CFG_ELC			BIT(17)
 #define PIN_CFG_IOLH_RZV2H		BIT(18)
+#define PIN_CFG_IO_VMC_I3C		BIT(19)
 
 #define RZG2L_SINGLE_PIN		BIT_ULL(63)	/* Dedicated pin */
 #define RZG2L_VARIABLE_CFG		BIT_ULL(62)	/* Variable cfg for port pins */
@@ -217,6 +218,7 @@ static const struct pin_config_item renesas_rzv2h_conf_items[] = {
  * @eth_poc: ETH_POC register offset
  * @oen: OEN register offset
  * @qspi: QSPI register offset
+ * @i3c_set: I3C_SET register offset
  */
 struct rzg2l_register_offsets {
 	u16 pwpr;
@@ -224,6 +226,15 @@ struct rzg2l_register_offsets {
 	u16 eth_poc;
 	u16 oen;
 	u16 qspi;
+	u16 i3c_set;
+};
+
+/**
+ * struct rzg2l_register_masks - Masks for different RZ/G2L pinctrl functionalities
+ * @i3c_set_poc: I3C_SET_POC mask
+ */
+struct rzg2l_register_masks {
+	u8 i3c_set_poc;
 };
 
 /**
@@ -248,6 +259,8 @@ enum rzg2l_iolh_index {
 /**
  * struct rzg2l_hwcfg - hardware configuration data structure
  * @regs: hardware specific register offsets
+ * @masks: hardware specific masks for various functionalities available in
+ * the registers described by regs
  * @iolh_groupa_ua: IOLH group A uA specific values
  * @iolh_groupb_ua: IOLH group B uA specific values
  * @iolh_groupc_ua: IOLH group C uA specific values
@@ -261,6 +274,7 @@ enum rzg2l_iolh_index {
  */
 struct rzg2l_hwcfg {
 	const struct rzg2l_register_offsets regs;
+	const struct rzg2l_register_masks masks;
 	u16 iolh_groupa_ua[RZG2L_IOLH_IDX_MAX];
 	u16 iolh_groupb_ua[RZG2L_IOLH_IDX_MAX];
 	u16 iolh_groupc_ua[RZG2L_IOLH_IDX_MAX];
@@ -326,6 +340,7 @@ struct rzg2l_pinctrl_pin_settings {
  * @eth_poc: ET_POC registers cache
  * @oen: Output Enable register cache
  * @qspi: QSPI registers cache
+ * @i3c_set: I3C_SET register cache
  */
 struct rzg2l_pinctrl_reg_cache {
 	u8	*p;
@@ -340,6 +355,7 @@ struct rzg2l_pinctrl_reg_cache {
 	u8	eth_poc[2];
 	u8	oen;
 	u8	qspi;
+	u8	i3c_set;
 };
 
 struct rzg2l_pinctrl {
@@ -409,6 +425,10 @@ static const struct rzg2l_pinctrl_ps_desc available_ps[] = {
 	RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_IO_VMC_QSPI, RZG2L_IOLH_IDX_1V8),
 	RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_IO_VMC_QSPI, RZG2L_IOLH_IDX_3V3),
 
+	/* I3C I/O voltage domains */
+	RZG2L_PINCTRL_PS_DESC(1200, 1, PIN_CFG_IO_VMC_I3C, RZG2L_IOLH_IDX_NA),
+	RZG2L_PINCTRL_PS_DESC(1800, 0, PIN_CFG_IO_VMC_I3C, RZG2L_IOLH_IDX_NA),
+
 	/* Software voltage domains */
 	RZG2L_PINCTRL_PS_DESC(1800, 0, PIN_CFG_SOFT_PS, RZG2L_IOLH_IDX_1V8),
 	RZG2L_PINCTRL_PS_DESC(2500, 0, PIN_CFG_SOFT_PS, RZG2L_IOLH_IDX_2V5),
@@ -960,6 +980,7 @@ static void rzg2l_rmw_pin_config(struct rzg2l_pinctrl *pctrl, u32 offset,
 }
 
 static int rzg2l_caps_to_pwr_reg(const struct rzg2l_register_offsets *regs,
+				 const struct rzg2l_register_masks *masks,
 				 u32 caps, u16 *offset, u8 *mask)
 {
 	*mask = PVDD_MASK;
@@ -984,6 +1005,11 @@ static int rzg2l_caps_to_pwr_reg(const struct rzg2l_register_offsets *regs,
 		*offset = regs->qspi;
 		return 0;
 	}
+	if (caps & PIN_CFG_IO_VMC_I3C) {
+		*offset = regs->i3c_set;
+		*mask = masks->i3c_set_poc;
+		return 0;
+	}
 
 	return -EINVAL;
 }
@@ -1014,6 +1040,7 @@ static int rzg2l_get_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps
 {
 	const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
 	const struct rzg2l_register_offsets *regs = &hwcfg->regs;
+	const struct rzg2l_register_masks *masks = &hwcfg->masks;
 	u8 mask, val;
 	u16 offset;
 	int ret;
@@ -1021,7 +1048,7 @@ static int rzg2l_get_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps
 	if (caps & PIN_CFG_SOFT_PS)
 		return pctrl->settings[pin].power_source;
 
-	ret = rzg2l_caps_to_pwr_reg(regs, caps, &offset, &mask);
+	ret = rzg2l_caps_to_pwr_reg(regs, masks, caps, &offset, &mask);
 	if (ret)
 		return ret;
 
@@ -1034,6 +1061,7 @@ static int rzg2l_set_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps
 {
 	const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
 	const struct rzg2l_register_offsets *regs = &hwcfg->regs;
+	const struct rzg2l_register_masks *masks = &hwcfg->masks;
 	u16 offset;
 	u8 mask;
 	int ret;
@@ -1043,7 +1071,7 @@ static int rzg2l_set_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps
 		return 0;
 	}
 
-	ret = rzg2l_caps_to_pwr_reg(regs, caps, &offset, &mask);
+	ret = rzg2l_caps_to_pwr_reg(regs, masks, caps, &offset, &mask);
 	if (ret)
 		return ret;
 
@@ -2288,6 +2316,8 @@ static const struct rzg2l_dedicated_configs rzg3s_dedicated_pins[] = {
 	{ "AUDIO_CLK1", RZG2L_SINGLE_PIN_PACK(0x2, 0, PIN_CFG_IEN) },
 	{ "AUDIO_CLK2", RZG2L_SINGLE_PIN_PACK(0x2, 1, PIN_CFG_IEN) },
 	{ "WDTOVF_PERROUT#", RZG2L_SINGLE_PIN_PACK(0x6, 0, PIN_CFG_IOLH_A | PIN_CFG_SOFT_PS) },
+	{ "I3C_SDA", RZG2L_SINGLE_PIN_PACK(0x9, 0, (PIN_CFG_IEN | PIN_CFG_IO_VMC_I3C)) },
+	{ "I3C_SCL", RZG2L_SINGLE_PIN_PACK(0x9, 1, (PIN_CFG_IEN | PIN_CFG_IO_VMC_I3C)) },
 	{ "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x10, 0, (PIN_CFG_IOLH_B | PIN_CFG_IO_VMC_SD0)) },
 	{ "SD0_CMD", RZG2L_SINGLE_PIN_PACK(0x10, 1, (PIN_CFG_IOLH_B | PIN_CFG_IEN |
 						     PIN_CFG_IO_VMC_SD0)) },
@@ -3277,6 +3307,8 @@ static int rzg2l_pinctrl_suspend_noirq(struct device *dev)
 	if (regs->qspi)
 		cache->qspi = readb(pctrl->base + regs->qspi);
 	cache->oen = readb(pctrl->base + pctrl->data->hwcfg->regs.oen);
+	if (regs->i3c_set)
+		cache->i3c_set = readb(pctrl->base + regs->i3c_set);
 
 	if (!atomic_read(&pctrl->wakeup_path))
 		clk_disable_unprepare(pctrl->clk);
@@ -3303,6 +3335,8 @@ static int rzg2l_pinctrl_resume_noirq(struct device *dev)
 
 	if (regs->qspi)
 		writeb(cache->qspi, pctrl->base + regs->qspi);
+	if (regs->i3c_set)
+		writeb(cache->i3c_set, pctrl->base + regs->i3c_set);
 
 	raw_spin_lock_irqsave(&pctrl->lock, flags);
 	rzg2l_oen_write_with_pwpr(pctrl, cache->oen);
@@ -3376,8 +3410,12 @@ static const struct rzg2l_hwcfg rzg3s_hwcfg = {
 		.pwpr = 0x3000,
 		.sd_ch = 0x3004,
 		.eth_poc = 0x3010,
+		.i3c_set = 0x301c,
 		.oen = 0x3018,
 	},
+	.masks = {
+		.i3c_set_poc = BIT(2),
+	},
 	.iolh_groupa_ua = {
 		/* 1v8 power source */
 		[RZG2L_IOLH_IDX_1V8] = 2200, 4400, 9000, 10000,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6.1.y-cip 29/34] clk: renesas: r9a08g045: Add I3C clocks and resets
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (27 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 28/34] pinctrl: renesas: rzg2l: Add RZ/G3S support for selecting I3C power source Claudiu Beznea
@ 2026-11-17 11:49 ` Claudiu Beznea
  2026-11-23 21:16 ` [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Pavel Machek
  29 siblings, 0 replies; 35+ messages in thread
From: Claudiu Beznea @ 2026-11-17 11:49 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, pavel; +Cc: cip-dev

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit 148bda0cfeae913b1212c4c683e6d3f6ae1a5e69 upstream.

Extracted from the BSP driver and rebased.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250630192438.38311-2-wsa+renesas@sang-engineering.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[claudiu.beznea: fixed conflict b/w PCIe and I3C clocks and resets by
 keeping them all]
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/clk/renesas/r9a08g045-cpg.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/clk/renesas/r9a08g045-cpg.c b/drivers/clk/renesas/r9a08g045-cpg.c
index 937a044cd5d3..cb4b004e7bc7 100644
--- a/drivers/clk/renesas/r9a08g045-cpg.c
+++ b/drivers/clk/renesas/r9a08g045-cpg.c
@@ -182,6 +182,7 @@ static const struct cpg_core_clk r9a08g045_core_clks[] __initconst = {
 	DEF_G3S_DIV("P3", R9A08G045_CLK_P3, CLK_PLL3_DIV2_4, DIVPL3C, G3S_DIVPL3C_STS,
 		    dtable_1_32, 0, 0, 0, NULL),
 	DEF_FIXED("P3_DIV2", CLK_P3_DIV2, R9A08G045_CLK_P3, 1, 2),
+	DEF_FIXED("P5", R9A08G045_CLK_P5, CLK_PLL2_DIV2, 1, 4),
 	DEF_FIXED("ZT", R9A08G045_CLK_ZT, CLK_PLL3_DIV2_8, 1, 1),
 	DEF_FIXED("S0", R9A08G045_CLK_S0, CLK_SEL_PLL4, 1, 2),
 	DEF_FIXED("OSC", R9A08G045_OSCCLK, CLK_EXTAL, 1, 1),
@@ -295,6 +296,10 @@ static const struct rzg2l_mod_clk r9a08g045_mod_clks[] = {
 					MSTOP(BUS_PERI_COM, BIT(10))),
 	DEF_MOD("pci_clkl1pm",		R9A08G045_PCI_CLKL1PM, R9A08G045_CLK_ZT, 0x608, 1,
 					MSTOP(BUS_PERI_COM, BIT(10))),
+	DEF_MOD("i3c_pclk",             R9A08G045_I3C_PCLK, R9A08G045_CLK_TSU, 0x610, 0,
+					MSTOP(BUS_MCPU3, BIT(10))),
+	DEF_MOD("i3c_tclk",             R9A08G045_I3C_TCLK, R9A08G045_CLK_P5, 0x610, 1,
+					MSTOP(BUS_MCPU3, BIT(10))),
 	DEF_MOD("vbat_bclk",		R9A08G045_VBAT_BCLK, R9A08G045_OSCCLK, 0x614, 0,
 					MSTOP(BUS_MCPU3, GENMASK(8, 7))),
 };
@@ -342,6 +347,8 @@ static const struct rzg2l_reset r9a08g045_resets[] = {
 	DEF_RST(R9A08G045_PCI_RST_RSM_B, 0x908, 4),
 	DEF_RST(R9A08G045_PCI_RST_CFG_B, 0x908, 5),
 	DEF_RST(R9A08G045_PCI_RST_LOAD_B, 0x908, 6),
+	DEF_RST(R9A08G045_I3C_TRESETN, 0x910, 0),
+	DEF_RST(R9A08G045_I3C_PRESETN, 0x910, 1),
 	DEF_RST(R9A08G045_VBAT_BRESETN, 0x914, 0),
 };
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S
  2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
                   ` (28 preceding siblings ...)
  2026-11-17 11:49 ` [PATCH 6.1.y-cip 29/34] clk: renesas: r9a08g045: Add I3C clocks and resets Claudiu Beznea
@ 2026-11-23 21:16 ` Pavel Machek
  2026-11-24  5:13   ` nobuhiro.iwamatsu.x90
  2026-11-24 11:34   ` claudiu beznea
  29 siblings, 2 replies; 35+ messages in thread
From: Pavel Machek @ 2026-11-23 21:16 UTC (permalink / raw)
  To: Claudiu Beznea; +Cc: nobuhiro.iwamatsu.x90, pavel, cip-dev

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

Hi!

> Series backports the I3C support for the Renesas RZ/G3S.
> 
> Please provide your feedback.

I'd be happier if series were closer to 20 patches than 35 or
70... but I got through this, and besides few poorly formatted
comments, it looks okay to me.

I can apply this if it passes testing and if there are no other
comments.

Best regards,
							Pavel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S
  2026-11-23 21:16 ` [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Pavel Machek
@ 2026-11-24  5:13   ` nobuhiro.iwamatsu.x90
  2026-11-24 11:00     ` [cip-dev] " Pavel Machek
  2026-11-24 11:34   ` claudiu beznea
  1 sibling, 1 reply; 35+ messages in thread
From: nobuhiro.iwamatsu.x90 @ 2026-11-24  5:13 UTC (permalink / raw)
  To: pavel, claudiu.beznea; +Cc: cip-dev

Hi all,

> -----Original Message-----
> From: Pavel Machek <pavel@nabladev.com>
> Sent: Tuesday, November 24, 2026 6:17 AM
> To: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> Cc: iwamatsu nobuhiro(岩松 信洋 □DITC○CPT)
> <nobuhiro.iwamatsu.x90@mail.toshiba>; pavel@nabladev.com;
> cip-dev@lists.cip-project.org
> Subject: Re: [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas
> RZ/G3S
> 
> Hi!
> 
> > Series backports the I3C support for the Renesas RZ/G3S.
> >
> > Please provide your feedback.
> 
> I'd be happier if series were closer to 20 patches than 35 or 70... but I got
> through this, and besides few poorly formatted comments, it looks okay to me.
> 
> I can apply this if it passes testing and if there are no other comments.
> 

I reviewed this series, looks good to me.

Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>

Best regards,
  Nobuhiro


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [cip-dev] [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S
  2026-11-24  5:13   ` nobuhiro.iwamatsu.x90
@ 2026-11-24 11:00     ` Pavel Machek
  0 siblings, 0 replies; 35+ messages in thread
From: Pavel Machek @ 2026-11-24 11:00 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90; +Cc: pavel, claudiu.beznea, cip-dev

[-- Attachment #1: Type: text/plain, Size: 573 bytes --]

Hi!

> > > Series backports the I3C support for the Renesas RZ/G3S.
> > >
> > > Please provide your feedback.
> > 
> > I'd be happier if series were closer to 20 patches than 35 or 70... but I got
> > through this, and besides few poorly formatted comments, it looks okay to me.
> > 
> > I can apply this if it passes testing and if there are no other comments.
> > 
> 
> I reviewed this series, looks good to me.
> 
> Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>

Thank you, applied and pushed out.

Best regards,
									Pavel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S
  2026-11-23 21:16 ` [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Pavel Machek
  2026-11-24  5:13   ` nobuhiro.iwamatsu.x90
@ 2026-11-24 11:34   ` claudiu beznea
  2026-11-24 11:41     ` Pavel Machek
  1 sibling, 1 reply; 35+ messages in thread
From: claudiu beznea @ 2026-11-24 11:34 UTC (permalink / raw)
  To: Pavel Machek; +Cc: nobuhiro.iwamatsu.x90, cip-dev

Hi, Pavel,

On 11/23/26 23:16, Pavel Machek wrote:
> Hi!
> 
>> Series backports the I3C support for the Renesas RZ/G3S.
>>
>> Please provide your feedback.
> 
> I'd be happier if series were closer to 20 patches than 35 or
> 70... 

For future patch submission: would you prefer submitting individual series to 
enable a feature? E.g. for this series, instead of a single 34 patch series, 
would it have been easier for you if I had submitted it as 3 separate series, as 
follows:

- one series containing I3C patches (21 patches)
- one series containing pinctrl and clock patches (8 patches)
- one series containing device tree patches (5 patches)

?

Also, would you prefer to submit them at the same time or submit one series, 
wait for it to be integrated then go with the next series?

Thank you,
Claudiu

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S
  2026-11-24 11:34   ` claudiu beznea
@ 2026-11-24 11:41     ` Pavel Machek
  0 siblings, 0 replies; 35+ messages in thread
From: Pavel Machek @ 2026-11-24 11:41 UTC (permalink / raw)
  To: claudiu beznea; +Cc: Pavel Machek, nobuhiro.iwamatsu.x90, cip-dev

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

On Tue 2026-11-24 13:34:47, claudiu beznea wrote:
> Hi, Pavel,
> 
> On 11/23/26 23:16, Pavel Machek wrote:
> > Hi!
> > 
> > > Series backports the I3C support for the Renesas RZ/G3S.
> > > 
> > > Please provide your feedback.
> > 
> > I'd be happier if series were closer to 20 patches than 35 or
> > 70...
> 
> For future patch submission: would you prefer submitting individual series
> to enable a feature? E.g. for this series, instead of a single 34 patch
> series, would it have been easier for you if I had submitted it as 3
> separate series, as follows:
> 
> - one series containing I3C patches (21 patches)
> - one series containing pinctrl and clock patches (8 patches)
> - one series containing device tree patches (5 patches)
> 
> ?

For this one, one series with I3C patches and one series with pinctrl
+ clock + dts would be nice. Even better would be if the split was
something like

Series A+B for 6.12
Series A+B for 6.1
Series A+B+C for 5.10

> Also, would you prefer to submit them at the same time or submit one series,
> wait for it to be integrated then go with the next series?

You can do it at the same time, but expect delays.

Thanks and best regards,
									Pavel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2026-11-24 11:42 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 11:48 [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 01/34] i3c: master: Add i3c_master_do_daa_ext() for post-hibernation address recovery Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 02/34] i3c: master: renesas: Use __free(kfree) for xfer cleanup in renesas_i3c_send_ccc_cmd() Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 03/34] i3c: renesas: Check that the transfer is valid before accessing it Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 04/34] i3c: renesas: Restore STDBR and EXTBR registers on resume Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 05/34] i3c: renesas: Follow the reset deassert order used in probe Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 06/34] i3c: renesas: Reconfigure the DATBAS register on re-attach Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 07/34] i3c: renesas: Reset the controller on resume Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 08/34] i3c: renesas: Perform Dynamic Address Assignment " Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 09/34] i3c: renesas: Clean DATBAS register on detach Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 10/34] i3c: renesas: Fix out-of-bounds access for newdevs mask Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 11/34] i3c: renesas: Use reset_control_bulk_{assert, deassert}() Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 12/34] i3c: renesas: Return immediately if there is no transfer Claudiu Beznea
2026-11-17 11:48 ` [PATCH 6.1.y-cip 13/34] i3c: renesas: Follow a unified pattern for transfer and command initialization Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 14/34] i3c: renesas: Drop the explicit memset() call Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 15/34] i3c: renesas: Update HW registers after SW computations are done Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 16/34] i3c: renesas: Organize structures to avoid unnecessary padding Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 17/34] i3c: renesas: Use the "dev_name:irq_name" format for the interrupt name Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 18/34] i3c: renesas: Drop unnecessary tab Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 19/34] i3c: renesas: Add runtime PM support Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 20/34] i3c: renesas: Drop unused structure member 'resuming' Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 21/34] i3c: renesas: Don't register devices when ENTDAA times out Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 22/34] pinctrl: renesas: rzg2l: Fix type in .pin_config_group_get() callback Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 23/34] pinctrl: renesas: rzg2l: Keep member documentation aligned Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 24/34] pinctrl: renesas: rzg2l: Make QSPI register handling conditional Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 25/34] pinctrl: renesas: rzg2l: Generalize power source code Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 26/34] pinctrl: renesas: rzg2l: Drop defines present in struct rzg2l_hwcfg Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 27/34] pinctrl: renesas: rzg2l: Unify power source handling Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 28/34] pinctrl: renesas: rzg2l: Add RZ/G3S support for selecting I3C power source Claudiu Beznea
2026-11-17 11:49 ` [PATCH 6.1.y-cip 29/34] clk: renesas: r9a08g045: Add I3C clocks and resets Claudiu Beznea
2026-11-23 21:16 ` [PATCH 6.1.y-cip 00/34] i3c: Backport I3C support for Renesas RZ/G3S Pavel Machek
2026-11-24  5:13   ` nobuhiro.iwamatsu.x90
2026-11-24 11:00     ` [cip-dev] " Pavel Machek
2026-11-24 11:34   ` claudiu beznea
2026-11-24 11:41     ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox