All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Bharat Bhushan <Bharat.Bhushan@nxp.com>,
	benh@kernel.crashing.org, paulus@samba.org, robh@kernel.org,
	geoff@infradead.org, tyreld@linux.vnet.ibm.com,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: Bharat Bhushan <Bharat.Bhushan@nxp.com>
Subject: Re: [PATCH] powerpc/mpic: Cleanup irq vector accounting
Date: Wed, 04 Jul 2018 23:27:15 +1000	[thread overview]
Message-ID: <87efgjku6k.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <1530267872-31244-1-git-send-email-Bharat.Bhushan@nxp.com>

Bharat Bhushan <Bharat.Bhushan@nxp.com> writes:

> Available vector space accounts ipis and timer interrupts
> while spurious vector was not accounted.

OK. What is the symptom of that? Nothing? Total system crash?

Looks like this can be tagged:

Fixes: 0a4081641d72 ("powerpc/mpic: FSL MPIC error interrupt support.")

Which added the code that uses "12".

> Also later
> mpic_setup_error_int() escape one more vector, seemingly it
> assumes one spurious vector.

Ah right, I get it now.

So there is no bug. It's just a disagreement about whether the "intvec"
argument to mpic_setup_error_int() indicates the first number that's
free to use or the last number that has been allocated.

Right?

cheers

> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
> ---
>  arch/powerpc/sysdev/fsl_mpic_err.c | 2 +-
>  arch/powerpc/sysdev/mpic.c         | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/fsl_mpic_err.c b/arch/powerpc/sysdev/fsl_mpic_err.c
> index 488ec45..2a98837 100644
> --- a/arch/powerpc/sysdev/fsl_mpic_err.c
> +++ b/arch/powerpc/sysdev/fsl_mpic_err.c
> @@ -76,7 +76,7 @@ int mpic_setup_error_int(struct mpic *mpic, int intvec)
>  	mpic->flags |= MPIC_FSL_HAS_EIMR;
>  	/* allocate interrupt vectors for error interrupts */
>  	for (i = MPIC_MAX_ERR - 1; i >= 0; i--)
> -		mpic->err_int_vecs[i] = --intvec;
> +		mpic->err_int_vecs[i] = intvec--;
>  
>  	return 0;
>  }
> diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
> index 1d4e0ef6..e098d1e 100644
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -1380,12 +1380,12 @@ struct mpic * __init mpic_alloc(struct device_node *node,
>  		 * global vector number space, as in case of ipis
>  		 * and timer interrupts.
>  		 *
> -		 * Available vector space = intvec_top - 12, where 12
> +		 * Available vector space = intvec_top - 13, where 13
>  		 * is the number of vectors which have been consumed by
> -		 * ipis and timer interrupts.
> +		 * ipis, timer interrupts and spurious.
>  		 */
>  		if (fsl_version >= 0x401) {
> -			ret = mpic_setup_error_int(mpic, intvec_top - 12);
> +			ret = mpic_setup_error_int(mpic, intvec_top - 13);
>  			if (ret)
>  				return NULL;
>  		}
> -- 
> 1.9.3

  reply	other threads:[~2018-07-04 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 10:24 [PATCH] powerpc/mpic: Cleanup irq vector accounting Bharat Bhushan
2018-07-04 13:27 ` Michael Ellerman [this message]
2018-07-05 15:42   ` Bharat Bhushan
2018-07-05 15:42     ` Bharat Bhushan
2018-07-23 15:11 ` Michael Ellerman

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=87efgjku6k.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=Bharat.Bhushan@nxp.com \
    --cc=benh@kernel.crashing.org \
    --cc=geoff@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=robh@kernel.org \
    --cc=tyreld@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.