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 0CE9A3E5EC4; Tue, 2 Jun 2026 13:28:53 +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=1780406935; cv=none; b=ZAmuhyY1Pz4uDjEWsPMpNGw2w1zAMbgvjFuraVNj9sbX+8Lb2ulS6/EUoT3zdLTehyszRYRDHlPKbtVo92a9qV4ufiMgPYsVAdEpGyW/xRIYFmI1rcTgmleqw6vh88gRagc4aUEz579dAnv5nlCrQNC0j563Ty62D1O0XokXT3A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780406935; c=relaxed/simple; bh=qI6kwWXjoWk71ZyBbwUIICzDd0nHr3yyBFsgbAjrEXI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OUPNUueVibZPVCbwUv5b44h81254uPc6cRmh+be/IXm5z/vI72r3B2rOtEZpPP0k/hIUlEZMA8r0sXGBXp0kkL9LJLbHxyxgtHBNVsEGPGh8ctQtGu9NUYLe4ddUnS0f33MQKbJe2YjXLRygqnzPw7FwWiFf9jkvrti9/dUK/zw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NPsV2gbg; 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="NPsV2gbg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F9451F00898; Tue, 2 Jun 2026 13:28:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780406933; bh=0D0dLV/fBm0s6q+TqOcMlytNbQnf/vCu6r9Q0s5p2/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NPsV2gbgz0vamvhok1+NPNiys67x2d6zVnVyZOK77M8QHinio04gYeWBB/ataicie 1z3BAo0gMLY8hDqSrjB65ceFTD704xjJnq84yeZHORRNnvVq7cKzhwALjH/eGuOPqG 4jDnUQaST3IWH3axHMc+WbjaLijfdfsl2HuWkANmybFmSrQcBF5psF7p8EI0ZpEtU2 rlD8sMvaqsKyGnDtsZAWyMHLQfjsrjLqpdGnOa4OlQHDy6pTfj1xktBETlvEPhLhFt 9arX9E1ZTc0YLdJ3iQSpaQ/9NEEHac77H4htzoIk4T90E4pc0j9ADz6e2s2Hbq+XL4 kd2iVG1JE3SCg== 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, Claudiu Beznea , stable@vger.kernel.org Subject: [PATCH v2 05/17] i3c: renesas: Reset the controller on resume Date: Tue, 2 Jun 2026 16:28:12 +0300 Message-ID: <20260602132824.3541151-6-claudiu.beznea@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260602132824.3541151-1-claudiu.beznea@kernel.org> References: <20260602132824.3541151-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 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