From patchwork Sat Nov 26 13:34:39 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: 26241 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4634177wrr; Sat, 26 Nov 2022 05:35:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf5eO+PHIUQFiK7XYgAiwex6yxO56jLweVwuiHqjUJqK4Dzy5by00OCLoV1cwu7Ut/E6/gr3 X-Received: by 2002:a17:903:3292:b0:188:ec14:e3a3 with SMTP id jh18-20020a170903329200b00188ec14e3a3mr22619969plb.154.1669469759316; Sat, 26 Nov 2022 05:35:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669469759; cv=none; d=google.com; s=arc-20160816; b=vXT46qr+z+yVDoqvW1R3m8Y25PUsoD042JsQ3lrNvGXViZyh2jV3pnoP6nzA70pKfS QfX3J7GcFy5Ofy/FT58ie06TeQCqlbS38Bz62oWooqdBLL1dzSJjTMk/EW5gcjO8kwWP 4dhhD+x1PCgJW9bBpi4sjO26H3Mu6IuZyUT41zBrYJ36+FOJHGlvrGqq5qWG1XvBoU/l MwphCViN0/TN9eYmZt1Jg9Jb367wn5pr+ID9IO6/5GF6GLwvxQ6ODJpQZqt3HeQ4NnVh o9kEzJbpE5O1uxKgJN9I80HgWwI7I0OHDypftJhlK48bAt739cBSDA9rVidcy7R8wSnU +ojg== 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=mXOIxOU5S4iAL8STg1FjNoj61k10eRhE7jyQtctu3Fs=; b=fVFnWyre0ONPK3TVpQckKH5KdeUpt1xmw4mPSZsaXqRksIrF4ooDwqW+K/iXEDWk+b Yi6QEKbwOgAInEib15bJCZ4ZGSEKNZr2QfC9Le6EprGLEc7tkXMPl5dQVuAwPhcYj4oZ FnzPjjzcLfWKbFdjg/L0vWFYY+45X3Zuz3KRG3J5KDpX9VsdCRQRVPhHFzSTB1IAj/mR TxkFPdiPN9jl49JHWsFDjDqCkWHIvL8RB7Qe2UgNS408NyMC2t9RIz/0xJAMTFAd6vN6 pTLqZqAggQWfwc7baieVLHLL2p3N4QFNi2YYy+DlPPKubItYROizcTn12QrX772pWlGC oQjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vWWy48A7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="s/z2NoQj"; 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 k1-20020a654641000000b00477b29bb007si7074714pgr.854.2022.11.26.05.35.46; Sat, 26 Nov 2022 05:35:59 -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=vWWy48A7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="s/z2NoQj"; 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 S229678AbiKZNfL (ORCPT + 99 others); Sat, 26 Nov 2022 08:35:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbiKZNez (ORCPT ); Sat, 26 Nov 2022 08:34:55 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515E7201AD for ; Sat, 26 Nov 2022 05:34:42 -0800 (PST) Date: Sat, 26 Nov 2022 13:34:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669469680; 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=mXOIxOU5S4iAL8STg1FjNoj61k10eRhE7jyQtctu3Fs=; b=vWWy48A7HqEio0mnSCmv7vFBdxSZsBN0CNdQc+SSvoFjPZ7vOJjF0uzKFUz40DUapfMUB3 VAfnVPHHrw6jCuVze8Dyx+pnd6uzmsLwlBhyBHPUU/x0mh5gQaFxox73FQ3hMs8zezvyfC 6d7Pzn2jZQKgXsF1SQG8+/GqF5xzLYHuSGxgkuNKli5LGt1oEJ8N6ELi1Nddu2FNjWsZN8 kXp0WGLCNKar5OFHe3lj0y5gbGY7B6gmTKvmDmdqKf2NOaFTZBN6lv9IQxc5ez1nEm5uem Fat0VVLnlFwsSHcZX8C3FDrT2wb/ZRScIBhBb+6R5bwJAnLAaGhdq3n0TG+UGw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669469680; 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=mXOIxOU5S4iAL8STg1FjNoj61k10eRhE7jyQtctu3Fs=; b=s/z2NoQjnxKP2X5o4Uhad8kLXa4qzWS3KQUtaMMZSNylOKqizrN9+5+O/PMGMOLb59oEp7 2xiZPM7jRV+Qq1CQ== 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-htvec: Add suspend/resume support Cc: Huacai Chen , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20221020073527.541845-2-chenhuacai@loongson.cn> References: <20221020073527.541845-2-chenhuacai@loongson.cn> MIME-Version: 1.0 Message-ID: <166946967944.4906.6915919359278946026.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?1747191506803513364?= X-GMAIL-MSGID: =?utf-8?q?1750565922324530658?= The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 1be356c9326d68c9b0161ca004a41f203864d7ee Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/1be356c9326d68c9b0161ca004a41f203864d7ee Author: Huacai Chen AuthorDate: Thu, 20 Oct 2022 15:35:24 +08:00 Committer: Marc Zyngier CommitterDate: Sat, 26 Nov 2022 13:09:25 irqchip/loongson-htvec: Add suspend/resume support Add suspend/resume support for HTVEC 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-2-chenhuacai@loongson.cn --- drivers/irqchip/irq-loongson-htvec.c | 27 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+) diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c index 8b06082..fc8bf1f 100644 --- a/drivers/irqchip/irq-loongson-htvec.c +++ b/drivers/irqchip/irq-loongson-htvec.c @@ -16,6 +16,7 @@ #include #include #include +#include /* Registers */ #define HTVEC_EN_OFF 0x20 @@ -29,6 +30,7 @@ struct htvec { void __iomem *base; struct irq_domain *htvec_domain; raw_spinlock_t htvec_lock; + u32 saved_vec_en[HTVEC_MAX_PARENT_IRQ]; }; static struct htvec *htvec_priv; @@ -156,6 +158,29 @@ static void htvec_reset(struct htvec *priv) } } +static int htvec_suspend(void) +{ + int i; + + for (i = 0; i < htvec_priv->num_parents; i++) + htvec_priv->saved_vec_en[i] = readl(htvec_priv->base + HTVEC_EN_OFF + 4 * i); + + return 0; +} + +static void htvec_resume(void) +{ + int i; + + for (i = 0; i < htvec_priv->num_parents; i++) + writel(htvec_priv->saved_vec_en[i], htvec_priv->base + HTVEC_EN_OFF + 4 * i); +} + +static struct syscore_ops htvec_syscore_ops = { + .suspend = htvec_suspend, + .resume = htvec_resume, +}; + static int htvec_init(phys_addr_t addr, unsigned long size, int num_parents, int parent_irq[], struct fwnode_handle *domain_handle) { @@ -188,6 +213,8 @@ static int htvec_init(phys_addr_t addr, unsigned long size, htvec_priv = priv; + register_syscore_ops(&htvec_syscore_ops); + return 0; iounmap_base: