[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dce13cf7-2be6-e51e-974c-3c87b0190618@kernel.org>
Date: Wed, 7 Aug 2019 14:02:06 +0100
From: Marc Zyngier <maz@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Linus Walleij <linusw@...nel.org>, Imre Kaloz <kaloz@...nwrt.org>,
Krzysztof Halasa <khalasa@...p.pl>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Sasha Levin <sashal@...nel.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/8] PCI: hv: Allocate a named fwnode instead of an
address-based one
On 06/08/2019 15:57, Marc Zyngier wrote:
> 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.
>
> Signed-off-by: Marc Zyngier <maz@...nel.org>
> ---
> drivers/pci/controller/pci-hyperv.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index 40b625458afa..f6ed2583167a 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,
> const struct hv_vmbus_device_id *dev_id)
> {
> struct hv_pcibus_device *hbus;
> + char *name;
> int ret;
>
> /*
> @@ -2589,7 +2590,14 @@ static int hv_pci_probe(struct hv_device *hdev,
> goto free_config;
> }
>
> - hbus->sysdata.fwnode = irq_domain_alloc_fwnode(hbus);
> + name = kasprintf("%pUL", &hdev->dev_instance);
Of course, this is bogus. It needs a GFP_KERNEL as the first parameter.
/me adds HYPERV to .config, and fixes it locally.
M.
--
Jazz is not dead, it just smells funny...
Powered by blists - more mailing lists