From: "irqchip-bot for Huacai Chen" <tip-bot2@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Huacai Chen <chenhuacai@loongson.cn>,
Marc Zyngier <maz@kernel.org>,
tglx@linutronix.de
Subject: [irqchip: irq/irqchip-next] irqchip/loongson-eiointc: Add suspend/resume support
Date: Sat, 26 Nov 2022 13:34:38 -0000 [thread overview]
Message-ID: <166946967829.4906.5902688753005377068.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20221020073527.541845-3-chenhuacai@loongson.cn>
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 <chenhuacai@loongson.cn>
AuthorDate: Thu, 20 Oct 2022 15:35:25 +08:00
Committer: Marc Zyngier <maz@kernel.org>
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 <chenhuacai@loongson.cn>
Signed-off-by: Marc Zyngier <maz@kernel.org>
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 <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/syscore_ops.h>
#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);
next prev parent reply other threads:[~2022-11-26 13:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 7:35 [PATCH V2 0/4] irqchip/loongson: Add suspend/resume support for irqchip drivers Huacai Chen
2022-10-20 7:35 ` [PATCH V2 1/4] irqchip/loongson-htvec: Add suspend/resume support Huacai Chen
2022-11-26 13:34 ` [irqchip: irq/irqchip-next] " irqchip-bot for Huacai Chen
2022-10-20 7:35 ` [PATCH V2 2/4] irqchip/loongson-eiointc: " Huacai Chen
2022-11-26 13:34 ` irqchip-bot for Huacai Chen [this message]
2022-10-20 7:35 ` [PATCH V2 3/4] irqchip/loongson-pch-pic: " Huacai Chen
2022-11-26 13:34 ` [irqchip: irq/irqchip-next] " irqchip-bot for Huacai Chen
2022-10-20 7:35 ` [PATCH V2 4/4] irqchip/loongson-pch-lpc: " Huacai Chen
2022-11-26 13:34 ` [irqchip: irq/irqchip-next] " irqchip-bot for Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=166946967829.4906.5902688753005377068.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=chenhuacai@loongson.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®