diff options
author | Roman Kisel <romank@linux.microsoft.com> | 2025-04-28 14:07:39 -0700 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2025-05-23 16:30:55 +0000 |
commit | 1dc5df133b98eca75d079e4485ade6b601cadf59 (patch) | |
tree | 4335f10f8bcea4f8079ac525143715d7adadcfc5 | |
parent | 23aa0c355921a39111f1646ef6592da20af9394c (diff) |
Drivers: hv: vmbus: Get the IRQ number from DeviceTree
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 <romank@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20250428210742.435282-9-romank@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20250428210742.435282-9-romank@linux.microsoft.com>
-rw-r--r-- | drivers/hv/vmbus_drv.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index e3d51a316316..d24fdb3d8f14 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -2465,6 +2465,31 @@ static int vmbus_acpi_add(struct platform_device *pdev) } #endif +static int vmbus_set_irq(struct platform_device *pdev) +{ + struct irq_data *data; + int irq; + irq_hw_number_t hwirq; + + irq = platform_get_irq(pdev, 0); + /* platform_get_irq() may not return 0. */ + if (irq < 0) + return irq; + + data = irq_get_irq_data(irq); + if (!data) { + pr_err("No interrupt data for VMBus virq %d\n", irq); + return -ENODEV; + } + hwirq = irqd_to_hwirq(data); + + vmbus_irq = irq; + vmbus_interrupt = hwirq; + pr_debug("VMBus virq %d, hwirq %d\n", vmbus_irq, vmbus_interrupt); + + return 0; +} + static int vmbus_device_add(struct platform_device *pdev) { struct resource **cur_res = &hyperv_mmio; @@ -2479,6 +2504,11 @@ static int vmbus_device_add(struct platform_device *pdev) if (ret) return ret; + if (!__is_defined(HYPERVISOR_CALLBACK_VECTOR)) + ret = vmbus_set_irq(pdev); + if (ret) + return ret; + for_each_of_range(&parser, &range) { struct resource *res; |