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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 CF9B7C48BE5 for ; Tue, 15 Jun 2021 14:59:09 +0000 (UTC) Received: from bombadil.infradead.org (unknown [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 8AAB661581 for ; Tue, 15 Jun 2021 14:59:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AAB661581 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V5xaAkHBK1si7Cs3tyZ50ZwX9wcRVbGvpAkm/Do01gA=; b=DwQSvIuQxlVFM1 a9ECAX3bo9Zz9qytnt6WEmxMUd7Uq2tpVlX/o9ECFpRH6DWLgHQjb/ZSfTL6kffAPDtze3E/gxG3y MBj8AItQ/SYsKgdy1MCIM0GZxZ3aYAw7hXVgham3wFlOCH+rRqW1BHGO9kN3NasLhoVv0jvd/oP6U kqc6jxDr7EIEVm/Mv578uCAOtbPMTNdXElHzrNZimGoKYv27FJE4a75a5MBttTy0pJ8TCJr2EN5la SDW2z5ZJwEU8Ms12z+kVwyxm4hPWHJHpU9YHubS0+UnOvmGprWwwOeRfK/sBYCSim6IYnxb08Ybem O6v65NQ1ldpXbNLQUvyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltAPN-000iVM-Cq; Tue, 15 Jun 2021 14:51:21 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt9Fz-000ByJ-47 for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Jun 2021 13:37:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=AFIXjrKJgYZ1N7BwoSQuPqeuDBt/eKpzk4rF4ocr+0U=; b=T6ik0GM392gharHscvbhOna6Pr sAIKKynFpiAfX7BZDzotwjFiytlY5qQmajWhhNImttJUHLpm4MuapE0U6c7R4BruqFq1txuk9w+R9 yoVDxfc++iKLCzUtNbFL09ADLOqulKnKQIPQ6kBE+wlfZECv3S3saVFmFfdRLQoo4oZa5donaEdUf +F9MbJbjfJeIAx4NCKOe6wmpUBXJE84kzHjSvVDs7Z+yUkZFMe1Hpy8bLfQc3SjFvfPug0kXI+88m Gx5BSGgTUrQYKIPhDv3uWkpw3Og2K2gzlOq0qyzjFuja7aK5CwTe0EvcGJK6E5OR/vxqL5GmOlaL6 AUJ6zDpQ==; Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt6zo-007lUS-6L for linux-arm-kernel@lists.infradead.org; Tue, 15 Jun 2021 11:12:48 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C3ABB6145F; Tue, 15 Jun 2021 11:12:45 +0000 (UTC) Received: from [185.219.108.64] (helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lt6zs-007fRJ-73; Tue, 15 Jun 2021 12:12:44 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Cc: Lorenzo Pieralisi , Will Deacon , Catalin Marinas , Mark Rutland , Valentin Schneider , Alexandru Elisei , Sudeep Holla , Russell King , kernel-team@android.com Subject: [PATCH v2 3/4] PSCI: Use cpuidle context helpers in psci_cpu_suspend_enter() Date: Tue, 15 Jun 2021 12:12:26 +0100 Message-Id: <20210615111227.2454465-4-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210615111227.2454465-1-maz@kernel.org> References: <20210615111227.2454465-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, valentin.schneider@arm.com, alexandru.elisei@arm.com, sudeep.holla@arm.com, linux@armlinux.org.uk, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210615_121247_385448_EBC2DE31 X-CRM114-Status: GOOD ( 14.42 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The PSCI CPU suspend code isn't aware of the PMR vs DAIF game, resulting in a system that locks up if entering CPU suspend with GICv3 pNMI enabled. To save the day, teach the suspend code about our new cpuidle context helpers, which will do everything that's required just like the usual WFI cpuidle code. This fixes my Altra system, which would otherwise lock-up at boot time when booted with irqchip.gicv3_pseudo_nmi=1. Tested-by: Valentin Schneider Reviewed-by: Lorenzo Pieralisi Signed-off-by: Marc Zyngier --- drivers/firmware/psci/psci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 3c1c5daf6df2..e3da38e15c5b 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -335,10 +335,15 @@ int psci_cpu_suspend_enter(u32 state) { int ret; - if (!psci_power_state_loses_context(state)) + if (!psci_power_state_loses_context(state)) { + struct arm_cpuidle_irq_context context; + + arm_cpuidle_save_irq_context(&context); ret = psci_ops.cpu_suspend(state, 0); - else + arm_cpuidle_restore_irq_context(&context); + } else { ret = cpu_suspend(state, psci_suspend_finisher); + } return ret; } -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel