summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/vector_kern.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2020-12-02 12:59:50 +0100
committerRichard Weinberger <richard@nod.at>2020-12-13 22:22:08 +0100
commit36d46a5907ba170965307c9d106cc35517acbf33 (patch)
tree35b1748a7ab1981f00903874a34d68b9977aee60 /arch/um/drivers/vector_kern.c
parentd66c91836b8d7df3b6f0fe7f0c7617d28ebfcb4c (diff)
downloadlinux-stable-36d46a5907ba170965307c9d106cc35517acbf33.tar.gz
linux-stable-36d46a5907ba170965307c9d106cc35517acbf33.tar.bz2
linux-stable-36d46a5907ba170965307c9d106cc35517acbf33.zip
um: Support dynamic IRQ allocation
It's cumbersome and error-prone to keep adding fixed IRQ numbers, and for proper device wakeup support for the virtio/vhost-user support we need to have different IRQs for each device. Even if in theory two IRQs (with and without wake) might be sufficient, it's much easier to reason about it when we have dynamic number assignment. It also makes it easier to add new devices that may dynamically exist or depending on the configuration, etc. Add support for this, up to 64 IRQs (the same limit as epoll FDs we have right now). Since it's not easy to port all the existing places to dynamic allocation (some data is statically initialized) keep the low numbers are reserved for the existing hard-coded IRQ numbers. Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers/vector_kern.c')
-rw-r--r--arch/um/drivers/vector_kern.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index aa6ba9d61e9b..47a02e60898d 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1271,7 +1271,7 @@ static int vector_net_open(struct net_device *dev)
irq_rr + VECTOR_BASE_IRQ, vp->fds->rx_fd,
IRQ_READ, vector_rx_interrupt,
IRQF_SHARED, dev->name, dev);
- if (err != 0) {
+ if (err < 0) {
netdev_err(dev, "vector_open: failed to get rx irq(%d)\n", err);
err = -ENETUNREACH;
goto out_close;
@@ -1286,7 +1286,7 @@ static int vector_net_open(struct net_device *dev)
irq_rr + VECTOR_BASE_IRQ, vp->fds->tx_fd,
IRQ_WRITE, vector_tx_interrupt,
IRQF_SHARED, dev->name, dev);
- if (err != 0) {
+ if (err < 0) {
netdev_err(dev,
"vector_open: failed to get tx irq(%d)\n", err);
err = -ENETUNREACH;