ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: ksummit-discuss@lists.linuxfoundation.org, "Nikula,
	Jani" <jani.nikula@linux.intel.com>,
	Dave Airlie <airlied@linux.ie>,
	Grant Likely <grant.likely@linaro.org>
Subject: Re: [Ksummit-discuss] [CORE TOPIC] (group) maintainership models
Date: Fri, 02 Sep 2016 22:06:02 +0200	[thread overview]
Message-ID: <7359509.5sppVSLXcK@wuerfel> (raw)
In-Reply-To: <CA+55aFwSpNrOuOzaR5hh0A1XvuTu0=xVbE_CV1RVf9GMrTPDNQ@mail.gmail.com>

On Friday, September 2, 2016 10:25:09 AM CEST Linus Torvalds wrote:
> On Fri, Sep 2, 2016 at 3:46 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> >
> > Arm seems to define NO_IRQ. This is not available in other arch and one
> > driver (moxart-dma) is using it. I don't see why this should be arm specific.
> 
> NO_IRQ is broken. We long long since agreed that 0 is "no irq", and
> that the right way to test for it is just
> 
>    if (!irq) ...
> 
> which is what all the generic drivers use.

Right, this one must have escaped review. We had NO_IRQ almost eliminated
from ARM specific drivers, and this one was probably added later.

> See for example
> 
>    git grep '(!.*irq)'
> 
> for how common that is.
> 
> (If you grep for NO_IRQ, you'll find a lot in particularly powerpc
> drivers and platforms, but there NO_IRQ is actually just defined to
> (0), so it ends up being the same thing).
> 
> The fact that ARM still has a NO_IRQ that seems to be defined to
> ((unsigned int)-1) just means that there are bugs hiding: if ARM
> actually _uses_ that value for "no IRQ", then all the generic drivers
> will be broken, and if ARM core doesn't, then the drivers that still
> use NO_IRQ are broken. Either way you can't win.
>
> So please make sure that NO_IRQ goes away entirely (or, if you insist
> on having the confusing #define for some legacy reason, make it be 0
> like powerpc, so that the real way of just testing "!irq" also works)

I'll throw this patch at my randconfig builder and see what breaks:

diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
index 1bd9510de1b9..b5b8354c1d9e 100644
--- a/arch/arm/include/asm/irq.h
+++ b/arch/arm/include/asm/irq.h
@@ -13,14 +13,6 @@
 #define irq_canonicalize(i)	(i)
 #endif
 
-/*
- * Use this value to indicate lack of interrupt
- * capability
- */
-#ifndef NO_IRQ
-#define NO_IRQ	((unsigned int)(-1))
-#endif
-
 #ifndef __ASSEMBLY__
 struct irqaction;
 struct pt_regs;


When I once looked, I thought all drivers using NO_IRQ were specific
to powerpc or one of the less common architectures.  We do have
these files however:

arch/arm/common/locomo.c:       if (lchip->irq != NO_IRQ && lchip->irq_base != NO_IRQ)
arch/arm/common/locomo.c:       if (lchip->irq != NO_IRQ) {
arch/arm/common/sa1111.c:       if (sachip->irq != NO_IRQ) {
arch/arm/common/sa1111.c:       if (sachip->irq != NO_IRQ) {
arch/arm/mach-mmp/devices.c:    if (desc->irq != NO_IRQ) {
arch/arm/mach-mv78xx0/common.c:                 NO_IRQ,
arch/arm/mach-mv78xx0/common.c:                 NO_IRQ);
arch/arm/mach-mv78xx0/common.c:                 NO_IRQ);
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c:   orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c:           .irq            = NO_IRQ,
arch/arm/mach-orion5x/wnr854t-setup.c:  orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
arch/arm/mach-orion5x/wrt350n-v2-setup.c:       orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
arch/arm/plat-orion/common.c:   if (irq != NO_IRQ) {
arch/arm/plat-orion/common.c:                  mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
arch/arm/plat-orion/common.c:                  mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
arch/arm/plat-orion/common.c:                  mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
arch/arm/plat-orion/common.c:                  mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
arch/arm/plat-orion/common.c:   if (irq != NO_IRQ) {
arch/arm/plat-orion/common.c:                  mapbase, SZ_512 - 1, NO_IRQ);
arch/arm/plat-orion/common.c:                  mapbase, SZ_512 - 1, NO_IRQ);

I can have another look what can be done about them. IIRC, plat-orion (which
includes mach-orion5x and mv78xx0) until recently still had devices with
IRQ as a valid number, but that was finally fixed now, so we should be able to
clean up most of them.

	Arnd

  reply	other threads:[~2016-09-02 20:06 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 12:11 Daniel Vetter
2016-07-22 20:02 ` Darren Hart
2016-07-25  5:57   ` Daniel Vetter
2016-07-26 16:22     ` Darren Hart
2016-07-28 22:13       ` Bjorn Helgaas
2016-07-26 16:45 ` Olof Johansson
2016-07-27  3:04   ` Vinod Koul
2016-07-27  5:34     ` Wolfram Sang
2016-07-27  7:53     ` Arnd Bergmann
2016-07-27 12:57       ` Vinod Koul
2016-07-27 14:22         ` Mark Brown
2016-07-27 17:15           ` Vinod Koul
2016-07-28  8:44             ` Arnd Bergmann
2016-07-28 23:48               ` Alexandre Belloni
2016-07-29  0:06                 ` Stephen Rothwell
2016-07-31 17:57               ` Vinod Koul
2016-08-01  6:56                 ` Arnd Bergmann
2016-08-01  7:36                   ` Laurent Pinchart
2016-08-01 14:10                     ` Arnd Bergmann
2016-08-02  4:46                       ` Vinod Koul
2016-08-02  6:48                         ` Peter Ujfalusi
2016-08-02  7:27                           ` Arnd Bergmann
2016-08-02  8:29                             ` Peter Ujfalusi
2016-08-02  8:33                           ` Laurent Pinchart
2016-08-02  9:49                             ` Tony Lindgren
2016-08-02  8:41                           ` Russell King - ARM Linux
2016-08-02  9:21                             ` Laurent Pinchart
2016-08-02  9:27                               ` Russell King - ARM Linux
2016-09-02 10:46                   ` Vinod Koul
2016-09-02 17:25                     ` Linus Torvalds
2016-09-02 20:06                       ` Arnd Bergmann [this message]
2016-09-02 20:26                         ` Linus Torvalds
2016-09-02 20:43                           ` Julia Lawall
2016-09-02 20:50                             ` Linus Torvalds
2016-09-02 22:16                           ` Benjamin Herrenschmidt
2016-09-03 14:02                           ` Michael Ellerman
2016-09-02 23:35                         ` Arnd Bergmann
2016-09-04 17:45                       ` Geert Uytterhoeven
2016-09-04 17:59                         ` Linus Torvalds
2016-09-03  0:07                     ` Mark Brown
2016-07-27 12:59     ` Daniel Vetter
2016-07-27 13:03   ` Daniel Vetter
2016-08-01 14:42 ` Jani Nikula
2016-09-07  5:03 Leon Romanovsky

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=7359509.5sppVSLXcK@wuerfel \
    --to=arnd@arndb.de \
    --cc=airlied@linux.ie \
    --cc=grant.likely@linaro.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=torvalds@linux-foundation.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