All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
@ 2017-09-02  8:43 ` Robert P. J. Day
  0 siblings, 0 replies; 14+ messages in thread
From: Robert P. J. Day @ 2017-09-02  8:43 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA, Linux PPC Mailing List,
	monstr-pSz03upnqPeHXe+LvDLADg


Since, according to a recent devicetree ML posting by Rob Herring,
the node "/chosen@0" is most likely for real Open Firmware and does
not apply to DTSpec, remove all remaining tests and references for
that node, of which there are very few left:

 arch/microblaze/kernel/prom.c | 3 +--
 arch/mips/generic/yamon-dt.c  | 4 ----
 arch/powerpc/boot/oflib.c     | 7 ++-----
 drivers/of/base.c             | 2 --
 drivers/of/fdt.c              | 5 +----
 5 files changed, 4 insertions(+), 17 deletions(-)

This should be innocuous as, in all of the three arch/ files above,
there is a test for "chosen" immediately before the test for
"chosen@0", so nothing should change.

Signed-off-by: Robert P. J. Day <rpjday-L09J2beyid0N/H6P543EQg@public.gmane.org>

---

  if this patch is premature, then just ignore it, thanks.

diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 68f0999..c81bfd7 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -53,8 +53,7 @@ static int __init early_init_dt_scan_chosen_serial(unsigned long node,

 	pr_debug("%s: depth: %d, uname: %s\n", __func__, depth, uname);

-	if (depth == 1 && (strcmp(uname, "chosen") == 0 ||
-				strcmp(uname, "chosen@0") == 0)) {
+	if (depth == 1 && (strcmp(uname, "chosen") == 0)) {
 		p = of_get_flat_dt_prop(node, "linux,stdout-path", &l);
 		if (p != NULL && l > 0)
 			stdout = p; /* store pointer to stdout-path */
diff --git a/arch/mips/generic/yamon-dt.c b/arch/mips/generic/yamon-dt.c
index 6077bca..3a241b2 100644
--- a/arch/mips/generic/yamon-dt.c
+++ b/arch/mips/generic/yamon-dt.c
@@ -28,8 +28,6 @@ __init int yamon_dt_append_cmdline(void *fdt)
 	/* find or add chosen node */
 	chosen_off = fdt_path_offset(fdt, "/chosen");
 	if (chosen_off == -FDT_ERR_NOTFOUND)
-		chosen_off = fdt_path_offset(fdt, "/chosen@0");
-	if (chosen_off == -FDT_ERR_NOTFOUND)
 		chosen_off = fdt_add_subnode(fdt, 0, "chosen");
 	if (chosen_off < 0) {
 		pr_err("Unable to find or add DT chosen node: %d\n",
@@ -221,8 +219,6 @@ __init int yamon_dt_serial_config(void *fdt)
 	/* find or add chosen node */
 	chosen_off = fdt_path_offset(fdt, "/chosen");
 	if (chosen_off == -FDT_ERR_NOTFOUND)
-		chosen_off = fdt_path_offset(fdt, "/chosen@0");
-	if (chosen_off == -FDT_ERR_NOTFOUND)
 		chosen_off = fdt_add_subnode(fdt, 0, "chosen");
 	if (chosen_off < 0) {
 		pr_err("Unable to find or add DT chosen node: %d\n",
diff --git a/arch/powerpc/boot/oflib.c b/arch/powerpc/boot/oflib.c
index 46c98a4..a01471f 100644
--- a/arch/powerpc/boot/oflib.c
+++ b/arch/powerpc/boot/oflib.c
@@ -131,11 +131,8 @@ static int check_of_version(void)
 		return 0;
 	chosen = of_finddevice("/chosen");
 	if (chosen == (phandle) -1) {
-		chosen = of_finddevice("/chosen@0");
-		if (chosen == (phandle) -1) {
-			printf("no chosen\n");
-			return 0;
-		}
+		printf("no chosen\n");
+		return 0;
 	}
 	if (of_getprop(chosen, "mmu", &chosen_mmu, sizeof(chosen_mmu)) <= 0) {
 		printf("no mmu\n");
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 686628d..e0f636d 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1659,8 +1659,6 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))

 	of_aliases = of_find_node_by_path("/aliases");
 	of_chosen = of_find_node_by_path("/chosen");
-	if (of_chosen == NULL)
-		of_chosen = of_find_node_by_path("/chosen@0");

 	if (of_chosen) {
 		/* linux,stdout-path and /aliases/stdout are for legacy compatibility */
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index ce30c9a..0b0a709 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -980,8 +980,6 @@ int __init early_init_dt_scan_chosen_stdout(void)

 	offset = fdt_path_offset(fdt, "/chosen");
 	if (offset < 0)
-		offset = fdt_path_offset(fdt, "/chosen@0");
-	if (offset < 0)
 		return -ENOENT;

 	p = fdt_getprop(fdt, offset, "stdout-path", &l);
@@ -1117,8 +1115,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,

 	pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);

-	if (depth != 1 || !data ||
-	    (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
+	if (depth != 1 || !data || (strcmp(uname, "chosen") != 0))
 		return 0;

 	early_init_dt_check_for_initrd(node);

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
@ 2017-09-02  8:43 ` Robert P. J. Day
  0 siblings, 0 replies; 14+ messages in thread
