Linux-Renesas-SoC Archive on lore.kernel.org
 help / color / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Frank Rowand <frowand.list@gmail.com>,
	"open list:MEDIA DRIVERS FOR RENESAS - FCP" 
	<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH V2] of: Fix of_empty_ranges_quirk()
Date: Sat, 14 Sep 2019 18:00:21 +0200
Message-ID: <d490a735-32f2-5aa4-4782-81c8c2522337@gmail.com> (raw)
In-Reply-To: <CAL_JsqJk40bRhvrtjtpCzhm_jTX=D5pEgWHd8csrVDn77nwWvQ@mail.gmail.com>

On 9/9/19 7:37 PM, Rob Herring wrote:
[...]
>>  drivers/of/address.c | 47 ++++++++++++++++++++++++--------------------
>>  1 file changed, 26 insertions(+), 21 deletions(-)
>>
>> diff --git a/drivers/of/address.c b/drivers/of/address.c
>> index 978427a9d5e6..df82ef88823f 100644
>> --- a/drivers/of/address.c
>> +++ b/drivers/of/address.c
>> @@ -473,21 +473,42 @@ static struct of_bus *of_match_bus(struct device_node *np)
>>         return NULL;
>>  }
>>
>> -static int of_empty_ranges_quirk(struct device_node *np)
>> +static bool of_missing_ranges_is_ok(struct device_node *np)
>>  {
>> +       /*
>> +        * Normally, an absence of a "ranges" property means we are
>> +        * crossing a non-translatable boundary, and thus the addresses
>> +        * below the current cannot be converted to CPU physical ones.
>> +        * Unfortunately, while this is very clear in the spec, it's not
>> +        * what Apple understood, and they do have things like /uni-n or
>> +        * /ht nodes with no "ranges" property and a lot of perfectly
>> +        * useable mapped devices below them. Thus we treat the absence of
>> +        * "ranges" as equivalent to an empty "ranges" property which means
>> +        * a 1:1 translation at that level. It's up to the caller not to try
>> +        * to translate addresses that aren't supposed to be translated in
>> +        * the first place. --BenH.
>> +        *
>> +        * As far as we know, this damage only exists on Apple machines, so
>> +        * This code is only enabled on powerpc.
> 
> You dropped Grant's name on this. Wouldn't matter too much as we can
> run 'git blame', but now we have another level to trace back thru.

I think that's what Frank suggested, since he reworded this message before.

>> +        */
>> +
>>         if (IS_ENABLED(CONFIG_PPC)) {
>>                 /* To save cycles, we cache the result for global "Mac" setting */
>> -               static int quirk_state = -1;
>> +               static int quirk_state_initialized;
> 
> This can be bool too.

Fine

[...]

-- 
Best regards,
Marek Vasut

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-07 16:15 marek.vasut
2019-09-09 17:37 ` Rob Herring
2019-09-14 16:00   ` Marek Vasut [this message]
2019-09-13 15:29 ` Rob Herring
2019-09-14 16:05   ` Marek Vasut

Reply instructions:

You may reply publically 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=d490a735-32f2-5aa4-4782-81c8c2522337@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=robh+dt@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

Linux-Renesas-SoC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-renesas-soc/0 linux-renesas-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-renesas-soc linux-renesas-soc/ https://lore.kernel.org/linux-renesas-soc \
		linux-renesas-soc@vger.kernel.org linux-renesas-soc@archiver.kernel.org
	public-inbox-index linux-renesas-soc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-renesas-soc


AGPL code for this site: git clone https://public-inbox.org/ public-inbox