From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B58938A73C; Mon, 8 Jun 2026 20:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780949769; cv=none; b=Q7o8UKKQ+LgtjRKGtQYL6mDjkCVkNhcx3/eedZhcENpC9Hn2oGOeKKS2JZQGWK/XuBy7nMP12lEqRCEHXGSAcSIKh3mLHGtthAmnUKPFNMwMgBwuBSMKzSsK+VHK0YUpoUM95a8Hqb1EVKoL8lo6yWz/A8HCInZcBB/nbPWpVU8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780949769; c=relaxed/simple; bh=SW5GTXpHDcjN7ZqY9y4i2mW7ZbSnOTnHpbbrQGSo1Fc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fUcS/+kjwEQguuIIs34WXUxXbuJdh/9CMQrSWQJLsOTUrdsJc5lPNzx72bmHI3LOXeU8xy2bJskEt2qDHM4QeoonM8gmRnlS3ES6Ne5K+uxVGzG4teboN+EZy7rqvRkkjqY8Umxxyuc3KvR8TpiMLAVvGjOJ1u4oi49XSM+fmxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A6yIUCRi; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A6yIUCRi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C75C1F00898; Mon, 8 Jun 2026 20:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780949767; bh=XkZcK2CJUgIVgyR/EGaoOYASXw4bwoLswDyjXXi++9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=A6yIUCRidXhs3a54OFMFZjtJ0NPkG/Zol8hDjqls5tGf9bSJB+Xd1H2HZNwUbTV+o dtKBvvpHIiUU9969Tzgog5OHvm5y0gdPtkSLRkvHypGQ4Bxej3mIow9DNOfU7omeVq 07EkJhBoShkVnfLh8TML0oSq/ZJX7YJKQsLZLhoa/3LGN0hV/WVwl9mbgNZNri21pa 2XmsvpGPKaQxVVZFnweIfN8ZNFebquWVZNu6KP552h75dpNzrMmIOzHdh87xw0G/CU SrDcwI9PLghtpqQCS3T46jIE7mPDov9JG5PiQzzxYjlFg7a1iCAHDV+9skJhjeaajO I0IJRAxxcFTzQ== From: Claudiu Beznea To: wsa+renesas@sang-engineering.com, tommaso.merciai.xr@bp.renesas.com, alexandre.belloni@bootlin.com, Frank.Li@nxp.com, p.zabel@pengutronix.de Cc: claudiu.beznea@kernel.org, claudiu.beznea@tuxon.dev, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Claudiu Beznea , stable@vger.kernel.org Subject: [PATCH v3 05/17] i3c: renesas: Reset the controller on resume Date: Mon, 8 Jun 2026 23:15:31 +0300 Message-ID: <20260608201543.804902-6-claudiu.beznea@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260608201543.804902-1-claudiu.beznea@kernel.org> References: <20260608201543.804902-1-claudiu.beznea@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Claudiu Beznea 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 Signed-off-by: Claudiu Beznea --- Changes in v3: - collected tags Changes in v2: - replaced the read_poll_timeout() in renesas_i3c_reset() with read_poll_timeout_atomic() as the renesas_i3c_reset() is called in noirq phase of the suspend/resume; updated the patch description to reflect that - collected Frank's tag. Frank, please let me know if this should be dropped. Thanks! 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 76a4831098c9..7ef317b2ba39 100644 --- a/drivers/i3c/master/renesas-i3c.c +++ b/drivers/i3c/master/renesas-i3c.c @@ -480,8 +480,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) @@ -1483,6 +1483,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); @@ -1502,6 +1506,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