netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	xiujianfeng@huawei.com, kvm@vger.kernel.org,
	alvaro.karsz@solid-run.com, Jason Wang <jasowang@redhat.com>,
	angus.chen@jaguarmicro.com, wangdeming@inspur.com,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Netdev <netdev@vger.kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	lingshan.zhu@intel.com, linuxppc-dev@lists.ozlabs.org,
	gavinl@nvidia.com
Subject: Re: [GIT PULL] virtio: fixes, features
Date: Thu, 13 Oct 2022 10:19:02 -0700	[thread overview]
Message-ID: <CAHk-=whLv3MO0Tvc62zJ+=4yvSfKMK17C0wfpbXBwUJqSjKbYA@mail.gmail.com> (raw)
In-Reply-To: <a35fd31b-0658-4ac1-8340-99cdf4c75bb7@app.fastmail.com>

On Wed, Oct 12, 2022 at 11:29 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Thu, Oct 13, 2022, at 12:08 AM, Michael S. Tsirkin wrote:
> >
> > Do these two boxes even have pci?
>
> Footbridge/netwinder has PCI and PC-style ISA on-board devices
> (floppy, ps2 mouse/keyboard, parport, soundblaster, ...), RiscPC
> has neither.

It's worth noting that changing a driver that does

        if (dev->irq == NO_IRQ)
                return -ENODEV;

to use

        if (!dev->irq)
                return -ENODEV;

should be pretty much always fine.

Even *if* that driver is then compiled and used on an architecture
where NO_IRQ is one of the odd values, you end up having only two
cases

 (a) irq 0 was actually a valid irq after all

 (b) you just get the error later when actually trying to use the odd
NO_IRQ interrupt with request_irq() and friends

and here (a) basically never happens - certainly not for any PCI setup
- and (b) is harmless unless the driver was already terminally broken
anyway.

The one exception for (a) might be some platform irq code. On x86,
that would be the legacy timer interrupt, of course.

So if some odd platform actually has a "real" interrupt on irq0, that
platform should either just fix the irq number mapping, or should
consider that interrupt to be a platform-specific thing and handle it
very very specially.

On x86, for example, we do

        if (request_irq(0, timer_interrupt, flags, "timer", NULL))

early in boot, and that's basically what then makes sure that no
driver can get that irq. It's done through the platform "timer_init"
code at the "late_time_init()" call.

(And that "late_time_init()" - despite the name - isn't very late at
all. It's just later than the very early timekeeping init - after
interrupts have been enabled at all.

             Linus

      reply	other threads:[~2022-10-13 17:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 17:20 [GIT PULL] virtio: fixes, features Michael S. Tsirkin
2022-10-10 21:23 ` pr-tracker-bot
2022-10-12  6:21 ` Michael Ellerman
2022-10-12  6:45   ` Angus Chen
2022-10-12  7:35   ` Angus Chen
2022-10-12 11:11   ` Michael S. Tsirkin
2022-10-12 13:28     ` Michael Ellerman
2022-10-12 14:33       ` Michael Ellerman
2022-10-12 15:51         ` Michael S. Tsirkin
2022-10-12 17:22           ` Linus Torvalds
2022-10-12 21:06             ` Arnd Bergmann
2022-10-12 22:08               ` Michael S. Tsirkin
2022-10-13  6:28                 ` Arnd Bergmann
2022-10-13 17:19                   ` Linus Torvalds [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='CAHk-=whLv3MO0Tvc62zJ+=4yvSfKMK17C0wfpbXBwUJqSjKbYA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=alvaro.karsz@solid-run.com \
    --cc=angus.chen@jaguarmicro.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=gavinl@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lingshan.zhu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wangdeming@inspur.com \
    --cc=xiujianfeng@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).