Skip to content

Commit 1dc5df1

Browse files
romank-msftliuw
authored andcommitted
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>
1 parent 23aa0c3 commit 1dc5df1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

drivers/hv/vmbus_drv.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,6 +2465,31 @@ static int vmbus_acpi_add(struct platform_device *pdev)
24652465
}
24662466
#endif
24672467

2468+
static int vmbus_set_irq(struct platform_device *pdev)
2469+
{
2470+
struct irq_data *data;
2471+
int irq;
2472+
irq_hw_number_t hwirq;
2473+
2474+
irq = platform_get_irq(pdev, 0);
2475+
/* platform_get_irq() may not return 0. */
2476+
if (irq < 0)
2477+
return irq;
2478+
2479+
data = irq_get_irq_data(irq);
2480+
if (!data) {
2481+
pr_err("No interrupt data for VMBus virq %d\n", irq);
2482+
return -ENODEV;
2483+
}
2484+
hwirq = irqd_to_hwirq(data);
2485+
2486+
vmbus_irq = irq;
2487+
vmbus_interrupt = hwirq;
2488+
pr_debug("VMBus virq %d, hwirq %d\n", vmbus_irq, vmbus_interrupt);
2489+
2490+
return 0;
2491+
}
2492+
24682493
static int vmbus_device_add(struct platform_device *pdev)
24692494
{
24702495
struct resource **cur_res = &hyperv_mmio;
@@ -2479,6 +2504,11 @@ static int vmbus_device_add(struct platform_device *pdev)
24792504
if (ret)
24802505
return ret;
24812506

2507+
if (!__is_defined(HYPERVISOR_CALLBACK_VECTOR))
2508+
ret = vmbus_set_irq(pdev);
2509+
if (ret)
2510+
return ret;
2511+
24822512
for_each_of_range(&parser, &range) {
24832513
struct resource *res;
24842514

0 commit comments

Comments
 (0)