Commit 63f9ef21 authored by Jinjie Ruan's avatar Jinjie Ruan
Browse files

arm64: Add debugfs dir for xint

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/release-management/issues/IB6JLE



--------------------------------

Add a debugfs dir for xint, so we can get the xint irq information
such as 'which interrupts are currently in xint state' with
following cmd:

	# ls /sys/kernel/debug/irq/xints

Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
parent 3053668e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -35,6 +35,10 @@

#include "irq-gic-common.h"

#ifdef CONFIG_FAST_IRQ
#include "../../../kernel/irq/internals.h"
#endif

#define GICD_INT_NMI_PRI	(GICD_INT_DEF_PRI & ~0x80)

#define FLAGS_WORKAROUND_GICR_WAKER_MSM8996	(1ULL << 0)
@@ -1017,9 +1021,11 @@ static bool xint_transform(int irqno, enum xint_op op)
	switch (op) {
	case IRQ_TO_XINT:
		set_bit(hwirq, irqnr_xint_map);
		xint_add_debugfs_entry(irqno);
		return true;
	case XINT_TO_IRQ:
		clear_bit(hwirq, irqnr_xint_map);
		xint_remove_debugfs_entry(irqno);
		return false;
	case XINT_SET_CHECK:
		return test_bit(hwirq, irqnr_xint_map);
+33 −0
Original line number Diff line number Diff line
@@ -242,6 +242,34 @@ void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc)
						 &dfs_irq_ops);
}

#ifdef CONFIG_FAST_IRQ
static struct dentry *xint_dir;

void xint_add_debugfs_entry(unsigned int irq)
{
	char name[10];
	char buf[100];

	if (!xint_dir)
		return;

	sprintf(name, "%d", irq);
	sprintf(buf, "../irqs/%d", irq);
	debugfs_create_symlink(name, xint_dir, buf);
}

void xint_remove_debugfs_entry(unsigned int irq)
{
	char name[10];

	if (!xint_dir)
		return;

	sprintf(name, "%d", irq);
	debugfs_lookup_and_remove(name, xint_dir);
}
#endif

static int __init irq_debugfs_init(void)
{
	struct dentry *root_dir;
@@ -253,6 +281,11 @@ static int __init irq_debugfs_init(void)

	irq_dir = debugfs_create_dir("irqs", root_dir);

#ifdef CONFIG_FAST_IRQ
	if (is_xint_support)
		xint_dir = debugfs_create_dir("xints", root_dir);
#endif

	irq_lock_sparse();
	for_each_active_irq(irq)
		irq_add_debugfs_entry(irq, irq_to_desc(irq));
+18 −0
Original line number Diff line number Diff line
@@ -500,6 +500,14 @@ static inline void irq_remove_debugfs_entry(struct irq_desc *desc)
	debugfs_remove(desc->debugfs_file);
	kfree(desc->dev_name);
}

#ifdef CONFIG_FAST_IRQ
extern bool is_xint_support;

void xint_add_debugfs_entry(unsigned int irq);
void xint_remove_debugfs_entry(unsigned int irq);
#endif

void irq_debugfs_copy_devname(int irq, struct device *dev);
# ifdef CONFIG_IRQ_DOMAIN
void irq_domain_debugfs_init(struct dentry *root);
@@ -515,6 +523,16 @@ static inline void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *d)
static inline void irq_remove_debugfs_entry(struct irq_desc *d)
{
}

#ifdef CONFIG_FAST_IRQ
static inline void xint_add_debugfs_entry(unsigned int irq)
{
}
static inline void xint_remove_debugfs_entry(unsigned int irq)
{
}
#endif

static inline void irq_debugfs_copy_devname(int irq, struct device *dev)
{
}