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 29ACCC369A1 for ; Tue, 8 Apr 2025 22:21:15 +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=98nLlPYT+VTzspfa339eHkagfVUGyHyGGsVV5kY2nSQ=; b=021rpdpE5c0iGhm4cJnDNB6EAw KvgKriqo8fJUz6L8O9Jl6bWAp9Zi+txs1RNREbMF0PDR8O2nmawdGDc3kpcqBGLyuyA5BVx8QTPZc T7qXMXncswaIMwvt/pp3n4uby0wSNwXZYeCXqnYj0Tki8zLF+whpynGKhGnLXy2uTeMY4VV6k6bbU ke4MZHStJ7gpK5dYaUTRYi0ss9JgRMJP/uhbaG+BT9Znl8jAsUEf00ZpTSZ16vA9X3Swb/kJMpzvQ oUazsVPou9cTJlM9MS+8eUNa5HSjzE6wV6MPKoRlqNmAkLvFvTCTzTj3Ue//TEkz9w5PR0J623H/D DkWeF11Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u2HJX-00000005Yc1-25E2; Tue, 08 Apr 2025 22:21:03 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u2HCK-00000005XYh-1Axm for linux-arm-kernel@lists.infradead.org; Tue, 08 Apr 2025 22:13:38 +0000 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20250408221328epoutp015470c792cc870337c81f04a43c0076bb~0d45HkKk21592015920epoutp01p for ; Tue, 8 Apr 2025 22:13:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20250408221328epoutp015470c792cc870337c81f04a43c0076bb~0d45HkKk21592015920epoutp01p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1744150408; bh=98nLlPYT+VTzspfa339eHkagfVUGyHyGGsVV5kY2nSQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tq/1zFm5e6HXdip/B1Uqg5Q5mO9QC52Stzg95+Fw8Gs0Xgllmd6ZgUJMFEZjsghNC uIWWFPKj7aRS6iahiv/ln0fyFJqJCJAWnvvZenA04F/A9ZjfDB8vLby5f9e979UaBA /tYyjzroN2YZ+C4SJWGUg9Tzy/bbZyiCsaP68mmw= Received: from epsnrtp03.localdomain (unknown [182.195.42.155]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPS id 20250408221327epcas2p4d4199845dd58741a72b446173060bd0a~0d44YY62L0708307083epcas2p40; Tue, 8 Apr 2025 22:13:27 +0000 (GMT) Received: from epsmgec2p1-new.samsung.com (unknown [182.195.36.97]) by epsnrtp03.localdomain (Postfix) with ESMTP id 4ZXL1z1l5lz3hhT3; Tue, 8 Apr 2025 22:13:27 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmgec2p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id 0D.FD.37303.78F95F76; Wed, 9 Apr 2025 07:13:27 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20250408221326epcas2p24b455e5a9f65dff52807a3a0010eff9a~0d43GJ9xt1382213822epcas2p2M; Tue, 8 Apr 2025 22:13:26 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20250408221326epsmtrp15bda4a714b1657db260153597e377797~0d43Fb2SQ1774717747epsmtrp16; Tue, 8 Apr 2025 22:13:26 +0000 (GMT) X-AuditID: b6c32a4d-541ff700000091b7-34-67f59f87d99c Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 51.41.19478.68F95F76; Wed, 9 Apr 2025 07:13:26 +0900 (KST) Received: from tiffany (unknown [10.229.95.142]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250408221326epsmtip184585f5a670a2dd4bd418068c2ee1230~0d4229ybz1185811858epsmtip1E; Tue, 8 Apr 2025 22:13:26 +0000 (GMT) Date: Wed, 9 Apr 2025 07:11:47 +0900 From: Donghyeok Choe To: Sudeep Holla Cc: Youngmin Nam , Marc Zyngier , Thomas Gleixner , Saravana Kannan , Sudeep Holla , 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: <20250408221147.GA2187207@tiffany> MIME-Version: 1.0 In-Reply-To: <20250408-transparent-daft-dog-ec2a74@sudeepholla> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHJsWRmVeSWpSXmKPExsWy7bCmuW77/K/pBrv6OC2u7Z3IbtG0/xKz xdXd75gtdmwXsdj0+BqrxeVdc9gsds45yWqx7HgXq0XXob9sFstP7WCx2LxpKrPF8bXhFh1H vjFbLD7wid2Bz2Pb7m2sHmvmrWH0WLCp1GPTqk42jzvX9rB5v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qo8vWZ9+G/IO5ZzT7SUWIozEg21 mIuKEwFvcbiBKwMAAA== X-CMS-MailID: 20250408221326epcas2p24b455e5a9f65dff52807a3a0010eff9a X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----JAxyHCgdtJ96A8.Ok.gYWmZQmsTOHaTnMoXq.aDuWNAvXzgf=_baefa_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250408221326epcas2p24b455e5a9f65dff52807a3a0010eff9a 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> <20250407225146.GA2858456@tiffany> <20250408-transparent-daft-dog-ec2a74@sudeepholla> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250408_151336_938209_C05FE158 X-CRM114-Status: GOOD ( 42.77 ) 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 ------JAxyHCgdtJ96A8.Ok.gYWmZQmsTOHaTnMoXq.aDuWNAvXzgf=_baefa_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Tue, Apr 08, 2025 at 11:46:40AM +0100, Sudeep Holla wrote: > On Tue, Apr 08, 2025 at 07:51:46AM +0900, Donghyeok Choe wrote: > > 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. > > > > OK, I understood. In short, you create problems by hacking up or misusing > your trace handlers in ways it shouldn't be, and now you are t/crying to > solve those problems. > > > > 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 can understand that part, but my hacking up things the way you have > shown above, though you may think you have achieved some feature very > smartly, you have just dug up the hole with issues you are facing now. > > The only reason IIUC s2idle info is used is to identify when the RPM > is disabled. You are using that info to manage GIC power state. > > The CPU deepest idle states entered in the normal and s2idle must be > same. If you want to still achieve extra power save with GIC powerdown > make it completely transparent to the OS. First of all, thank you. You're clearly pointing out the painful truth. I’m well aware that this approach isn’t ideal. Following your advice, I’ll do my best to keep things as clear and transparent as possible. My goal was to explain the situation we’re facing, and I feel like I’ve managed to do that — so I’m glad about that. Best regards, Donghyeok Choe ------JAxyHCgdtJ96A8.Ok.gYWmZQmsTOHaTnMoXq.aDuWNAvXzgf=_baefa_ Content-Type: text/plain; charset="utf-8" ------JAxyHCgdtJ96A8.Ok.gYWmZQmsTOHaTnMoXq.aDuWNAvXzgf=_baefa_--