From: Hans de Goede <hdegoede@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Is IRQ number 0 a valid IRQ ?
Date: Sat, 5 Oct 2019 12:47:17 +0200 [thread overview]
Message-ID: <4ef7a462-5ded-0ac7-242e-888a9d36362b@redhat.com> (raw)
Hi Thomas,
This is something which I have been wondering for ever since there are
several places in the kernel where IRQ number 0 is treated as not being
valid (as no IRQ found mostly I guess). Where as other places do treat
IRQ number 0 as valid... ?
Some examples which treat IRQ 0 special:
drivers/base/platform.c: __platform_get_irq() :
if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) {
int ret;
ret = of_irq_get(dev->dev.of_node, num);
if (ret > 0 || ret == -EPROBE_DEFER)
return ret;
}
Note if (ret > 0) not if (ret >= 0)
Other example: drivers/usb/dwc3/gadget.c: dwc3_gadget_get_irq() :
if (!irq)
irq = -EINVAL;
So 2 questions:
1) Is this special handling of IRQ number 0 valid code, or just
mostly some leftover from older days when IRQ number 0 was maybe
special ?
2) Either way (*) I think we (I volunteer) should document this somewhere,
other then adding a note about this to the platform_get_irq docs any
other place where it would be good to specify this?
Regards,
Hans
*) Either IRQ number 0 is not special and then we need to stop the
cargo-culting of treating it special, or it is special and then we
need to document that.
next reply other threads:[~2019-10-05 10:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-05 10:47 Hans de Goede [this message]
2019-10-14 12:25 ` Thomas Gleixner
2019-10-16 8:41 ` Hans de Goede
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=4ef7a462-5ded-0ac7-242e-888a9d36362b@redhat.com \
--to=hdegoede@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®