All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] lib: fdtdec: Couple of fies
@ 2018-12-21 16:24 Keerthy
  2018-12-21 16:24 ` [U-Boot] [PATCH 1/2] lib: fdtdec: fdtdec_get_addr_size_fixed remove checks Keerthy
  2018-12-21 16:24 ` [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size Keerthy
  0 siblings, 2 replies; 12+ messages in thread
From: Keerthy @ 2018-12-21 16:24 UTC (permalink / raw)
  To: u-boot

Couple of fixes for fdtdec_get_addr_size and fdtdec_get_addr_size_fixed
functions.

Keerthy (2):
  lib: fdtdec: fdtdec_get_addr_size_fixed remove checks
  lib: fdtdec: fixup fdtdec_get_addr_size

 lib/fdtdec.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 1/2] lib: fdtdec: fdtdec_get_addr_size_fixed remove checks
  2018-12-21 16:24 [U-Boot] [PATCH 0/2] lib: fdtdec: Couple of fies Keerthy
@ 2018-12-21 16:24 ` Keerthy
  2018-12-21 21:16   ` Simon Glass
  2019-01-03 18:14   ` sjg at google.com
  2018-12-21 16:24 ` [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size Keerthy
  1 sibling, 2 replies; 12+ messages in thread
From: Keerthy @ 2018-12-21 16:24 UTC (permalink / raw)
  To: u-boot

With 8 bytes addressing even on 32 bit machines these checks
are no longer valid. Remove them.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 lib/fdtdec.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 6f8ec0d..18663ce 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -95,16 +95,6 @@ fdt_addr_t fdtdec_get_addr_size_fixed(const void *blob, int node,
 
 	debug("%s: %s: ", __func__, prop_name);
 
-	if (na > (sizeof(fdt_addr_t) / sizeof(fdt32_t))) {
-		debug("(na too large for fdt_addr_t type)\n");
-		return FDT_ADDR_T_NONE;
-	}
-
-	if (ns > (sizeof(fdt_size_t) / sizeof(fdt32_t))) {
-		debug("(ns too large for fdt_size_t type)\n");
-		return FDT_ADDR_T_NONE;
-	}
-
 	prop = fdt_getprop(blob, node, prop_name, &len);
 	if (!prop) {
 		debug("(not found)\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size
  2018-12-21 16:24 [U-Boot] [PATCH 0/2] lib: fdtdec: Couple of fies Keerthy
  2018-12-21 16:24 ` [U-Boot] [PATCH 1/2] lib: fdtdec: fdtdec_get_addr_size_fixed remove checks Keerthy
@ 2018-12-21 16:24 ` Keerthy
  2018-12-21 21:16   ` Simon Glass
                     ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Keerthy @ 2018-12-21 16:24 UTC (permalink / raw)
  To: u-boot

fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
so that the address cells and size cells are obtained from the
parent instead of going by the fixed length.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 lib/fdtdec.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 18663ce..11a30e1 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -178,11 +178,8 @@ fdt_addr_t fdtdec_get_addr_size_auto_noparent(const void *blob, int node,
 fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
 				const char *prop_name, fdt_size_t *sizep)
 {
-	int ns = sizep ? (sizeof(fdt_size_t) / sizeof(fdt32_t)) : 0;
-
-	return fdtdec_get_addr_size_fixed(blob, node, prop_name, 0,
-					  sizeof(fdt_addr_t) / sizeof(fdt32_t),
-					  ns, sizep, false);
+	return fdtdec_get_addr_size_auto_noparent(blob, node, prop_name, 0,
+						  sizep, false);
 }
 
 fdt_addr_t fdtdec_get_addr(const void *blob, int node, const char *prop_name)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 1/2] lib: fdtdec: fdtdec_get_addr_size_fixed remove checks
  2018-12-21 16:24 ` [U-Boot] [PATCH 1/2] lib: fdtdec: fdtdec_get_addr_size_fixed remove checks Keerthy
@ 2018-12-21 21:16   ` Simon Glass
  2019-01-03 18:14   ` sjg at google.com
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Glass @ 2018-12-21 21:16 UTC (permalink / raw)
  To: u-boot

On Fri, 21 Dec 2018 at 09:24, Keerthy <j-keerthy@ti.com> wrote:
>
> With 8 bytes addressing even on 32 bit machines these checks
> are no longer valid. Remove them.
>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  lib/fdtdec.c | 10 ----------
>  1 file changed, 10 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size
  2018-12-21 16:24 ` [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size Keerthy
@ 2018-12-21 21:16   ` Simon Glass
  2019-01-02 16:33   ` Stephen Warren
  2019-01-03 18:14   ` sjg at google.com
  2 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2018-12-21 21:16 UTC (permalink / raw)
  To: u-boot

+Stephen

Hi Keethy,

On Fri, 21 Dec 2018 at 09:24, Keerthy <j-keerthy@ti.com> wrote:
>
> fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
> so that the address cells and size cells are obtained from the
> parent instead of going by the fixed length.

Why? Can you please expand this?

cc Stephen too.

Reviewed-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size
  2018-12-21 16:24 ` [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size Keerthy
  2018-12-21 21:16   ` Simon Glass
@ 2019-01-02 16:33   ` Stephen Warren
  2019-01-03 18:14   ` sjg at google.com
  2 siblings, 0 replies; 12+ messages in thread
From: Stephen Warren @ 2019-01-02 16:33 UTC (permalink / raw)
  To: u-boot

On 12/21/18 9:24 AM, Keerthy wrote:
> fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
> so that the address cells and size cells are obtained from the
> parent instead of going by the fixed length.

This patch makes perfect sense to me. However, I am worried about the 
potential existence of code that assumes the current fixed-size logic; 
in the past when fixing similar issues like this we've often run into 
code that was use "get addr" functions when it should have been using 
"get u32" functions and similar, which then broke when we fixed the 
implementation to do the right thing. I guess we should still apply the 
patch, and fix up any fallout as it appears.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size
  2018-12-21 16:24 ` [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size Keerthy
  2018-12-21 21:16   ` Simon Glass
  2019-01-02 16:33   ` Stephen Warren
@ 2019-01-03 18:14   ` sjg at google.com
  2019-01-04  4:39     ` Keerthy
  2 siblings, 1 reply; 12+ messages in thread
From: sjg at google.com @ 2019-01-03 18:14 UTC (permalink / raw)
  To: u-boot

On 12/21/18 9:24 AM, Keerthy wrote:
> fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
> so that the address cells and size cells are obtained from the
> parent instead of going by the fixed length.

This patch makes perfect sense to me. However, I am worried about the
potential existence of code that assumes the current fixed-size logic;
in the past when fixing similar issues like this we've often run into
code that was use "get addr" functions when it should have been using
"get u32" functions and similar, which then broke when we fixed the
implementation to do the right thing. I guess we should still apply the
patch, and fix up any fallout as it appears.

Applied to u-boot-dm/next, thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 1/2] lib: fdtdec: fdtdec_get_addr_size_fixed remove checks
  2018-12-21 16:24 ` [U-Boot] [PATCH 1/2] lib: fdtdec: fdtdec_get_addr_size_fixed remove checks Keerthy
  2018-12-21 21:16   ` Simon Glass
@ 2019-01-03 18:14   ` sjg at google.com
  1 sibling, 0 replies; 12+ messages in thread
From: sjg at google.com @ 2019-01-03 18:14 UTC (permalink / raw)
  To: u-boot

On Fri, 21 Dec 2018 at 09:24, Keerthy <j-keerthy@ti.com> wrote:
>
> With 8 bytes addressing even on 32 bit machines these checks
> are no longer valid. Remove them.
>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  lib/fdtdec.c | 10 ----------
>  1 file changed, 10 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm/next, thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size
  2019-01-03 18:14   ` sjg at google.com
@ 2019-01-04  4:39     ` Keerthy
  2019-01-15  0:53       ` Simon Glass
  0 siblings, 1 reply; 12+ messages in thread
From: Keerthy @ 2019-01-04  4:39 UTC (permalink / raw)
  To: u-boot



On Thursday 03 January 2019 11:44 PM, sjg at google.com wrote:
> On 12/21/18 9:24 AM, Keerthy wrote:
>> fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
>> so that the address cells and size cells are obtained from the
>> parent instead of going by the fixed length.
> 
> This patch makes perfect sense to me. However, I am worried about the
> potential existence of code that assumes the current fixed-size logic;
> in the past when fixing similar issues like this we've often run into
> code that was use "get addr" functions when it should have been using
> "get u32" functions and similar, which then broke when we fixed the
> implementation to do the right thing. I guess we should still apply the
> patch, and fix up any fallout as it appears.

Thanks Simon!

> 
> Applied to u-boot-dm/next, thanks!
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size
  2019-01-04  4:39     ` Keerthy
@ 2019-01-15  0:53       ` Simon Glass
  2019-01-15  1:52         ` J, KEERTHY
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2019-01-15  0:53 UTC (permalink / raw)
  To: u-boot

Hi Keerthy,

On Thu, 3 Jan 2019 at 21:39, Keerthy <j-keerthy@ti.com> wrote:
>
>
>
> On Thursday 03 January 2019 11:44 PM, sjg at google.com wrote:
> > On 12/21/18 9:24 AM, Keerthy wrote:
> >> fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
> >> so that the address cells and size cells are obtained from the
> >> parent instead of going by the fixed length.
> >
> > This patch makes perfect sense to me. However, I am worried about the
> > potential existence of code that assumes the current fixed-size logic;
> > in the past when fixing similar issues like this we've often run into
> > code that was use "get addr" functions when it should have been using
> > "get u32" functions and similar, which then broke when we fixed the
> > implementation to do the right thing. I guess we should still apply the
> > patch, and fix up any fallout as it appears.
>
> Thanks Simon!

Unfortunately this breaks the tests (make qcheck). Can you please take a look?

Regards,
Simon

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size
  2019-01-15  0:53       ` Simon Glass
@ 2019-01-15  1:52         ` J, KEERTHY
  2019-01-15 16:46           ` Simon Glass
  0 siblings, 1 reply; 12+ messages in thread
From: J, KEERTHY @ 2019-01-15  1:52 UTC (permalink / raw)
  To: u-boot



On 1/15/2019 6:23 AM, Simon Glass wrote:
> Hi Keerthy,
> 
> On Thu, 3 Jan 2019 at 21:39, Keerthy <j-keerthy@ti.com> wrote:
>>
>>
>>
>> On Thursday 03 January 2019 11:44 PM, sjg at google.com wrote:
>>> On 12/21/18 9:24 AM, Keerthy wrote:
>>>> fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
>>>> so that the address cells and size cells are obtained from the
>>>> parent instead of going by the fixed length.
>>>
>>> This patch makes perfect sense to me. However, I am worried about the
>>> potential existence of code that assumes the current fixed-size logic;
>>> in the past when fixing similar issues like this we've often run into
>>> code that was use "get addr" functions when it should have been using
>>> "get u32" functions and similar, which then broke when we fixed the
>>> implementation to do the right thing. I guess we should still apply the
>>> patch, and fix up any fallout as it appears.
>>
>> Thanks Simon!
> 
> Unfortunately this breaks the tests (make qcheck). Can you please take a look?


Simon,

Can you paste the logs? I am at u-boot master tip and my qcheck seems to 
err out.
https://pastebin.ubuntu.com/p/7Q53TMqxMQ/

Regards,
Keerthy
> 
> Regards,
> Simon
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size
  2019-01-15  1:52         ` J, KEERTHY
@ 2019-01-15 16:46           ` Simon Glass
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2019-01-15 16:46 UTC (permalink / raw)
  To: u-boot

Hi Keerthy,

On Mon, 14 Jan 2019 at 18:52, J, KEERTHY <j-keerthy@ti.com> wrote:
>
>
>
> On 1/15/2019 6:23 AM, Simon Glass wrote:
> > Hi Keerthy,
> >
> > On Thu, 3 Jan 2019 at 21:39, Keerthy <j-keerthy@ti.com> wrote:
> >>
> >>
> >>
> >> On Thursday 03 January 2019 11:44 PM, sjg at google.com wrote:
> >>> On 12/21/18 9:24 AM, Keerthy wrote:
> >>>> fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
> >>>> so that the address cells and size cells are obtained from the
> >>>> parent instead of going by the fixed length.
> >>>
> >>> This patch makes perfect sense to me. However, I am worried about the
> >>> potential existence of code that assumes the current fixed-size logic;
> >>> in the past when fixing similar issues like this we've often run into
> >>> code that was use "get addr" functions when it should have been using
> >>> "get u32" functions and similar, which then broke when we fixed the
> >>> implementation to do the right thing. I guess we should still apply the
> >>> patch, and fix up any fallout as it appears.
> >>
> >> Thanks Simon!
> >
> > Unfortunately this breaks the tests (make qcheck). Can you please take a look?
>
>
> Simon,
>
> Can you paste the logs? I am at u-boot master tip and my qcheck seems to
> err out.
> https://pastebin.ubuntu.com/p/7Q53TMqxMQ/

You should get the tests running. In this case see README.sandbox.
Otherwise any patch you send may break U-Boot.

Regards,
Simon

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-01-15 16:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 16:24 [U-Boot] [PATCH 0/2] lib: fdtdec: Couple of fies Keerthy
2018-12-21 16:24 ` [U-Boot] [PATCH 1/2] lib: fdtdec: fdtdec_get_addr_size_fixed remove checks Keerthy
2018-12-21 21:16   ` Simon Glass
2019-01-03 18:14   ` sjg at google.com
2018-12-21 16:24 ` [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size Keerthy
2018-12-21 21:16   ` Simon Glass
2019-01-02 16:33   ` Stephen Warren
2019-01-03 18:14   ` sjg at google.com
2019-01-04  4:39     ` Keerthy
2019-01-15  0:53       ` Simon Glass
2019-01-15  1:52         ` J, KEERTHY
2019-01-15 16:46           ` Simon Glass

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.