All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	"jiang.liu@linux.intel.com" <jiang.liu@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-tip-commits@vger.kernel.org" 
	<linux-tip-commits@vger.kernel.org>
Subject: Re: [tip:irq/core] genirq: MSI: Fix freeing of unallocated MSI
Date: Thu, 9 Apr 2015 16:49:38 +0200	[thread overview]
Message-ID: <20150409144938.GB15910@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1504091450570.3845@nanos>


* Thomas Gleixner <tglx@linutronix.de> wrote:

> On Thu, 9 Apr 2015, Marc Zyngier wrote:
> > On Thu, 9 Apr 2015 13:00:23 +0100
> > Ingo Molnar <mingo@kernel.org> wrote:
> > > 
> > > Hm, so this appears to be the first time that 'irq == 0' assumptions 
> > > are getting into the genirq core. Is NO_IRQ dead? I realize that the 
> > > MSI code uses '!irq' as a flag, but still, quite a few architectures 
> > > define NO_IRQ so it appears to matter to them.
> > 
> > NO_IRQ strikes back, everybody takes cover! ;-)
> > 
> > More seriously, this seems to be two schools of thoughts on that 
> > one. The irqdomain subsystem seems to treat 'irq == 0' as the 
> > indication that 'this is not a valid IRQ', and so does MSI (as you 
> > noticed). Given that this code deals with MSI in conjunction with 
> > irqdomains, it felt natural to adopt the same convention.
> > 
> > Also, not all the architecture are defining NO_IRQ, and it only 
> > seems to be used in code that is doesn't look portable across 
> > architectures. Either these architecture don't care about MSI, or 
> > they are happy enough to consider that virtual interrupt 0 is 
> > invalid in the MSI case.
> > 
> > So I'm a bit lost on that one. I sincerely thought NO_IRQ was 
> > being retired (https://lwn.net/Articles/470820/). Should we 
> > introduce a NO_MSI_IRQ (set to zero) to take care of this case?
> 
> Nah, that'd be overkill. irq 0 is invalid for MSI in any case so we 
> really should stick with that convention.

That makes sense - should we more aggressively eliminate NO_IRQ 
perhaps?

I'm seeing stuff like:

                irq = irq_of_parse_and_map(np, 0);
                if (!handle || (irq == NO_IRQ)) {

in fairly recent (2-4 years old) code, and irq_of_parse_and_map() is 
used in 300+ places.

Thanks,

	Ingo

      reply	other threads:[~2015-04-09 14:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 19:10 [PATCH] genirq: MSI: Fix freeing of unallocated MSI Marc Zyngier
2015-01-27  5:33 ` Jiang Liu
2015-04-08 21:30 ` [tip:irq/core] " tip-bot for Marc Zyngier
2015-04-09 12:00   ` Ingo Molnar
2015-04-09 12:42     ` Marc Zyngier
2015-04-09 12:52       ` Thomas Gleixner
2015-04-09 14:49         ` Ingo Molnar [this message]

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=20150409144938.GB15910@gmail.com \
    --to=mingo@kernel.org \
    --cc=hpa@zytor.com \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --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 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.