From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org, Marcel Apfelbaum <marcel.a@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] pci: Don't call pci_irq_handler() for a negative intx
Date: Sun, 05 Jul 2015 18:03:13 +1000 [thread overview]
Message-ID: <1436083393.3948.52.camel@kernel.crashing.org> (raw)
In-Reply-To: <20150705084150-mutt-send-email-mst@redhat.com>
On Sun, 2015-07-05 at 09:03 +0200, Michael S. Tsirkin wrote:
> On Sun, Jul 05, 2015 at 09:28:28AM +1000, Benjamin Herrenschmidt wrote:
> > Under some circumstances, pci_intx() can return -1 (when the interrupt
> > pin in the config space is 0 which normally means no interrupt).
> >
> > I have seen cases of pci_set_irq() being called on such devices, in
> > turn causing pci_irq_handler() to be called with "-1" as an argument
> > which doesn't seem like a terribly good idea.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> Isn't this a device bug though?
Possibly, I can try to dig a bit more see if I can reproduce and find
out who is causing it.
> I did a grep over all callers of pci_set_irq and didn't
> find any that fails to set an interrupt pin.
>
> So how about an assert instead?
>
> And maybe stick it in pci_intx to make sure all callers
> get checked.
Ok, It's also possible that this doesn't happen anymore, I've carried
that patch for monthes and rebased several times on top of newer qemu's.
I *think* it might have been something that happens due to some generic
code initializations, something like pci_update_irq_disabled() in
pci_default_write_config()... I'll dbl check.
Cheers,
Ben.
next prev parent reply other threads:[~2015-07-05 8:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-04 23:28 [Qemu-devel] [PATCH] pci: Don't call pci_irq_handler() for a negative intx Benjamin Herrenschmidt
2015-07-05 7:03 ` Michael S. Tsirkin
2015-07-05 8:03 ` Benjamin Herrenschmidt [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-04-12 7:12 Cédric Le Goater
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=1436083393.3948.52.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=marcel.a@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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 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.