* [RESEND PATCH] ACPI/IORT: Fix rc_dma_get_range()
@ 2019-01-10 18:41 Lorenzo Pieralisi
2019-01-11 10:03 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Pieralisi @ 2019-01-10 18:41 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Rafael J. Wysocki, Lorenzo Pieralisi, Eric Auger,
Jean-Philippe Brucker, Catalin Marinas, Will Deacon, linux-acpi,
Hanjun Guo, Sudeep Holla, Robin Murphy
From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
When executed for a PCI_ROOT_COMPLEX type, iort_match_node_callback()
expects the opaque pointer argument to be a PCI bus device. At the
moment rc_dma_get_range() passes the PCI endpoint instead of the bus,
and we've been lucky to have pci_domain_nr(ptr) return 0 instead of
crashing. Pass the bus device to iort_scan_node().
Fixes: 5ac65e8c8941 ("ACPI/IORT: Support address size limit for root complexes")
Reported-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Cc: stable@vger.kernel.org
Cc: Will Deacon <will.deacon@arm.com>
Cc: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
---
Will, Catalin,
resending a reformatted version of this fix previously posted in [1],
please merge it for one of the upcoming -rc.
Thanks,
Lorenzo
[1] https://marc.info/?l=linux-acpi&m=154712742324811&w=2
drivers/acpi/arm64/iort.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index fdd90ffceb85..c08afe44c488 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -952,9 +952,10 @@ static int rc_dma_get_range(struct device *dev, u64 *size)
{
struct acpi_iort_node *node;
struct acpi_iort_root_complex *rc;
+ struct pci_bus *pbus = to_pci_dev(dev)->bus;
node = iort_scan_node(ACPI_IORT_NODE_PCI_ROOT_COMPLEX,
- iort_match_node_callback, dev);
+ iort_match_node_callback, &pbus->dev);
if (!node || node->revision < 1)
return -ENODEV;
--
2.19.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [RESEND PATCH] ACPI/IORT: Fix rc_dma_get_range()
2019-01-10 18:41 [RESEND PATCH] ACPI/IORT: Fix rc_dma_get_range() Lorenzo Pieralisi
@ 2019-01-11 10:03 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2019-01-11 10:03 UTC (permalink / raw)
To: Lorenzo Pieralisi
Cc: Eric Auger, Jean-Philippe Brucker, Catalin Marinas,
Rafael J. Wysocki, linux-acpi, Hanjun Guo, Sudeep Holla,
Robin Murphy, linux-arm-kernel
On Thu, Jan 10, 2019 at 06:41:51PM +0000, Lorenzo Pieralisi wrote:
> From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
>
> When executed for a PCI_ROOT_COMPLEX type, iort_match_node_callback()
> expects the opaque pointer argument to be a PCI bus device. At the
> moment rc_dma_get_range() passes the PCI endpoint instead of the bus,
> and we've been lucky to have pci_domain_nr(ptr) return 0 instead of
> crashing. Pass the bus device to iort_scan_node().
>
> Fixes: 5ac65e8c8941 ("ACPI/IORT: Support address size limit for root complexes")
> Reported-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Acked-by: Robin Murphy <robin.murphy@arm.com>
> Cc: stable@vger.kernel.org
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Hanjun Guo <hanjun.guo@linaro.org>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> ---
> Will, Catalin,
>
> resending a reformatted version of this fix previously posted in [1],
> please merge it for one of the upcoming -rc.
Thanks, I'll push this out later today.
Will
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-11 10:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-10 18:41 [RESEND PATCH] ACPI/IORT: Fix rc_dma_get_range() Lorenzo Pieralisi
2019-01-11 10:03 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).