From: Sascha Hauer <sha@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] of: address: treat absent dma-ranges as 1:1 translation
Date: Thu, 19 May 2022 13:56:08 +0200 [thread overview]
Message-ID: <20220519115608.GW25578@pengutronix.de> (raw)
In-Reply-To: <20220518175745.56467-1-l.stach@pengutronix.de>
On Wed, May 18, 2022 at 07:57:45PM +0200, Lucas Stach wrote:
> Some DTs use dma-ranges in child busses without this property being present
> in the parent bus. To avoid failing the address translation, do the same as
> the Linux kernel and treat absence of this property as a 1:1 translation.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
> drivers/of/address.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/of/address.c b/drivers/of/address.c
> index 67e8062f5d17..4eafce376d36 100644
> --- a/drivers/of/address.c
> +++ b/drivers/of/address.c
> @@ -301,10 +301,13 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
> *
> * As far as we know, this damage only exists on Apple machines, so
> * This code is only enabled on powerpc. --gcl
> + *
> + * This quirk also applies for 'dma-ranges' which frequently exist in
> + * child nodes without 'dma-ranges' in the parent nodes. --RobH
> */
> ranges = of_get_property(parent, rprop, &rlen);
> #if !defined(CONFIG_PPC)
> - if (ranges == NULL) {
> + if (ranges == NULL && strcmp(rprop, "dma-ranges")) {
> pr_vdebug("OF: no ranges; cannot translate\n");
> return 1;
> }
> --
> 2.35.3
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2022-05-19 11:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 17:57 Lucas Stach
2022-05-19 11:56 ` Sascha Hauer [this message]
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=20220519115608.GW25578@pengutronix.de \
--to=sha@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=l.stach@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox