From patchwork Sat Nov 26 13:34:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 26244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4634231wrr; Sat, 26 Nov 2022 05:36:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CtqCmxrgrcJFgn5gvSwn1GOMeQ+HYYkyYQIdXjuoomXnEp+ZqnJ4baEbzWEHqrMpMBPRa X-Received: by 2002:a17:902:b707:b0:189:5f3c:fb25 with SMTP id d7-20020a170902b70700b001895f3cfb25mr10934260pls.123.1669469765906; Sat, 26 Nov 2022 05:36:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669469765; cv=none; d=google.com; s=arc-20160816; b=JuTUspLVognRmmvioeZeuClZ2oN2i3svcDEAf3pIccDTzAHqrtlaEniLqRcUIGBpK4 6gY6B3tuiG2jSPTAJ7AgIMDqBS52T1RJNvLt+9DIqE2siCgnaG7X5WSxb4ru/pwis75C pCI+3SzGRKnjFjQYRuk0N+EE0szJjoh/3q+9iNwjG3AR8LnlwSRxAb0W4i8piq+gF4zj PzLYuOi67z7Gz5q5UcLXnOnZX9t/j1Fc2oxb/QOqxE/oF4AKAxKXzyooRmIFYFlXhl7h i6PAMXW1L6L67qvjCUFPGj3j9bn8K3bwBzhYt5zF4hQC195m1iruZTTMlpYDASnSDxy1 znMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=7vAvqErmjHVG45h+ZJaduBooqBOz5E+TEsLc743Podw=; b=D3RGdCmRh8Dg6AOgYS4te5T64KJZt0J64y4o/D3/sEo+BSqFPE14w0WCWgX6JefMRG 6zxUdxYRi/u0bjaTEAimwQo37sVvHafHMOvlyr/4XkAnwphsurhvoSrgDl4/WfevAEAq C1w8Bu1c4J5NCKWqqH/cwRmaO/nfZCCEN0cP8MjO9IC2fb5C3hoQHGby6dz/YF8c+XtL Q2wdt8HzONA2PxcUySkrJrYD8XLncq1CqzX2/XUyLMNzs8ac3R/dJznqvI7/oPmchCOz GsXuQAk78v9IS8va9mwB2RH9+mGBXNMIqyn7ZVL4OuEWhi2BdvgtS8iI9FgWhYk4XfQG L3Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nCs8g9N0; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay10-20020a056a00300a00b0055214e179d5si6596912pfb.63.2022.11.26.05.35.52; Sat, 26 Nov 2022 05:36:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nCs8g9N0; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbiKZNfD (ORCPT + 99 others); Sat, 26 Nov 2022 08:35:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbiKZNey (ORCPT ); Sat, 26 Nov 2022 08:34:54 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 077C419033 for ; Sat, 26 Nov 2022 05:34:41 -0800 (PST) Date: Sat, 26 Nov 2022 13:34:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669469679; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7vAvqErmjHVG45h+ZJaduBooqBOz5E+TEsLc743Podw=; b=nCs8g9N0UKkT+hNMGTcC/TRguju4fwWn+3JY0lzZGtehPpz0L1Kkbu3mgTCdztNwyeh8mz GwFBknEHks/3LI2qL2Ojv0+v6qF4ibgj1P7WlSisW2HWbl6YaXttyVzevOjVeRnCsxg4Dl lPvXlXaPR7BKdl8kWwLinfnGc+P8iBCh51ZwkzL5g2Qf5JNTxVOZLEXp5+bWHZzg13j/tI 9AzM2MPaRBwsVvNU5oOVGL9uX8YKy6mHz+epCNCI0AKD93CuaPUaXkGaMgQDbCXO0IxQQX b6gNOGEXsVT+ObWzmL6ba21+KtS/bQ4hboYhN42Wul6SbOUzCABmDAGabexltg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669469679; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7vAvqErmjHVG45h+ZJaduBooqBOz5E+TEsLc743Podw=; b=jYvprGksGlW5BoqU5UpKKNxt9Q4jYDWP4X27c/GBYN10NAD141/VfkjYRrQAV/2dI9ULaM r+qOT6IzXCdH9dAA== From: "irqchip-bot for Huacai Chen" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/loongson-eiointc: Add suspend/resume support Cc: Huacai Chen , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20221020073527.541845-3-chenhuacai@loongson.cn> References: <20221020073527.541845-3-chenhuacai@loongson.cn> MIME-Version: 1.0 Message-ID: <166946967829.4906.5902688753005377068.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747191631310815277?= X-GMAIL-MSGID: =?utf-8?q?1750565929181044476?= The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: a90335c2dfb4ffe572816f77a3c4f2d1d388d724 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/a90335c2dfb4ffe572816f77a3c4f2d1d388d724 Author: Huacai Chen AuthorDate: Thu, 20 Oct 2022 15:35:25 +08:00 Committer: Marc Zyngier CommitterDate: Sat, 26 Nov 2022 13:12:12 irqchip/loongson-eiointc: Add suspend/resume support Add suspend/resume support for EIOINTC irqchip, which is needed for upcoming suspend/hibernation. Signed-off-by: Huacai Chen Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221020073527.541845-3-chenhuacai@loongson.cn --- drivers/irqchip/irq-loongson-eiointc.c | 33 +++++++++++++++++++++++++- 1 file changed, 33 insertions(+) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index 16e9af8..5cf4b80 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -17,6 +17,7 @@ #include #include #include +#include #define EIOINTC_REG_NODEMAP 0x14a0 #define EIOINTC_REG_IPMAP 0x14c0 @@ -301,6 +302,37 @@ static struct irq_domain *acpi_get_vec_parent(int node, struct acpi_vector_group return NULL; } +static int eiointc_suspend(void) +{ + return 0; +} + +static void eiointc_resume(void) +{ + int i, j; + struct irq_desc *desc; + struct irq_data *irq_data; + + eiointc_router_init(0); + + for (i = 0; i < nr_pics; i++) { + for (j = 0; j < VEC_COUNT; j++) { + desc = irq_resolve_mapping(eiointc_priv[i]->eiointc_domain, j); + if (desc && desc->handle_irq && desc->handle_irq != handle_bad_irq) { + raw_spin_lock(&desc->lock); + irq_data = &desc->irq_data; + eiointc_set_irq_affinity(irq_data, irq_data->common->affinity, 0); + raw_spin_unlock(&desc->lock); + } + } + } +} + +static struct syscore_ops eiointc_syscore_ops = { + .suspend = eiointc_suspend, + .resume = eiointc_resume, +}; + static int __init pch_pic_parse_madt(union acpi_subtable_headers *header, const unsigned long end) @@ -380,6 +412,7 @@ int __init eiointc_acpi_init(struct irq_domain *parent, parent_irq = irq_create_mapping(parent, acpi_eiointc->cascade); irq_set_chained_handler_and_data(parent_irq, eiointc_irq_dispatch, priv); + register_syscore_ops(&eiointc_syscore_ops); cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_LOONGARCH_STARTING, "irqchip/loongarch/intc:starting", eiointc_router_init, NULL);