linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 6/8] powerpc/xive: Simplify the dump of XIVE interrupts under xmon
Date: Tue, 9 Mar 2021 10:22:41 +0100	[thread overview]
Message-ID: <20210309102241.497fd01d@bahia.lan> (raw)
In-Reply-To: <20210303174857.1760393-7-clg@kaod.org>

On Wed, 3 Mar 2021 18:48:55 +0100
Cédric Le Goater <clg@kaod.org> wrote:

> Move the xmon routine under XIVE subsystem and rework the loop on the
> interrupts taking into account the xive_irq_domain to filter out IPIs.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

Nice again ! :)

Reviewed-by: Greg Kurz <groug@kaod.org>

>  arch/powerpc/include/asm/xive.h   |  1 +
>  arch/powerpc/sysdev/xive/common.c | 14 ++++++++++++++
>  arch/powerpc/xmon/xmon.c          | 28 ++--------------------------
>  3 files changed, 17 insertions(+), 26 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/xive.h b/arch/powerpc/include/asm/xive.h
> index 9a312b975ca8..aa094a8655b0 100644
> --- a/arch/powerpc/include/asm/xive.h
> +++ b/arch/powerpc/include/asm/xive.h
> @@ -102,6 +102,7 @@ void xive_flush_interrupt(void);
>  /* xmon hook */
>  void xmon_xive_do_dump(int cpu);
>  int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d);
> +void xmon_xive_get_irq_all(void);
>  
>  /* APIs used by KVM */
>  u32 xive_native_default_eq_shift(void);
> diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
> index 60ebd6f4b31d..f6b7b15bbb3a 100644
> --- a/arch/powerpc/sysdev/xive/common.c
> +++ b/arch/powerpc/sysdev/xive/common.c
> @@ -291,6 +291,20 @@ int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d)
>  	return 0;
>  }
>  
> +void xmon_xive_get_irq_all(void)
> +{
> +	unsigned int i;
> +	struct irq_desc *desc;
> +
> +	for_each_irq_desc(i, desc) {
> +		struct irq_data *d = irq_desc_get_irq_data(desc);
> +		unsigned int hwirq = (unsigned int)irqd_to_hwirq(d);
> +
> +		if (d->domain == xive_irq_domain)
> +			xmon_xive_get_irq_config(hwirq, d);
> +	}
> +}
> +
>  #endif /* CONFIG_XMON */
>  
>  static unsigned int xive_get_irq(void)
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index 3fe37495f63d..80fbf8968f77 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -2727,30 +2727,6 @@ static void dump_all_xives(void)
>  		dump_one_xive(cpu);
>  }
>  
> -static void dump_one_xive_irq(u32 num, struct irq_data *d)
> -{
> -	xmon_xive_get_irq_config(num, d);
> -}
> -
> -static void dump_all_xive_irq(void)
> -{
> -	unsigned int i;
> -	struct irq_desc *desc;
> -
> -	for_each_irq_desc(i, desc) {
> -		struct irq_data *d = irq_desc_get_irq_data(desc);
> -		unsigned int hwirq;
> -
> -		if (!d)
> -			continue;
> -
> -		hwirq = (unsigned int)irqd_to_hwirq(d);
> -		/* IPIs are special (HW number 0) */
> -		if (hwirq)
> -			dump_one_xive_irq(hwirq, d);
> -	}
> -}
> -
>  static void dump_xives(void)
>  {
>  	unsigned long num;
> @@ -2767,9 +2743,9 @@ static void dump_xives(void)
>  		return;
>  	} else if (c == 'i') {
>  		if (scanhex(&num))
> -			dump_one_xive_irq(num, NULL);
> +			xmon_xive_get_irq_config(num, NULL);
>  		else
> -			dump_all_xive_irq();
> +			xmon_xive_get_irq_all();
>  		return;
>  	}
>  


  reply	other threads:[~2021-03-09  9:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 17:48 [PATCH v2 0/8] powerpc/xive: Map one IPI interrupt per node Cédric Le Goater
2021-03-03 17:48 ` [PATCH v2 1/8] powerpc/xive: Use cpu_to_node() instead of ibm, chip-id property Cédric Le Goater
2021-03-08 17:13   ` [PATCH v2 1/8] powerpc/xive: Use cpu_to_node() instead of ibm,chip-id property Greg Kurz
2021-03-09 15:33     ` Cédric Le Goater
2021-03-09 17:08       ` Daniel Henrique Barboza
2021-03-09 17:26         ` Cédric Le Goater
2021-03-12  1:55           ` David Gibson
2021-03-12  9:53             ` Cédric Le Goater
2021-03-12 12:18               ` Daniel Henrique Barboza
2021-03-12 13:03                 ` Greg Kurz
2021-03-12 13:28                 ` Cédric Le Goater
2021-03-03 17:48 ` [PATCH v2 2/8] powerpc/xive: Introduce an IPI interrupt domain Cédric Le Goater
2021-03-08 17:55   ` Greg Kurz
2021-03-03 17:48 ` [PATCH v2 3/8] powerpc/xive: Remove useless check on XIVE_IPI_HW_IRQ Cédric Le Goater
2021-03-08 17:56   ` Greg Kurz
2021-03-03 17:48 ` [PATCH v2 4/8] powerpc/xive: Simplify xive_core_debug_show() Cédric Le Goater
2021-03-08 18:07   ` Greg Kurz
2021-03-08 18:11     ` Cédric Le Goater
2021-03-09  9:13       ` Greg Kurz
2021-03-09  9:42         ` Greg Kurz
2021-03-09 15:39           ` Cédric Le Goater
2021-03-03 17:48 ` [PATCH v2 5/8] powerpc/xive: Drop check on irq_data in xive_core_debug_show() Cédric Le Goater
2021-03-09  9:18   ` Greg Kurz
2021-03-03 17:48 ` [PATCH v2 6/8] powerpc/xive: Simplify the dump of XIVE interrupts under xmon Cédric Le Goater
2021-03-09  9:22   ` Greg Kurz [this message]
2021-03-03 17:48 ` [PATCH v2 7/8] powerpc/xive: Fix xmon command "dxi" Cédric Le Goater
2021-03-09 10:23   ` Greg Kurz
2021-03-09 15:49     ` Cédric Le Goater
2021-03-03 17:48 ` [PATCH v2 8/8] powerpc/xive: Map one IPI interrupt per node Cédric Le Goater
2021-03-09 13:23   ` Greg Kurz
2021-03-09 15:52     ` Cédric Le Goater
2021-03-30 16:18   ` Cédric Le Goater

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=20210309102241.497fd01d@bahia.lan \
    --to=groug@kaod.org \
    --cc=clg@kaod.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).