Skip to content

Commit 467a3bb

Browse files
author
Marc Zyngier
committed
PCI: hv: Allocate a named fwnode instead of an address-based one
To allocate its fwnode that is then used to allocate an irqdomain, the driver uses irq_domain_alloc_fwnode(), passing it a VA as an identifier. This is a rather bad idea, as this address ends up published in debugfs (and we want to move away from VAs there anyway). Instead, let's allocate a named fwnode by using the device GUID as an identifier. It is allegedly unique, and can be traced back to the original device. Acked-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent daa19fe commit 467a3bb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/pci/controller/pci-hyperv.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2521,6 +2521,7 @@ static int hv_pci_probe(struct hv_device *hdev,
25212521
const struct hv_vmbus_device_id *dev_id)
25222522
{
25232523
struct hv_pcibus_device *hbus;
2524+
char *name;
25242525
int ret;
25252526

25262527
/*
@@ -2589,7 +2590,14 @@ static int hv_pci_probe(struct hv_device *hdev,
25892590
goto free_config;
25902591
}
25912592

2592-
hbus->sysdata.fwnode = irq_domain_alloc_fwnode(hbus);
2593+
name = kasprintf(GFP_KERNEL, "%pUL", &hdev->dev_instance);
2594+
if (!name) {
2595+
ret = -ENOMEM;
2596+
goto unmap;
2597+
}
2598+
2599+
hbus->sysdata.fwnode = irq_domain_alloc_named_fwnode(name);
2600+
kfree(name);
25932601
if (!hbus->sysdata.fwnode) {
25942602
ret = -ENOMEM;
25952603
goto unmap;

0 commit comments

Comments
 (0)