From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64909C36010 for ; Mon, 7 Apr 2025 22:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:References:Content-Type: In-Reply-To:MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iUSjEPZ83GdfEm51nmNZeuHGyd8PgfmmIt1lj/23V8k=; b=2R9Tlh//6fm/PdSdWO1EpG38f3 ornZTiWJFNrVIOgNy/IFh79gs94VI9fsXnQnry8pXOhkZEKCCK0rm9O27rqTBAflG8tFfq/xgsJTG Tk+VsQuxOsYqc9LPUm6yVMWzm3mgZrK1DIJVvGLnp7CCLVHodG73PzXZpCohNS/ENkAQu+pTWtwQm +p9sCB1gxUY1Yh+mKUB4o9+EvQdwpiT5edlarRqABgkEjG00+OBZi7b7kLp3b80/JH9w0B1gZTmZJ uTDtmnl8M7L0JdlLpyHNAFyoIpWJxZfCIX065dzPCyGRpmUydibNSHxt89M2wKfgV5FNvdGVxls8X ZqQs0whg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1u1vNQ-00000002EHQ-3TSo; Mon, 07 Apr 2025 22:55:36 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u1vLR-00000002DtD-1Mlt for linux-arm-kernel@lists.infradead.org; Mon, 07 Apr 2025 22:53:35 +0000 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20250407225325epoutp020de2bde784a80e30e25d035b9010c456~0KyfcvHJ31301713017epoutp02M for ; Mon, 7 Apr 2025 22:53:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20250407225325epoutp020de2bde784a80e30e25d035b9010c456~0KyfcvHJ31301713017epoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1744066405; bh=iUSjEPZ83GdfEm51nmNZeuHGyd8PgfmmIt1lj/23V8k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fZjYZcDi4C75n8WiTA3pwA0tq6UrkRbx3sv0qs+OQMwiFLmcaSDjhWB+ghP1wBim6 /TTyAso12NMsRi/t7s/gMrYmbbwpRxuwpH4u2GMCp0jsBw43aqbMOEhXE54NqEeYr+ BqGDPJCnQ8Q9JsUXEdnkuXSYuKey5whNLFtnv5wU= Received: from epsnrtp04.localdomain (unknown [182.195.42.156]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPS id 20250407225325epcas2p1356ee1822a883e2f657a95fa92df6414~0Kye8OZVT0399003990epcas2p1J; Mon, 7 Apr 2025 22:53:25 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.90]) by epsnrtp04.localdomain (Postfix) with ESMTP id 4ZWkyX5d04z6B9m9; Mon, 7 Apr 2025 22:53:24 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id AF.F3.09856.46754F76; Tue, 8 Apr 2025 07:53:24 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20250407225324epcas2p4c290a01ea294458318238f0b1123390e~0Kyd9t15L2709427094epcas2p4x; Mon, 7 Apr 2025 22:53:24 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20250407225324epsmtrp21cb83ed4bb9ed850969a53e9fb620756~0Kyd86zT42005220052epsmtrp2r; Mon, 7 Apr 2025 22:53:24 +0000 (GMT) X-AuditID: b6c32a47-c1fdf70000002680-b7-67f45764cf6d Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 5B.CA.08805.46754F76; Tue, 8 Apr 2025 07:53:24 +0900 (KST) Received: from tiffany (unknown [10.229.95.142]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250407225324epsmtip1cd7d8259c362f1dba869298b2a4504cf~0KydsYAG83006630066epsmtip1a; Mon, 7 Apr 2025 22:53:24 +0000 (GMT) Date: Tue, 8 Apr 2025 07:51:46 +0900 From: Donghyeok Choe To: Sudeep Holla Cc: Youngmin Nam , Marc Zyngier , Sudeep Holla , Thomas Gleixner , Saravana Kannan , Ulf Hansson , Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, hajun.sung@samsung.com, joonki.min@samsung.com, ne.yoo@samsung.com, Donghyeok Choe Subject: Re: [GICv3 ITS]S2IDLE framework does not invoke syscore_ops in GICv3 ITS driver Message-ID: <20250407225146.GA2858456@tiffany> MIME-Version: 1.0 In-Reply-To: <20250407-amiable-perfect-hummingbird-06ad83@sudeepholla> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIJsWRmVeSWpSXmKPExsWy7bCmqW5K+Jd0g5UbtC2u7Z3IbtG0/xKz xdXd75gtdmwXsdj0+BqrxeVdc9gsds45yWqx7HgXq0XXob9sFstP7WCx2LxpKrPF8bXhFh1H vjFbLD7wid2Bz2Pb7m2sHmvmrWH0WLCp1GPTqk42j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Ef+9uCJiToTXjHXlL1Y9ZMn/dKLMUZiYZazEXF iQC32YKQGAMAAA== X-CMS-MailID: 20250407225324epcas2p4c290a01ea294458318238f0b1123390e X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----BWvmtLGreXPtZv31XE49129YoyRr4_KGUd.k-ILdCyGA2LCZ=_aec8b_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250326030527epcas2p33aa30e62cc8a00c9e151c35bee71dac5 References: <8634f0mall.wl-maz@kernel.org> <20250402-messy-wild-squid-7b4da9@sudeepholla> <20250403-rare-wasp-of-management-9bce59@sudeepholla> <20250404041323.GA685160@tiffany> <20250407-amiable-perfect-hummingbird-06ad83@sudeepholla> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250407_155334_001987_9A3B6C7F X-CRM114-Status: GOOD ( 27.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ------BWvmtLGreXPtZv31XE49129YoyRr4_KGUd.k-ILdCyGA2LCZ=_aec8b_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Mon, Apr 07, 2025 at 10:17:43AM +0100, Sudeep Holla wrote: > On Fri, Apr 04, 2025 at 01:13:23PM +0900, Donghyeok Choe wrote: > > 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. > > > > If you have any further questions, feel free to reach out. > > > > I was trying to understand the difference in behaviour between normal > cpuidle entering the same deepest state that is entered in s2idle state. > I assume GIC doesn't loose power and no need for GIC ITS save/restore > in normal cpuidle path ? > > If so, what triggers the GIC suspend in s2idle path if syscore_ops is > not getting called ? > > Why would the firmware pull the plug on GIC ? The GIC loses power. It is powered down to the same level as during suspend. Therefore, it became necessary to perform GIC ITS save/restore through a method other than the GIC ITS syscore path. To help with better understanding, I will write a pseudo code. void mimic_syscore_suspend() { /* Perform the actions required to power off all cores. */ ... its_save_disable(); } void android_vh_cpuidle_psci_enter_handler(... bool s2idle) { if (!s2idle) return; set_cpu_powerdown_mark(); if (cpu != booting core) return; /* only booting core here */ mimic_syscore_suspend() } void mimic_syscore_resume() { ... its_restore_enable(); } void android_vh_cpuidle_psci_exit_handler(... bool s2idle) { if (!s2idle) return; if (cpu == booting core) mimic_syscore_resume(); set_cpu_poweron_mark(); } All cores will be marked as powered down when the HVC/SMC call for CPU suspend is invoked. When all cores call the suspend function, the firmware will recognize the powerdown mark and transition the system into suspend. At this point, the entire GIC will also be powered off. In a cpuidle situation that is not s2idle, the cores do not mark CPU powerdown, so the GIC ITS save/restore operation is neither performed nor necessary. > Do you use any suspend/resume logic in drivers/irqchip/irq-gic-pm.c ? No, there are parts of the GIC that require secure access, so the GIC save/restore is performed by the firmware. Since the GIC-ITS is entirely controlled as a non-secure IP, I think it is more efficient to perform save/restore in the kernel. > I am still missing something in this flow. Feel free to ask questions until everything is clear! As I look for answers to your questions, I appreciate your insights and find it helpful to review the s2idle sequence we are using. Best regards, Donghyeok Choe ------BWvmtLGreXPtZv31XE49129YoyRr4_KGUd.k-ILdCyGA2LCZ=_aec8b_ Content-Type: text/plain; charset="utf-8" ------BWvmtLGreXPtZv31XE49129YoyRr4_KGUd.k-ILdCyGA2LCZ=_aec8b_--