Thread (51 messages) 51 messages, 8 authors, 2025-03-13

Re: [PATCH hyperv-next v5 08/11] Drivers: hv: vmbus: Get the IRQ number from DeviceTree

From: Rob Herring <robh@kernel.org>
Date: 2025-03-13 18:44:54
Also in: kvmarm, linux-acpi, linux-arch, linux-devicetree, linux-hyperv, linux-pci, lkml

On Fri, Mar 7, 2025 at 4:03 PM Roman Kisel [off-list ref] wrote:
quoted hunk ↗ jump to hunk
The VMBus driver uses ACPI for interrupt assignment on
arm64 hence it won't function in the VTL mode where only
DeviceTree can be used.

Update the VMBus driver to discover interrupt configuration
from DT.

Signed-off-by: Roman Kisel <redacted>
Reviewed-by: Michael Kelley <redacted>
---
 drivers/hv/vmbus_drv.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 75eb1390b45c..c8474b48dcd2 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -2345,6 +2345,36 @@ static int vmbus_acpi_add(struct platform_device *pdev)
 }
 #endif

+static int __maybe_unused vmbus_set_irq(struct platform_device *pdev)
+{
+       struct irq_data *data;
+       int irq;
+       irq_hw_number_t hwirq;
+
+       irq = platform_get_irq(pdev, 0);
+       if (irq == 0) {
+               pr_err("VMBus interrupt mapping failure\n");
+               return -EINVAL;
+       }
+       if (irq < 0) {
+               pr_err("VMBus interrupt data can't be read from DeviceTree, error %d\n", irq);
+               return irq;
+       }
I don't think why you couldn't get the interrupt is important. Just
check for (irq <= 0) and be done with it. I'm not even sure if
returning 0 is possible now. There's a long history to that and
NO_IRQ.

Rob
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help