linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Donghyeok Choe <d7271.choe@samsung.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Youngmin Nam <youngmin.nam@samsung.com>,
	Marc Zyngier <maz@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Saravana Kannan <saravanak@google.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-team@android.com,
	hajun.sung@samsung.com, d7271.choe@samsung.com,
	joonki.min@samsung.com, ne.yoo@samsung.com
Subject: Re: [GICv3 ITS]S2IDLE framework does not invoke syscore_ops in GICv3 ITS driver
Date: Fri, 4 Apr 2025 13:13:23 +0900	[thread overview]
Message-ID: <20250404041323.GA685160@tiffany> (raw)
In-Reply-To: <20250403-rare-wasp-of-management-9bce59@sudeepholla>

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

On Thu, Apr 03, 2025 at 10:18:54AM +0100, Sudeep Holla wrote:
> /me more confused.
> 
> Are you saying you have some cpuidle platform specific logic inside
> trace_android_vh_cpuidle_psci_enter(). I would assume it was just to
> trace the entry into the state and nothing more.

Hi, I am a Samsung developer working with Youngmin Nam.

Yes, you are correct. The platform-specific logic runs, and only
the booting core performs the GIC ITS save/restore. I understand that
using trace in this way might have surprised you.
However, this kind of trace usage is actually quite common
within the Android kernel.

The Android kernel aims to ensure that all SoC vendors use
the same kernel code, aiming for the benefits of the GKI project.
Since vendors often want to control kernel behavior, they utilize
traces like this to achieve that flexibility.

> In fact, it was recently added upstream as well.
> Commit 7b7644831e72 ("cpuidle: psci: Add trace for PSCI domain idle")

Then it seems that this will be used instead of the Android kernel specific
vendor hook(trace_android_vh_cpuidle_psci_enter).
We can eliminate the diff between the mainline code and the ACK.

> Further you didn't explicitly answer my question. IIUC are you calling
> GIC ITS suspend function unconditionally if its boot cpu ? Or is it
> done only for s2idle ? If done only for s2idle, how does it work for
> normal cpuidle entry to deepest idle state that matches the one entered
> during s2idle.

In the s2idle situation, only the booting core performs
the GIC ITS suspend/resume. The difference from normal cpuidle
is that in the case of s2idle, the entire system enters suspend
at a level equivalent to kernel suspend.

Through that trace(trace_android_vh_cpuidle_psci_enter),
we don't directly call syscore suspend, but rather mimic
the actions that syscore suspend would perform.

You might be concerned about the following:
While kernel suspend hotplugs out the remaining cores except for
the booting core and performs syscore suspend, in the s2idle scenario,
cores enter cpuidle in parallel when going into suspend.
I understand that you may worry about the synchronization issues
that could arise when cores enter cpuidle in parallel during
the s2idle situation.
There were many exceptional cases, and we resolved them all together
with my colleagues. We paid the price for not using the mainline kernel
code as intended.

If you have any further questions, feel free to reach out.

Best regards,  
Donghyeok Choe

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2025-04-04  4:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250326030527epcas2p33aa30e62cc8a00c9e151c35bee71dac5@epcas2p3.samsung.com>
     [not found] ` <Z+Nv8U/4P3taDpUq@perf>
2025-03-26  8:59   ` [GICv3 ITS]S2IDLE framework does not invoke syscore_ops in GICv3 ITS driver Marc Zyngier
2025-03-27  3:22     ` Youngmin Nam
2025-03-27  8:25       ` Marc Zyngier
2025-03-28  2:10         ` Youngmin Nam
2025-04-01 12:45         ` Ulf Hansson
2025-04-01 13:11           ` Marc Zyngier
2025-04-02 10:57             ` Ulf Hansson
2025-04-03  7:16               ` Marc Zyngier
2025-04-02 11:56       ` Sudeep Holla
2025-04-03  1:30         ` Youngmin Nam
2025-04-03  9:18           ` Sudeep Holla
2025-04-04  4:13             ` Donghyeok Choe [this message]
2025-04-07  9:17               ` Sudeep Holla
2025-04-07 22:51                 ` Donghyeok Choe
2025-04-08  6:51                   ` Marc Zyngier
2025-04-08 22:28                     ` Donghyeok Choe
2025-04-08 10:46                   ` Sudeep Holla
2025-04-08 22:11                     ` Donghyeok Choe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250404041323.GA685160@tiffany \
    --to=d7271.choe@samsung.com \
    --cc=hajun.sung@samsung.com \
    --cc=joonki.min@samsung.com \
    --cc=kernel-team@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=ne.yoo@samsung.com \
    --cc=saravanak@google.com \
    --cc=sudeep.holla@arm.com \
    --cc=tglx@linutronix.de \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=youngmin.nam@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).