From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 3B67434573C for ; Thu, 18 Dec 2025 10:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766053191; cv=none; b=uwkKqNLoSLsa3yHXLipi4Sd4U1bDjG9HsY9qRtsM+uVSRSVY+dcAxyDnvO7QmzzFZkATn5Ij052upHE082KZrJgQpikadpAOrFYUobu+6tK+yVwunUbFcLGdZVRwS8OiG14Ja01vWFmQjZcVuajQwayZ87Fg5N7d+rfcNjNJ9Rs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766053191; c=relaxed/simple; bh=ozVGGm2xyBhXlggrMLQXK1LZb6xoIlU1yLKbosf12Kw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bzReT5JrZHxNJ387gpAm2N3pjpQQPkXlmxvXF6JSTVKsHEcRvw3xmEkjF5H+tFZHZNIYRDyAi7UKD7U2aRjRR6kcKJAdV+XmujG8DisHd7gr/8v9rsz1tKAobE/3XJHkdsyq3Ik/ZHvvI5ua4n5zmVlF7v7LkSLqk+4+x60Qxng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=dzXSoQqt; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="dzXSoQqt" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id DF348C1A5AE; Thu, 18 Dec 2025 10:19:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 76546606B6; Thu, 18 Dec 2025 10:19:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9BBCC102F0AE2; Thu, 18 Dec 2025 11:19:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1766053181; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=aWdMku9LK5PFx1F1L2Z19osi5GnZTsR0+SmWdNSoHeY=; b=dzXSoQqtVgMzu4RQ1UInBdB6ThGYAAG8CPz6Ms4jJHpK3wUVoG4UUr96ZEeGLEtMqB/6ME 7ccMp4X7w66U8kgoFUnwjK948/P+GhwE43xPtPzCEm5j2SiDSJlKrg+e5L+KXn7g+dzVXu h23A9OjSGfRHl743SLDMt2qZIxSz7CmbzLc1ta4l5T6KYC5FNmvHCSjDeiDlmaZZSMgFlR IpK/htyklTg0mYnPD6b8GZI+tb++AMlfgG2nlBK8hGspvMQOMS02Af2cIIwxG2KHR3fU8F zBgSa4yrQhN4+zlpILc++fxww/xj/+5wf3rwXEYtPc7EKwa+uJA5+y+yltombg== Message-ID: Date: Thu, 18 Dec 2025 11:19:39 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/4] firmware: ti_sci: restore clock context during resume in BOARDCFG_MANAGED mode To: Dhruva Gole Cc: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Michael Turquette , Stephen Boyd , Gregory CLEMENT , richard.genoud@bootlin.com, Udit Kumar , Prasanth Mantena , Abhash Kumar , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org References: <20251205-ti-sci-jacinto-s2r-restore-irq-v3-0-d06963974ad4@bootlin.com> <20251205-ti-sci-jacinto-s2r-restore-irq-v3-4-d06963974ad4@bootlin.com> <20251217060727.idneboxj7kwslie2@lcpd911> Content-Language: en-US From: Thomas Richard In-Reply-To: <20251217060727.idneboxj7kwslie2@lcpd911> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 On 12/17/25 7:07 AM, Dhruva Gole wrote: > On Dec 05, 2025 at 15:28:26 +0100, Thomas Richard (TI.com) wrote: >> In BOARDCFG_MANAGED mode, the firmware cannot restore the clock rates and >> the clock parents. This responsibility is therefore delegated to the ti_sci >> driver, which uses clk_restore_context() to trigger the context_restore() >> operation for all registered clocks, including those managed by the sci-clk >> driver. The sci-clk driver implements the context_restore() operation to >> ensure rates and clock parents are correctly restored. >> >> Signed-off-by: Thomas Richard (TI.com) >> --- >> drivers/firmware/ti_sci.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c >> index 8d94745376e2a..6ef687e481c49 100644 >> --- a/drivers/firmware/ti_sci.c >> +++ b/drivers/firmware/ti_sci.c >> @@ -9,6 +9,7 @@ >> #define pr_fmt(fmt) "%s: " fmt, __func__ >> >> #include >> +#include >> #include >> #include >> #include >> @@ -3980,6 +3981,8 @@ static int ti_sci_resume_noirq(struct device *dev) >> if (ret) >> return ret; >> } >> + >> + clk_restore_context(); > > Here as well, make it conditional to only BOARDCFG_MANAGED. Other > platforms/ firmwares have lived without this for a while now, and it's > evident that we don't always need this. It is already conditionally done to only BOARDCFG_MANAGED. > > Thinking more about this, I think we're over using this BOARDCFG_MANAGED > mode a bit much. We should really just come up with new FW caps for > this, one for clk_restore , other for the previous IRQ restore patch. > > That's the only way I can see this scaling. In future if we ever need > more devices that may actually be BOARDCFG_MANAGED, but don't need the > IRQ or clock restoration then the current approach won't work. > > MODE should only be passed in the prepare_sleep, where it makes sense. > Using it for anything else just does not feel clean to me. Fair point. Restoring clocks and IRQs is more related to the fact that DM-Firmware on Jacinto platforms does not have suspend-resume support than the BOARDCFG_MANAGED mode. I guess we could imagine in the future having suspend-resume support in Jacinto DM-Firmware, so no need to restore clocks and IRQs anymore, but the mode remains BOARDCFG_MANAGED. Best Regards, Thomas