Re: [PATCH 13/17] i3c: renesas: Update HW registers after SW computations are done
Frank Li <[email protected]>
| Newsgroups | org.infradead.lists.linux-i3c,org.kernel.vger.linux-kernel,org.kernel.vger.linux-renesas-soc |
|---|---|
| Message-ID | <ahCzBTwpdsbkLkLm@lizhi-Precision-Tower-5810> |
On Fri, May 22, 2026 at 01:18:11PM +0300, Claudiu Beznea wrote: > From: Claudiu Beznea <[email protected]> > > 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. > > Signed-off-by: Claudiu Beznea <[email protected]> > --- Reviewed-by: Frank Li <[email protected]> > 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 865e67ac0fd2..631c9c5d8038 100644 > --- a/drivers/i3c/master/renesas-i3c.c > +++ b/drivers/i3c/master/renesas-i3c.c > @@ -550,10 +550,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); > > @@ -604,27 +600,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 > -- linux-i3c mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-i3c