From: Robert P. J. Day @ 2017-09-02  8:43 UTC (permalink / raw)
  To: devicetree; +Cc: linux-mips, Linux PPC Mailing List, monstr


Since, according to a recent devicetree ML posting by Rob Herring,
the node "/chosen@0" is most likely for real Open Firmware and does
not apply to DTSpec, remove all remaining tests and references for
that node, of which there are very few left:

 arch/microblaze/kernel/prom.c | 3 +--
 arch/mips/generic/yamon-dt.c  | 4 ----
 arch/powerpc/boot/oflib.c     | 7 ++-----
 drivers/of/base.c             | 2 --
 drivers/of/fdt.c              | 5 +----
 5 files changed, 4 insertions(+), 17 deletions(-)

This should be innocuous as, in all of the three arch/ files above,
there is a test for "chosen" immediately before the test for
"chosen@0", so nothing should change.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

  if this patch is premature, then just ignore it, thanks.

diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 68f0999..c81bfd7 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -53,8 +53,7 @@ static int __init early_init_dt_scan_chosen_serial(unsigned long node,

 	pr_debug("%s: depth: %d, uname: %s\n", __func__, depth, uname);

-	if (depth == 1 && (strcmp(uname, "chosen") == 0 ||
-				strcmp(uname, "chosen@0") == 0)) {
+	if (depth == 1 && (strcmp(uname, "chosen") == 0)) {
 		p = of_get_flat_dt_prop(node, "linux,stdout-path", &l);
 		if (p != NULL && l > 0)
 			stdout = p; /* store pointer to stdout-path */
diff --git a/arch/mips/generic/yamon-dt.c b/arch/mips/generic/yamon-dt.c
index 6077bca..3a241b2 100644
--- a/arch/mips/generic/yamon-dt.c
+++ b/arch/mips/generic/yamon-dt.c
@@ -28,8 +28,6 @@ __init int yamon_dt_append_cmdline(void *fdt)
 	/* find or add chosen node */
 	chosen_off = fdt_path_offset(fdt, "/chosen");
 	if (chosen_off == -FDT_ERR_NOTFOUND)
-		chosen_off = fdt_path_offset(fdt, "/chosen@0");
-	if (chosen_off == -FDT_ERR_NOTFOUND)
 		chosen_off = fdt_add_subnode(fdt, 0, "chosen");
 	if (chosen_off < 0) {
 		pr_err("Unable to find or add DT chosen node: %d\n",
@@ -221,8 +219,6 @@ __init int yamon_dt_serial_config(void *fdt)
 	/* find or add chosen node */
 	chosen_off = fdt_path_offset(fdt, "/chosen");
 	if (chosen_off == -FDT_ERR_NOTFOUND)
-		chosen_off = fdt_path_offset(fdt, "/chosen@0");
-	if (chosen_off == -FDT_ERR_NOTFOUND)
 		chosen_off = fdt_add_subnode(fdt, 0, "chosen");
 	if (chosen_off < 0) {
 		pr_err("Unable to find or add DT chosen node: %d\n",
diff --git a/arch/powerpc/boot/oflib.c b/arch/powerpc/boot/oflib.c
index 46c98a4..a01471f 100644
--- a/arch/powerpc/boot/oflib.c
+++ b/arch/powerpc/boot/oflib.c
@@ -131,11 +131,8 @@ static int check_of_version(void)
 		return 0;
 	chosen = of_finddevice("/chosen");
 	if (chosen == (phandle) -1) {
-		chosen = of_finddevice("/chosen@0");
-		if (chosen == (phandle) -1) {
-			printf("no chosen\n");
-			return 0;
-		}
+		printf("no chosen\n");
+		return 0;
 	}
 	if (of_getprop(chosen, "mmu", &chosen_mmu, sizeof(chosen_mmu)) <= 0) {
 		printf("no mmu\n");
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 686628d..e0f636d 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1659,8 +1659,6 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))

 	of_aliases = of_find_node_by_path("/aliases");
 	of_chosen = of_find_node_by_path("/chosen");
-	if (of_chosen == NULL)
-		of_chosen = of_find_node_by_path("/chosen@0");

 	if (of_chosen) {
 		/* linux,stdout-path and /aliases/stdout are for legacy compatibility */
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index ce30c9a..0b0a709 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -980,8 +980,6 @@ int __init early_init_dt_scan_chosen_stdout(void)

 	offset = fdt_path_offset(fdt, "/chosen");
 	if (offset < 0)
-		offset = fdt_path_offset(fdt, "/chosen@0");
-	if (offset < 0)
 		return -ENOENT;

 	p = fdt_getprop(fdt, offset, "stdout-path", &l);
@@ -1117,8 +1115,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,

 	pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);

-	if (depth != 1 || !data ||
-	    (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
+	if (depth != 1 || !data || (strcmp(uname, "chosen") != 0))
 		return 0;

 	early_init_dt_check_for_initrd(node);

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
  2017-09-02  8:43 ` Robert P. J. Day
@ 2017-09-02 22:20     ` Benjamin Herrenschmidt
  -1 siblings, 0 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2017-09-02 22:20 UTC (permalink / raw)
  To: Robert P. J. Day, devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA, monstr-pSz03upnqPeHXe+LvDLADg,
	Linux PPC Mailing List

On Sat, 2017-09-02 at 04:43 -0400, Robert P. J. Day wrote:
> Since, according to a recent devicetree ML posting by Rob Herring,
> the node "/chosen@0" is most likely for real Open Firmware and does
> not apply to DTSpec, remove all remaining tests and references for
> that node, of which there are very few left:

Technically that would break Open Firmware systems where the node is
really called chosen@0

Now I'm not sure such a thing actually exist however.

My collection of DTs don't seem to have one, except in the ancient html
variants that were extracted by the pengionppc folks for the original
PowerMac 8600 but I wonder if that's a bug in the extraction script
since they also have @0 on /packages etc...

Ben.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
@ 2017-09-02 22:20     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2017-09-02 22:20 UTC (permalink / raw)
  To: Robert P. J. Day, devicetree; +Cc: linux-mips, monstr, Linux PPC Mailing List

On Sat, 2017-09-02 at 04:43 -0400, Robert P. J. Day wrote:
> Since, according to a recent devicetree ML posting by Rob Herring,
> the node "/chosen@0" is most likely for real Open Firmware and does
> not apply to DTSpec, remove all remaining tests and references for
> that node, of which there are very few left:

Technically that would break Open Firmware systems where the node is
really called chosen@0

Now I'm not sure such a thing actually exist however.

My collection of DTs don't seem to have one, except in the ancient html
variants that were extracted by the pengionppc folks for the original
PowerMac 8600 but I wonder if that's a bug in the extraction script
since they also have @0 on /packages etc...

Ben.

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
  2017-09-02 22:20     ` Benjamin Herrenschmidt
@ 2017-09-03 10:43         ` Robert P. J. Day
  -1 siblings, 0 replies; 14+ messages in thread
From: Robert P. J. Day @ 2017-09-03 10:43 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, monstr-pSz03upnqPeHXe+LvDLADg,
	Linux PPC Mailing List

On Sun, 3 Sep 2017, Benjamin Herrenschmidt wrote:

> On Sat, 2017-09-02 at 04:43 -0400, Robert P. J. Day wrote:
> > Since, according to a recent devicetree ML posting by Rob Herring,
> > the node "/chosen@0" is most likely for real Open Firmware and
> > does not apply to DTSpec, remove all remaining tests and
> > references for that node, of which there are very few left:
>
> Technically that would break Open Firmware systems where the node is
> really called chosen@0
>
> Now I'm not sure such a thing actually exist however.
>
> My collection of DTs don't seem to have one, except in the ancient
> html variants that were extracted by the pengionppc folks for the
> original PowerMac 8600 but I wonder if that's a bug in the
> extraction script since they also have @0 on /packages etc...

  obviously, this isn't a priority issue, i was just working off a
comment by rob herring that "chosen@0" is not defined by the current
DTSpec 0.1, so it seemed appropriate to toss it. if there's a reason
to hang onto it, that's fine with me.

  however, given the diff stat of the change to remove every single
reference to that node name in the current kernel source:

 arch/microblaze/kernel/prom.c | 3 +--
 arch/mips/generic/yamon-dt.c  | 4 ----
 arch/powerpc/boot/oflib.c     | 7 ++-----
 drivers/of/base.c             | 2 --
 drivers/of/fdt.c              | 5 +----
 5 files changed, 4 insertions(+), 17 deletions(-)

it seems inconsistent that three architectures would be testing for
that node, but none of the rest. consistency suggests that every
architecture should take it into account, or none should.

  anyway, not a big deal, i'm fine with any decision.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
@ 2017-09-03 10:43         ` Robert P. J. Day
  0 siblings, 0 replies; 14+ messages in thread
From: Robert P. J. Day @ 2017-09-03 10:43 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: devicetree, linux-mips, monstr, Linux PPC Mailing List

On Sun, 3 Sep 2017, Benjamin Herrenschmidt wrote:

> On Sat, 2017-09-02 at 04:43 -0400, Robert P. J. Day wrote:
> > Since, according to a recent devicetree ML posting by Rob Herring,
> > the node "/chosen@0" is most likely for real Open Firmware and
> > does not apply to DTSpec, remove all remaining tests and
> > references for that node, of which there are very few left:
>
> Technically that would break Open Firmware systems where the node is
> really called chosen@0
>
> Now I'm not sure such a thing actually exist however.
>
> My collection of DTs don't seem to have one, except in the ancient
> html variants that were extracted by the pengionppc folks for the
> original PowerMac 8600 but I wonder if that's a bug in the
> extraction script since they also have @0 on /packages etc...

  obviously, this isn't a priority issue, i was just working off a
comment by rob herring that "chosen@0" is not defined by the current
DTSpec 0.1, so it seemed appropriate to toss it. if there's a reason
to hang onto it, that's fine with me.

  however, given the diff stat of the change to remove every single
reference to that node name in the current kernel source:

 arch/microblaze/kernel/prom.c | 3 +--
 arch/mips/generic/yamon-dt.c  | 4 ----
 arch/powerpc/boot/oflib.c     | 7 ++-----
 drivers/of/base.c             | 2 --
 drivers/of/fdt.c              | 5 +----
 5 files changed, 4 insertions(+), 17 deletions(-)

it seems inconsistent that three architectures would be testing for
that node, but none of the rest. consistency suggests that every
architecture should take it into account, or none should.

  anyway, not a big deal, i'm fine with any decision.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
  2017-09-03 10:43         ` Robert P. J. Day
@ 2017-09-03 12:02             ` Benjamin Herrenschmidt
  -1 siblings, 0 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2017-09-03 12:02 UTC (permalink / raw)
  To: Robert P. J. Day
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, monstr-pSz03upnqPeHXe+LvDLADg,
	Linux PPC Mailing List

On Sun, 2017-09-03 at 06:43 -0400, Robert P. J. Day wrote:
>   however, given the diff stat of the change to remove every single
> reference to that node name in the current kernel source:
> 
>  arch/microblaze/kernel/prom.c | 3 +--
>  arch/mips/generic/yamon-dt.c  | 4 ----
>  arch/powerpc/boot/oflib.c     | 7 ++-----
>  drivers/of/base.c             | 2 --
>  drivers/of/fdt.c              | 5 +----
>  5 files changed, 4 insertions(+), 17 deletions(-)
> 
> it seems inconsistent that three architectures would be testing for
> that node, but none of the rest. consistency suggests that every
> architecture should take it into account, or none should.
> 
>   anyway, not a big deal, i'm fine with any decision.

powerpc is the only one of the 3 who has an actual open firmware
implementation afaik.

In any case, I think you can probably remove from microblaze and
possibly mips but I'm a bit worried about the generic case and powerpc
boot.

Cheers,
Ben.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
@ 2017-09-03 12:02             ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2017-09-03 12:02 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: devicetree, linux-mips, monstr, Linux PPC Mailing List

On Sun, 2017-09-03 at 06:43 -0400, Robert P. J. Day wrote:
>   however, given the diff stat of the change to remove every single
> reference to that node name in the current kernel source:
> 
>  arch/microblaze/kernel/prom.c | 3 +--
>  arch/mips/generic/yamon-dt.c  | 4 ----
>  arch/powerpc/boot/oflib.c     | 7 ++-----
>  drivers/of/base.c             | 2 --
>  drivers/of/fdt.c              | 5 +----
>  5 files changed, 4 insertions(+), 17 deletions(-)
> 
> it seems inconsistent that three architectures would be testing for
> that node, but none of the rest. consistency suggests that every
> architecture should take it into account, or none should.
> 
>   anyway, not a big deal, i'm fine with any decision.

powerpc is the only one of the 3 who has an actual open firmware
implementation afaik.

In any case, I think you can probably remove from microblaze and
possibly mips but I'm a bit worried about the generic case and powerpc
boot.

Cheers,
Ben.

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
  2017-09-03 10:43         ` Robert P. J. Day
@ 2017-09-05 14:30             ` Rob Herring
  -1 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2017-09-05 14:30 UTC (permalink / raw)
  To: Robert P. J. Day
  Cc: Benjamin Herrenschmidt, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-MIPS, Michal Simek, Linux PPC Mailing List

On Sun, Sep 3, 2017 at 5:43 AM, Robert P. J. Day <rpjday-L09J2beyid0N/H6P543EQg@public.gmane.org> wrote:
> On Sun, 3 Sep 2017, Benjamin Herrenschmidt wrote:
>
>> On Sat, 2017-09-02 at 04:43 -0400, Robert P. J. Day wrote:
>> > Since, according to a recent devicetree ML posting by Rob Herring,
>> > the node "/chosen@0" is most likely for real Open Firmware and
>> > does not apply to DTSpec, remove all remaining tests and
>> > references for that node, of which there are very few left:
>>
>> Technically that would break Open Firmware systems where the node is
>> really called chosen@0
>>
>> Now I'm not sure such a thing actually exist however.
>>
>> My collection of DTs don't seem to have one, except in the ancient
>> html variants that were extracted by the pengionppc folks for the
>> original PowerMac 8600 but I wonder if that's a bug in the
>> extraction script since they also have @0 on /packages etc...
>
>   obviously, this isn't a priority issue, i was just working off a
> comment by rob herring that "chosen@0" is not defined by the current
> DTSpec 0.1, so it seemed appropriate to toss it. if there's a reason
> to hang onto it, that's fine with me.
>
>   however, given the diff stat of the change to remove every single
> reference to that node name in the current kernel source:
>
>  arch/microblaze/kernel/prom.c | 3 +--
>  arch/mips/generic/yamon-dt.c  | 4 ----
>  arch/powerpc/boot/oflib.c     | 7 ++-----
>  drivers/of/base.c             | 2 --
>  drivers/of/fdt.c              | 5 +----
>  5 files changed, 4 insertions(+), 17 deletions(-)
>
> it seems inconsistent that three architectures would be testing for
> that node, but none of the rest. consistency suggests that every
> architecture should take it into account, or none should.

I generally agree and have moved various things from arch to
drivers/of/ to ensure that. But for legacy things, we have to allow
for exceptions. I agree with Ben and think that microblaze (they
generally just copied PPC), MIPS, and the FDT code in drivers/of/ can
be changed.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
@ 2017-09-05 14:30             ` Rob Herring
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2017-09-05 14:30 UTC (permalink / raw)
  To: Robert P. J. Day
  Cc: Benjamin Herrenschmidt, devicetree, Linux-MIPS, Michal Simek,
	Linux PPC Mailing List

On Sun, Sep 3, 2017 at 5:43 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> On Sun, 3 Sep 2017, Benjamin Herrenschmidt wrote:
>
>> On Sat, 2017-09-02 at 04:43 -0400, Robert P. J. Day wrote:
>> > Since, according to a recent devicetree ML posting by Rob Herring,
>> > the node "/chosen@0" is most likely for real Open Firmware and
>> > does not apply to DTSpec, remove all remaining tests and
>> > references for that node, of which there are very few left:
>>
>> Technically that would break Open Firmware systems where the node is
>> really called chosen@0
>>
>> Now I'm not sure such a thing actually exist however.
>>
>> My collection of DTs don't seem to have one, except in the ancient
>> html variants that were extracted by the pengionppc folks for the
>> original PowerMac 8600 but I wonder if that's a bug in the
>> extraction script since they also have @0 on /packages etc...
>
>   obviously, this isn't a priority issue, i was just working off a
> comment by rob herring that "chosen@0" is not defined by the current
> DTSpec 0.1, so it seemed appropriate to toss it. if there's a reason
> to hang onto it, that's fine with me.
>
>   however, given the diff stat of the change to remove every single
> reference to that node name in the current kernel source:
>
>  arch/microblaze/kernel/prom.c | 3 +--
>  arch/mips/generic/yamon-dt.c  | 4 ----
>  arch/powerpc/boot/oflib.c     | 7 ++-----
>  drivers/of/base.c             | 2 --
>  drivers/of/fdt.c              | 5 +----
>  5 files changed, 4 insertions(+), 17 deletions(-)
>
> it seems inconsistent that three architectures would be testing for
> that node, but none of the rest. consistency suggests that every
> architecture should take it into account, or none should.

I generally agree and have moved various things from arch to
drivers/of/ to ensure that. But for legacy things, we have to allow
for exceptions. I agree with Ben and think that microblaze (they
generally just copied PPC), MIPS, and the FDT code in drivers/of/ can
be changed.

Rob

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
  2017-09-02  8:43 ` Robert P. J. Day
@ 2017-09-05 14:41     ` Rob Herring
  -1 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2017-09-05 14:41 UTC (permalink / raw)
  To: Robert P. J. Day
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Linux-MIPS,
	Linux PPC Mailing List, Michal Simek

On Sat, Sep 2, 2017 at 3:43 AM, Robert P. J. Day <rpjday-L09J2beyid0N/H6P543EQg@public.gmane.org> wrote:
>
> Since, according to a recent devicetree ML posting by Rob Herring,
> the node "/chosen@0" is most likely for real Open Firmware and does
> not apply to DTSpec, remove all remaining tests and references for
> that node, of which there are very few left:
>
>  arch/microblaze/kernel/prom.c | 3 +--
>  arch/mips/generic/yamon-dt.c  | 4 ----
>  arch/powerpc/boot/oflib.c     | 7 ++-----
>  drivers/of/base.c             | 2 --
>  drivers/of/fdt.c              | 5 +----
>  5 files changed, 4 insertions(+), 17 deletions(-)
>
> This should be innocuous as, in all of the three arch/ files above,
> there is a test for "chosen" immediately before the test for
> "chosen@0", so nothing should change.
>
> Signed-off-by: Robert P. J. Day <rpjday-L09J2beyid0N/H6P543EQg@public.gmane.org>
>
> ---
>
>   if this patch is premature, then just ignore it, thanks.
>
> diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
> index 68f0999..c81bfd7 100644
> --- a/arch/microblaze/kernel/prom.c
> +++ b/arch/microblaze/kernel/prom.c
> @@ -53,8 +53,7 @@ static int __init early_init_dt_scan_chosen_serial(unsigned long node,
>
>         pr_debug("%s: depth: %d, uname: %s\n", __func__, depth, uname);
>
> -       if (depth == 1 && (strcmp(uname, "chosen") == 0 ||
> -                               strcmp(uname, "chosen@0") == 0)) {
> +       if (depth == 1 && (strcmp(uname, "chosen") == 0)) {

I'd really hoped to remove early_init_dt_scan_chosen_serial()
altogether. It may now be just a matter of adding the compatible
strings to the uartlite earlycon.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
@ 2017-09-05 14:41     ` Rob Herring
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2017-09-05 14:41 UTC (permalink / raw)
  To: Robert P. J. Day
  Cc: devicetree, Linux-MIPS, Linux PPC Mailing List, Michal Simek

On Sat, Sep 2, 2017 at 3:43 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
> Since, according to a recent devicetree ML posting by Rob Herring,
> the node "/chosen@0" is most likely for real Open Firmware and does
> not apply to DTSpec, remove all remaining tests and references for
> that node, of which there are very few left:
>
>  arch/microblaze/kernel/prom.c | 3 +--
>  arch/mips/generic/yamon-dt.c  | 4 ----
>  arch/powerpc/boot/oflib.c     | 7 ++-----
>  drivers/of/base.c             | 2 --
>  drivers/of/fdt.c              | 5 +----
>  5 files changed, 4 insertions(+), 17 deletions(-)
>
> This should be innocuous as, in all of the three arch/ files above,
> there is a test for "chosen" immediately before the test for
> "chosen@0", so nothing should change.
>
> Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
>
> ---
>
>   if this patch is premature, then just ignore it, thanks.
>
> diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
> index 68f0999..c81bfd7 100644
> --- a/arch/microblaze/kernel/prom.c
> +++ b/arch/microblaze/kernel/prom.c
> @@ -53,8 +53,7 @@ static int __init early_init_dt_scan_chosen_serial(unsigned long node,
>
>         pr_debug("%s: depth: %d, uname: %s\n", __func__, depth, uname);
>
> -       if (depth == 1 && (strcmp(uname, "chosen") == 0 ||
> -                               strcmp(uname, "chosen@0") == 0)) {
> +       if (depth == 1 && (strcmp(uname, "chosen") == 0)) {

I'd really hoped to remove early_init_dt_scan_chosen_serial()
altogether. It may now be just a matter of adding the compatible
strings to the uartlite earlycon.

Rob

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
  2017-09-05 14:30             ` Rob Herring
@ 2017-09-05 21:22               ` Robert P. J. Day
  -1 siblings, 0 replies; 14+ messages in thread
From: Robert P. J. Day @ 2017-09-05 21:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: Benjamin Herrenschmidt, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-MIPS, Michal Simek, Linux PPC Mailing List

On Tue, 5 Sep 2017, Rob Herring wrote:

> On Sun, Sep 3, 2017 at 5:43 AM, Robert P. J. Day <rpjday-L09J2beyid0N/H6P543EQg@public.gmane.org> wrote:
> > On Sun, 3 Sep 2017, Benjamin Herrenschmidt wrote:
> >
> >> On Sat, 2017-09-02 at 04:43 -0400, Robert P. J. Day wrote:
> >> > Since, according to a recent devicetree ML posting by Rob Herring,
> >> > the node "/chosen@0" is most likely for real Open Firmware and
> >> > does not apply to DTSpec, remove all remaining tests and
> >> > references for that node, of which there are very few left:
> >>
> >> Technically that would break Open Firmware systems where the node is
> >> really called chosen@0
> >>
> >> Now I'm not sure such a thing actually exist however.
> >>
> >> My collection of DTs don't seem to have one, except in the ancient
> >> html variants that were extracted by the pengionppc folks for the
> >> original PowerMac 8600 but I wonder if that's a bug in the
> >> extraction script since they also have @0 on /packages etc...
> >
> >   obviously, this isn't a priority issue, i was just working off a
> > comment by rob herring that "chosen@0" is not defined by the current
> > DTSpec 0.1, so it seemed appropriate to toss it. if there's a reason
> > to hang onto it, that's fine with me.
> >
> >   however, given the diff stat of the change to remove every single
> > reference to that node name in the current kernel source:
> >
> >  arch/microblaze/kernel/prom.c | 3 +--
> >  arch/mips/generic/yamon-dt.c  | 4 ----
> >  arch/powerpc/boot/oflib.c     | 7 ++-----
> >  drivers/of/base.c             | 2 --
> >  drivers/of/fdt.c              | 5 +----
> >  5 files changed, 4 insertions(+), 17 deletions(-)
> >
> > it seems inconsistent that three architectures would be testing for
> > that node, but none of the rest. consistency suggests that every
> > architecture should take it into account, or none should.
>
> I generally agree and have moved various things from arch to
> drivers/of/ to ensure that. But for legacy things, we have to allow
> for exceptions. I agree with Ben and think that microblaze (they
> generally just copied PPC), MIPS, and the FDT code in drivers/of/ can
> be changed.

  i'm not quite sure what people have agreed on, so i'll just leave it
in the hands of others here to submit patches for what they think is
appropriate.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] devicetree: Remove remaining references/tests for "chosen@0"
@ 2017-09-05 21:22               ` Robert P. J. Day
  0 siblings, 0 replies; 14+ messages in thread
From: Robert P. J. Day @ 2017-09-05 21:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: Benjamin Herrenschmidt, devicetree, Linux-MIPS, Michal Simek,
	Linux PPC Mailing List

On Tue, 5 Sep 2017, Rob Herring wrote:

> On Sun, Sep 3, 2017 at 5:43 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> > On Sun, 3 Sep 2017, Benjamin Herrenschmidt wrote:
> >
> >> On Sat, 2017-09-02 at 04:43 -0400, Robert P. J. Day wrote:
> >> > Since, according to a recent devicetree ML posting by Rob Herring,
> >> > the node "/chosen@0" is most likely for real Open Firmware and
> >> > does not apply to DTSpec, remove all remaining tests and
> >> > references for that node, of which there are very few left:
> >>
> >> Technically that would break Open Firmware systems where the node is
> >> really called chosen@0
> >>
> >> Now I'm not sure such a thing actually exist however.
> >>
> >> My collection of DTs don't seem to have one, except in the ancient
> >> html variants that were extracted by the pengionppc folks for the
> >> original PowerMac 8600 but I wonder if that's a bug in the
> >> extraction script since they also have @0 on /packages etc...
> >
> >   obviously, this isn't a priority issue, i was just working off a
> > comment by rob herring that "chosen@0" is not defined by the current
> > DTSpec 0.1, so it seemed appropriate to toss it. if there's a reason
> > to hang onto it, that's fine with me.
> >
> >   however, given the diff stat of the change to remove every single
> > reference to that node name in the current kernel source:
> >
> >  arch/microblaze/kernel/prom.c | 3 +--
> >  arch/mips/generic/yamon-dt.c  | 4 ----
> >  arch/powerpc/boot/oflib.c     | 7 ++-----
> >  drivers/of/base.c             | 2 --
> >  drivers/of/fdt.c              | 5 +----
> >  5 files changed, 4 insertions(+), 17 deletions(-)
> >
> > it seems inconsistent that three architectures would be testing for
> > that node, but none of the rest. consistency suggests that every
> > architecture should take it into account, or none should.
>
> I generally agree and have moved various things from arch to
> drivers/of/ to ensure that. But for legacy things, we have to allow
> for exceptions. I agree with Ben and think that microblaze (they
> generally just copied PPC), MIPS, and the FDT code in drivers/of/ can
> be changed.

  i'm not quite sure what people have agreed on, so i'll just leave it
in the hands of others here to submit patches for what they think is
appropriate.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

end of thread, other threads:[~2017-09-05 21:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-02  8:43 [PATCH] devicetree: Remove remaining references/tests for "chosen@0" Robert P. J. Day
2017-09-02  8:43 ` Robert P. J. Day
     [not found] ` <alpine.LFD.2.21.1709020416130.13598-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2017-09-02 22:20   ` Benjamin Herrenschmidt
2017-09-02 22:20     ` Benjamin Herrenschmidt
     [not found]     ` <1504390854.4974.108.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2017-09-03 10:43       ` Robert P. J. Day
2017-09-03 10:43         ` Robert P. J. Day
     [not found]         ` <alpine.LFD.2.21.1709030637090.24875-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2017-09-03 12:02           ` Benjamin Herrenschmidt
2017-09-03 12:02             ` Benjamin Herrenschmidt
2017-09-05 14:30           ` Rob Herring
2017-09-05 14:30             ` Rob Herring
2017-09-05 21:22             ` Robert P. J. Day
2017-09-05 21:22               ` Robert P. J. Day
2017-09-05 14:41   ` Rob Herring
2017-09-05 14:41     ` Rob Herring

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.