Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1258223

Re: [PATCH] of/fdt: fix error checking for earlycon address

From Peter Hurley <peter@hurleysoftware.com>
Newsgroups linux.kernel
Subject Re: [PATCH] of/fdt: fix error checking for earlycon address
Date 2015-10-28 16:00 +0100
Message-ID <qoAmK-3WD-31@gated-at.bofh.it> (permalink)
References <qmJ18-lc-21@gated-at.bofh.it> <qmKqe-2uc-11@gated-at.bofh.it> <qojlU-1pk-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 10/27/2015 04:46 PM, Rob Herring wrote:
> On Fri, Oct 23, 2015 at 8:15 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
>> Hi Masahiro,
>>
>> On 10/23/2015 07:47 AM, Masahiro Yamada wrote:
>>> fdt_translate_address() returns OF_BAD_ADDR on error.  It is defined as
>>> a u64 value, so the variable "addr" should be defined as u64 as well.
>>
>> Good catch.
>>
>> I would prefer if fdt_translate_address() returned resource_size_t (which
>> is the proper type for handling addresses as integers) and that type
>> was propagated through early_init_dt_scan_chosen_serial => of_setup_earlycon.
> 
> That can be problematic in the DT code. The size of resource_size_t
> can vary on 32-bit as it is based on phys_addr_t which in turn is
> based on CONFIG_LPAE setting. However, the address sizes in DT are
> fixed and may be 64-bit. So we stick with u64 in the DT code.

I think I see your point about fdt_translate_address(); you want it to
mirror of_translate_address(), yes?  If so, then I have no objection
to this patch and will mark it reviewed.

But the u64 value from fdt_translate_address() should be preserved
at least to the ioremap()/set_fixmap() in earlycon_map() .
I could roll that change into my earlycon series that moves
fdt_translate_address() into of_setup_earlycon(), thus preserving
the u64 value until it's assigned to a phys_addr_t.

Regards,
Peter Hurley
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] of/fdt: fix error checking for earlycon address Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-10-23 13:50 +0200
  Re: [PATCH] of/fdt: fix error checking for earlycon address Peter Hurley <peter@hurleysoftware.com> - 2015-10-23 15:20 +0200
    Re: [PATCH] of/fdt: fix error checking for earlycon address Rob Herring <robh@kernel.org> - 2015-10-27 21:50 +0100
      Re: [PATCH] of/fdt: fix error checking for earlycon address Peter Hurley <peter@hurleysoftware.com> - 2015-10-28 16:00 +0100
  Re: [PATCH] of/fdt: fix error checking for earlycon address Rob Herring <robh@kernel.org> - 2015-10-29 05:10 +0100

csiph-web