linux-stable/drivers/virtio
Michael S. Tsirkin 2145ab513e virtio_pci: use irq to detect interrupt support
commit 71491c54ea ("virtio_pci: don't try to use intxif pin is zero")
breaks virtio_pci on powerpc, when running as a qemu guest.

vp_find_vqs() bails out because pci_dev->pin == 0.

But pci_dev->irq is populated correctly, so vp_find_vqs_intx() would
succeed if we called it - which is what the code used to do.

This seems to happen because pci_dev->pin is not populated in
pci_assign_irq(). A PCI core bug? Maybe.

However Linus said:
	I really think that that is basically the only time you should use
	that 'pci_dev->pin' thing: it basically exists not for "does this
	device have an IRQ", but for "what is the routing of this irq on this
	device".

and
	The correct way to check for "no irq" doesn't use NO_IRQ at all, it just does
		if (dev->irq) ...

so let's just check irq and be done with it.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Fixes: 71491c54ea ("virtio_pci: don't try to use intxif pin is zero")
Cc: "Angus Chen" <angus.chen@jaguarmicro.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20221012220312.308522-1-mst@redhat.com>
2022-10-13 09:33:03 -04:00
..
Kconfig virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
Makefile virtio: replace restricted mem access flag with callback 2022-08-01 07:42:49 +02:00
virtio.c virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
virtio_anchor.c virtio: replace restricted mem access flag with callback 2022-08-01 07:42:49 +02:00
virtio_balloon.c - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
virtio_dma_buf.c dma-buf: move dma-buf symbols into the DMA_BUF module namespace 2021-10-25 14:53:08 +02:00
virtio_input.c virtio: wrap config->reset calls 2022-01-14 18:50:52 -05:00
virtio_mem.c mm: use is_zone_movable_page() helper 2022-07-29 18:07:20 -07:00
virtio_mmio.c virtio: Revert "virtio: find_vqs() add arg sizes" 2022-08-16 01:40:24 -04:00
virtio_pci_common.c virtio_pci: use irq to detect interrupt support 2022-10-13 09:33:03 -04:00
virtio_pci_common.h virtio: Revert "virtio: find_vqs() add arg sizes" 2022-08-16 01:40:24 -04:00
virtio_pci_legacy.c virtio_pci: Revert "virtio_pci: support the arg sizes of find_vqs()" 2022-08-16 01:38:29 -04:00
virtio_pci_legacy_dev.c virtio/virtio_pci_legacy_dev: ensure the correct return value 2022-01-14 18:50:53 -05:00
virtio_pci_modern.c virtio: Revert "virtio: find_vqs() add arg sizes" 2022-08-16 01:40:24 -04:00
virtio_pci_modern_dev.c virtio_pci: introduce helper to get/set queue reset 2022-08-11 04:06:40 -04:00
virtio_ring.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
virtio_vdpa.c virtio: Revert "virtio: find_vqs() add arg sizes" 2022-08-16 01:40:24 -04:00