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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29DDCC282DD for ; Thu, 9 Jan 2020 16:47:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E7D25206ED for ; Thu, 9 Jan 2020 16:47:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tw3eu900" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7D25206ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K3e8t7xbLXYvLtzakaYQE+kNIjRbrZ5cuQQjg31fpzE=; b=tw3eu900WyoIl+ DUMKsuLlbzrGH4Vu7Rl1ApRnmnZShsVRlSfYEI2Bf416cIpW5F+Y/vyS95UPMD/4Dam0xKjShiGZB NGBGWYt7fX9GBzYU7+FWl1AmU5j7AQdjcACWhtr+ysr8JfX7hzpS6SayAOx2hgktD4rEoQgZ44mtZ qFD7JiQn+s7r0HqeHqE6Xgu6yntQkuAd69YAItBQ33sS1yVOidpK3VtLbMvqT+qNFg9/YAGni36Uv n8shy/d1wX6Pz5pQ/Ghf/yJUH6qcAkPVIQx0Aa0xt1uI7SLriY6f0yLUcv6kyn/eGdycEqxEfrVAn yWWUXdeY+RAq/ZQmGedA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipaxj-0005zV-47; Thu, 09 Jan 2020 16:47:11 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipaxf-0005ry-CP for linux-arm-kernel@lists.infradead.org; Thu, 09 Jan 2020 16:47:09 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5215C328; Thu, 9 Jan 2020 08:47:06 -0800 (PST) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0B0513F703; Thu, 9 Jan 2020 08:47:04 -0800 (PST) Date: Thu, 9 Jan 2020 16:46:55 +0000 From: Lorenzo Pieralisi To: Will Deacon Subject: Re: [Question] About handling PMU context loss in the deepest idle state where the core is powered down Message-ID: <20200109164655.GA29943@e121166-lin.cambridge.arm.com> References: <20200109150318.GF12236@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200109150318.GF12236@willie-the-truck> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200109_084707_462708_3F7F5958 X-CRM114-Status: GOOD ( 15.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, wangzhe59@huawei.com, Catalin Marinas , huawei.libin@huawei.com, guohanjun@huawei.com, Xiongfeng Wang , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 09, 2020 at 03:03:19PM +0000, Will Deacon wrote: > [+Lorenzo] > > On Thu, Jan 09, 2020 at 10:43:40AM +0800, Xiongfeng Wang wrote: > > Sorry to bother you. It's just that we have come across some problems > > about PMU recently. > > No bother, and thanks for including the mailing list. > > > We are working on deep power state on CPU cores. In the deepest idle > > state, the core will be powered down. In our implementation, the PMU > > and the core are in the same power domain, so the PMU will also be > > powered down. But I didn't find where we saved the PMU context in > > kernel before entering the deepest idle state. > > > > Before we enter the system sleep state, we update the kernel PMU > > counter and stop the PMU in 'cpu_pm_pmu_notify()'. But we didn't do > > that before we enter idle state. ACPI or DT firmware ? I suspect that's ACPI, with LPI idle state flags set to 0x0 (3.1.3 - save and restore flags): http://infocenter.arm.com/help/topic/com.arm.doc.den0048a/DEN0048A_ARM_FFH_Specification.pdf If that's the case a firmware update is needed (ie currently the kernel expects the PMU state to be retained). arch/arm64/kernel/cpuidle.c ARM64_LPI_IS_RETENTION_STATE() In DT in the PSCI CPUidle driver we run the notifiers irrespective of the idle state depth so I don't think this behaviour can happen in a DT bootstrapped system. I am just guessing - please let me know if my assumption is correct. > > I only find some system registers saving in 'psci_cpu_suspend_enter()->cpu_susend()->cpu_do_suspend()' > > I'm not sure what you mean by "system sleep state" I think they mean suspend-to-RAM - in suspend-to-RAM the notifiers are run through syscore operations which are decoupled from CPUidle. Regardless, CPUidle should call the notifiers if instructed by firmware correctly. Thanks, Lorenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel