Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp812786imm; Wed, 4 Jul 2018 06:28:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeqw0NdD9IiqLXuTCnemZVNsD5VsEHjEJz9DwBbbACNeCm8j7kNkLl3Ln+rwCvIBV8DNJd9 X-Received: by 2002:a62:ba13:: with SMTP id k19-v6mr2184311pff.245.1530710900199; Wed, 04 Jul 2018 06:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530710900; cv=none; d=google.com; s=arc-20160816; b=w6ylQBIdpsgVd8FnIt3puhiblYTLXJThEMO9oL5BS5jT7eDpJAmMNqX26ddKvy9fF1 LeZapJINYRNeASWVD+zgfD37AAh1F4VlJkUTFr2X4822HnuLbHPjyXHoDqusN1uqJFII 21oDC/ObTKM3Zahs+huJcyKap/X9crTdjy89JuxVAqv9jvDcqGpEGytasAJqtu5zsX77 4z3bSqgalPK4v7zKQslK+kBiX4c8d30nepEEO1BIOw3jpi5U4uN/wjeiUHWhk/ZuQ6ju GkvDxEBYRszuhKLEnIH9sgv0jSP3J5yCpktX6zvKEfI7jtNQTdLYNFqOb2awUYTPwCdj CdQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=StLehgBbTX7EeskrfRN19uHPisASQ+015JIzFDG5NGY=; b=vbv4ZEMN4nECeGkL9CtmvJopcUOYWkaA5WJUXR+kfxRITrVAecjoxQo5LPyLzkeDsB qHXnV5eEA/8ESJ6ejTJ0XrQMv7+z5sRiJn4U5GbD52wSh7aTovmLAN///eM3GFYH3YPS 03+TLoORzqhxkmNQrAUcQMffbUvJXUW5qVo97gS7c8M0pKjA7cd9eHPzUNoQSGRRuWzX EdLuxuKf73u1jXrNxB6ggEYX0PxCAbvAyq2sYmCjoTqs+nycR/EmBvgpZfo6d5jpd06j fkICEp2ATrJeuku9+3UG1OoZ/oy3TH3sXDigZKZndNeOLgOj54JcOXk/xB+h7AWiiAOy /Vgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x19-v6si3445376plr.15.2018.07.04.06.28.05; Wed, 04 Jul 2018 06:28:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753156AbeGDN1S (ORCPT + 99 others); Wed, 4 Jul 2018 09:27:18 -0400 Received: from ozlabs.org ([203.11.71.1]:46587 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634AbeGDN1S (ORCPT ); Wed, 4 Jul 2018 09:27:18 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 41LMGr1sQRz9s29; Wed, 4 Jul 2018 23:27:16 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Bharat Bhushan , 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 Subject: Re: [PATCH] powerpc/mpic: Cleanup irq vector accounting In-Reply-To: <1530267872-31244-1-git-send-email-Bharat.Bhushan@nxp.com> References: <1530267872-31244-1-git-send-email-Bharat.Bhushan@nxp.com> Date: Wed, 04 Jul 2018 23:27:15 +1000 Message-ID: <87efgjku6k.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bharat Bhushan 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 > --- > 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