All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: catalin.marinas@arm.com, will@kernel.org, robin.murphy@arm.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: iort: take _DMA methods into account for named components
Date: Mon, 20 Apr 2020 09:40:51 +0100	[thread overview]
Message-ID: <20200420084051.GA12852@red-moon.cambridge.arm.com> (raw)
In-Reply-To: <20200404073047.17898-1-ardb@kernel.org>

On Sat, Apr 04, 2020 at 09:30:47AM +0200, Ard Biesheuvel wrote:
> Where IORT nodes for named components can describe simple DMA limits
> expressed as the number of address bits a device can driver, _DMA methods
> in AML can express more complex topologies, involving DMA translation in
> particular.
> 
> Currently, we only take this _DMA method into account if it appears on a
> ACPI device node describing a PCIe root complex, but it is perfectly
> acceptable to attach them to named components as well, so let's ensure
> we take them into account in those cases too.
> 
> Reported-by: Andrei Warkentin <awarkentin@vmware.com>
> Fixes: 7ad4263980826e8b ("ACPI: Make acpi_dma_configure() DMA regions aware")
> Cc: <stable@vger.kernel.org> # v4.14+
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
>  drivers/acpi/arm64/iort.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)

Only question is whether there is FW in the field with _DMA methods that
now we would start parsing (and hopefully everything will still work)
but for that the only choice is applying this patch and see, so:

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index ed3d2d1a7ae9..07eb78baf198 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -1146,13 +1146,10 @@ void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size)
>  	else
>  		size = 1ULL << 32;
>  
> -	if (dev_is_pci(dev)) {
> -		ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size);
> -		if (ret == -ENODEV)
> -			ret = rc_dma_get_range(dev, &size);
> -	} else {
> -		ret = nc_dma_get_range(dev, &size);
> -	}
> +	ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size);
> +	if (ret == -ENODEV)
> +		ret = dev_is_pci(dev) ? rc_dma_get_range(dev, &size)
> +				      : nc_dma_get_range(dev, &size);
>  
>  	if (!ret) {
>  		/*
> -- 
> 2.17.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-04-20  8:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04  7:30 [PATCH] arm64: iort: take _DMA methods into account for named components Ard Biesheuvel
2020-04-06 11:04 ` Lorenzo Pieralisi
2020-04-06 11:16   ` Ard Biesheuvel
2020-04-06 11:32     ` Lorenzo Pieralisi
2020-04-06 11:59       ` Ard Biesheuvel
2020-04-06 13:14         ` Lorenzo Pieralisi
2020-04-06 13:19           ` Ard Biesheuvel
2020-04-19 12:21             ` Ard Biesheuvel
2020-04-20  8:40 ` Lorenzo Pieralisi [this message]
2020-04-20  8:58   ` Ard Biesheuvel
2020-04-20  9:13     ` Lorenzo Pieralisi
2020-04-20  9:14       ` Ard Biesheuvel
2020-04-28 17:01         ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200420084051.GA12852@red-moon.cambridge.arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.