diff options
author | Marc Zyngier <maz@kernel.org> | 2019-08-06 10:23:33 -0400 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2019-08-07 09:24:49 -0400 |
commit | 467a3bb974320a23c0c000559cc54b64e06e9787 (patch) | |
tree | ac6640a5db2588d17a83e620f76e0e5ef06f71c3 /drivers/pci/controller/pci-hyperv.c | |
parent | daa19fe5b082779962988a5ba9e38509004db3de (diff) |
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 <tglx@linutronix.de>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'drivers/pci/controller/pci-hyperv.c')
-rw-r--r-- | drivers/pci/controller/pci-hyperv.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 40b625458afa..97056f3dd317 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c | |||
@@ -2521,6 +2521,7 @@ static int hv_pci_probe(struct hv_device *hdev, | |||
2521 | const struct hv_vmbus_device_id *dev_id) | 2521 | const struct hv_vmbus_device_id *dev_id) |
2522 | { | 2522 | { |
2523 | struct hv_pcibus_device *hbus; | 2523 | struct hv_pcibus_device *hbus; |
2524 | char *name; | ||
2524 | int ret; | 2525 | int ret; |
2525 | 2526 | ||
2526 | /* | 2527 | /* |
@@ -2589,7 +2590,14 @@ static int hv_pci_probe(struct hv_device *hdev, | |||
2589 | goto free_config; | 2590 | goto free_config; |
2590 | } | 2591 | } |
2591 | 2592 | ||
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); | ||
2593 | if (!hbus->sysdata.fwnode) { | 2601 | if (!hbus->sysdata.fwnode) { |
2594 | ret = -ENOMEM; | 2602 | ret = -ENOMEM; |
2595 | goto unmap; | 2603 | goto unmap; |