From patchwork Fri Dec 16 16:21:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 13075185 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 4AD36C4332F for ; Fri, 16 Dec 2022 16:22: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=f3WE/FA/RMVJwk5ju+C181gEYFLyS68QF+PXHVEYDrY=; b=tlYDLOAGzxxHDE EzL/jFKxxOtZ3kucPeYc0H4dgn3wLe/gHHKK3prD+f2vGgdZoCMs2ZLzJ54xbXGVfkXibEQFfsz97 sXM1akZ6OBwFYHC/H2sB47htv7dpWeJFoftLv/2wHuWLJFyigOyjlMacr9dyvaRP10zxfNLl5Q9xT v0MCK8GfOiQYmEran6ikGwzEMTNmVxa8HmFsKVjQM8o9WdbatR7Yeu5qtUwuZ0tnQGPnwzt7wHzG1 SsituDUl+ooE4jXQmBhl9ICjK/s+b8r+FZRaUnhhsgGmrQxdQYBMWCa48EaS+dcrvRGm8KqblKOEI +Zc+1LAZ1jtKwy/CobWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p6DSx-00GNCF-OF; Fri, 16 Dec 2022 16:21:43 +0000 Received: from mail-mw2nam10on2056.outbound.protection.outlook.com ([40.107.94.56] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p6DSu-00GN8M-Cj for linux-arm-kernel@lists.infradead.org; Fri, 16 Dec 2022 16:21:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvZ5BM1/EyIGqwedKy15Hzy6RFoFiAPykJ9p4VpXHuYWr/CUxNtTectbA573haWsP+Gpd4z+FWqCas6nFFoRjuZE+9e4+NI92K7tu6isbU/SnQSfp5PiZUFO+cKWZu6ktojAmkTmJMOaw6DRA2Kd/IUtlROktmrBkJ49ONcrP2GMWUZWmNvyJ3V8G3to408/252pG6zInSdlvppWriC2+X70vqtNFl5PfpZMDl3jPmVSnzs3V4MW1n6TWhZZd8R7+Yh3nCezTrsCIWky3afLb8LNhxacul30bB23GUanmE0SSNbJT+ZD3/RGjnxr6YAgB3vZCEDHdmtJ/0JpMKoclQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ryBC5Kmy3bAmgPqKIB3TYzbLgWNV1z3Ow7bWPo8Y1jo=; b=SH3VOBNTdL4nPtn4bMnmeuaYVtvbWiNpIm4JI3IJu99Ti7AyarKRKLsHOkK5q5SUrCBif3XhR90NBBqO+igrEw0AeWb05xaKpAIq+fxQ4IRym+bPfLXe0ZCq4CXuibFNd5D5DLcMAvINg5PyG3QqwWQz6HEiXxrgHR4gNJ4nx+8Lo3VB4/uSeT0ZXxxSm/9UCdTnKxIcBUe1kaudRypwEEpoHSpnwGI7/t8UzGF2Y2ZlzGN+jfXWIL2i+9jGtY4gHrFeYVBWmDPv4sv04oRtE2OP0/bxLFeSzUcf5XwohtFvN3bWcszUafXETem1OkSvadqJgMCIbRCLosZVb/GUcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.4.225.30) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=infinera.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=infinera.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infinera.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ryBC5Kmy3bAmgPqKIB3TYzbLgWNV1z3Ow7bWPo8Y1jo=; b=MZ6NHJJJXSUO9QAHbE8cdksjYy32rOHhAzSX9Wlzb39JQnfaJs9V9ZiUnKQTa/xqm279Tj6JsFF3ajzyH/4FXWmR6fcnnW5FKa/HbP9jl+8n2r1Qb9jlf5U8OVFW3SGHLrycygJpbKMnq1IVV233F/Ki5Xh2LVQRUhWq6hfu0gM= Received: from DM6PR02CA0128.namprd02.prod.outlook.com (2603:10b6:5:1b4::30) by CY8PR10MB6907.namprd10.prod.outlook.com (2603:10b6:930:86::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.12; Fri, 16 Dec 2022 16:21:34 +0000 Received: from DS1PEPF0000E641.namprd02.prod.outlook.com (2603:10b6:5:1b4:cafe::75) by DM6PR02CA0128.outlook.office365.com (2603:10b6:5:1b4::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16 via Frontend Transport; Fri, 16 Dec 2022 16:21:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.4.225.30) smtp.mailfrom=infinera.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=infinera.com; Received-SPF: Pass (protection.outlook.com: domain of infinera.com designates 8.4.225.30 as permitted sender) receiver=protection.outlook.com; client-ip=8.4.225.30; helo=owa.infinera.com; pr=C Received: from owa.infinera.com (8.4.225.30) by DS1PEPF0000E641.mail.protection.outlook.com (10.167.17.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5924.10 via Frontend Transport; Fri, 16 Dec 2022 16:21:32 +0000 Received: from sv-ex16-prd.infinera.com (10.100.96.229) by sv-ex16-prd.infinera.com (10.100.96.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 16 Dec 2022 08:21:31 -0800 Received: from sv-smtp-prod2.infinera.com (10.100.98.82) by sv-ex16-prd.infinera.com (10.100.96.229) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 16 Dec 2022 08:21:31 -0800 Received: from se-metroit-prd1.infinera.com ([10.210.32.58]) by sv-smtp-prod2.infinera.com with Microsoft SMTPSVC(7.5.7601.17514); Fri, 16 Dec 2022 08:21:31 -0800 Received: from gentoo-jocke.infinera.com (gentoo-jocke.infinera.com [10.210.71.2]) by se-metroit-prd1.infinera.com (Postfix) with ESMTP id 8A7E62C06D80 for ; Fri, 16 Dec 2022 17:21:30 +0100 (CET) Received: by gentoo-jocke.infinera.com (Postfix, from userid 1001) id 8AF484011464; Fri, 16 Dec 2022 17:21:30 +0100 (CET) From: Joakim Tjernlund To: CC: Joakim Tjernlund Subject: [PATCH] GICv3: Add restart handler to detach CPU from GICv3 Date: Fri, 16 Dec 2022 17:21:28 +0100 Message-ID: <20221216162128.10808-1-joakim.tjernlund@infinera.com> X-Mailer: git-send-email 2.37.4 MIME-Version: 1.0 X-OriginalArrivalTime: 16 Dec 2022 16:21:31.0359 (UTC) FILETIME=[75233EF0:01D9116A] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E641:EE_|CY8PR10MB6907:EE_ X-MS-Office365-Filtering-Correlation-Id: f457197a-ea35-4315-9aa1-08dadf81983a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xby8o5gtLqx+QKXf2k0vxuBB6jhEyfxpDS0Ls+Gsnfrdn9kpn2Dgci9CM2OB1g/tccNPOIIU+rotH82tJ6dC2SoDvmBIXoO/7Tus5hXccQDNfuYJqDKDj85bApRGkW580dlNmftEVMBAYc8aGu41KIq3JDRm9lxtlKy0JxHrBDNcASvd7OwijqoHnoGn5olV0iSR0LcrwZKxxej6BsG3VUP0BPLaehICwWMk22cAhrvCxZKwEfdm+w1oksBP4fv//a0b6anNGd+ZtE98vINLyC5ljq2pmI+MBGy99REq/efSnssuYlmhh4NcQWq6Pq4t/d+TBXi/98PYFTEtd856hvq+SacNdHyLHJD7eybdPIRtQ6miYEPrx2zp5/aBtCHN/uDFHU6U5QHUVjtFpunaDZ/yWQ9P12MsDj8+DUiO0TMrtlzk6y1HXk01mlmC0SEbp+SDTkM86hlxn/7vX6vklIawn6UNZnVCUBjNhPzKy4+mRz+xN/uYoWJ3RdYHW2i5rJsRRYp/Zxly0iFuordKehHpW4wfx180xWi6CPVGL2z5OljwoIQ4E4n+PniXuXDUn0I+j+jsbcEBdLFnfZ2nMxrbLJAPk/rEiJqzKgVmzA6CBaYGhTZACVxm7nUvxSyzLV00hzU4jSao2lB3U0lTWYkNWEGMvlLn3l6Jo1os7O7bafxT7mjoRTpSgX3ln/BNKOR0L+au6Dw0CxwdaRTZcA== X-Forefront-Antispam-Report: CIP:8.4.225.30;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:owa.infinera.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(376002)(39860400002)(451199015)(36840700001)(46966006)(426003)(36860700001)(47076005)(86362001)(83380400001)(81166007)(2906002)(356005)(40480700001)(5660300002)(6916009)(82310400005)(41300700001)(8936002)(1076003)(4326008)(107886003)(26005)(186003)(8676002)(6266002)(336012)(70206006)(70586007)(316002)(42186006)(2616005)(478600001)(82740400003)(44832011)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: infinera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2022 16:21:32.2380 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f457197a-ea35-4315-9aa1-08dadf81983a X-MS-Exchange-CrossTenant-Id: 285643de-5f5b-4b03-a153-0ae2dc8aaf77 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=285643de-5f5b-4b03-a153-0ae2dc8aaf77;Ip=[8.4.225.30];Helo=[owa.infinera.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E641.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6907 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221216_082140_674339_E0BE2660 X-CRM114-Status: GOOD ( 15.80 ) 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 Needed for reboot without resetting the whole GIC Signed-off-by: Joakim Tjernlund --- drivers/irqchip/irq-gic-v3.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index dd7e7f061e8f..1989ea3d2db4 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -1359,6 +1360,22 @@ static void gic_cpu_pm_init(void) static inline void gic_cpu_pm_init(void) { } #endif /* CONFIG_CPU_PM */ +static int gicv3_restart_notify(struct notifier_block *nb, + unsigned long mode, void *cmd) +{ + if (gic_dist_security_disabled()) { + gic_write_grpen1(0); + gic_enable_redist(false); + } + + return NOTIFY_DONE; +} + +static struct notifier_block gicv3_restart_nb = { + .notifier_call = gicv3_restart_notify, + .priority = 255, /* Call last */ +}; + static struct irq_chip gic_chip = { .name = "GICv3", .irq_mask = gic_mask_irq, @@ -1849,6 +1866,7 @@ static int __init gic_init_bases(void __iomem *dist_base, gic_cpu_init(); gic_smp_init(); gic_cpu_pm_init(); + register_restart_handler(&gicv3_restart_nb); if (gic_dist_supports_lpis()) { its_init(handle, &gic_data.rdists, gic_data.domain);