All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: Add empty "chosen" node to WM8xxx device trees
@ 2020-10-09 16:57 Brigham Campbell
  2020-10-24 21:09 ` Brigham Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Brigham Campbell @ 2020-10-09 16:57 UTC (permalink / raw)
  To: robh+dt, robh, devicetree, linux-kernel, alchark

The following patch is a bug fix for an issue introduced by commit
abe60a3a7afb4058278864aa18c5faf62094c11a which removed the deprecated
device tree skeletons.

For the devices corresponding to these device trees, an updated version
of U-Boot is not available. Therefore, we must append DTBs to the kernel
instead of counting on the bootloader to load one into memory and pass
the pointer to the kernel during init.

For some reason, when this method of appending DTBs to the kernel is
used with any revision after abe60a3a7, the DTB seems to load correctly,
but the kernel parameters aren't loaded correctly. Regardless of whether
the kernel parameters are built into the kernel or passed in via U-Boot,
they simply aren't registered by the running kernel.

Adding an empty "chosen" node to the device tree fixes this issue. I've
tested this with a WM8650-based laptop. Regrettably, I'd be lying if I
said that I know exactly why this fixes the problem. However, I know
that this solution works. I'm happy to hear suggestions/ridicule
regarding these changes.

Finally, I have my suspicions that the WM8xxx series devices aren't the
only ones affected by this issue. I think this solution, if acceptable,
could be applied to other devices which may or may not be having issues
related to appended DTBs and kernel parameters. Perhaps other devices
which commit abe60a3a7 changed?

This is my first patch submission to the Linux kernel, so please tear it
apart. Let me know what I've done incorrectly. And thanks, Alexey, for
helping me along. I have much to learn and I wouldn't have made it half
as far without his patience.

Thanks,
Brigham Campbell

Signed-off-by: Brigham Campbell <me@brighamcampbell.com>

---
 arch/arm/boot/dts/wm8505.dtsi | 2 ++
 arch/arm/boot/dts/wm8650.dtsi | 2 ++
 arch/arm/boot/dts/wm8850.dtsi | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/wm8505.dtsi b/arch/arm/boot/dts/wm8505.dtsi
index 168cd12b07bc..2b814b48b458 100644
--- a/arch/arm/boot/dts/wm8505.dtsi
+++ b/arch/arm/boot/dts/wm8505.dtsi
@@ -10,6 +10,8 @@ / {
 	#size-cells = <1>;
 	compatible = "wm,wm8505";
 
+	chosen {};
+
 	cpus {
 		#address-cells = <0>;
 		#size-cells = <0>;
diff --git a/arch/arm/boot/dts/wm8650.dtsi b/arch/arm/boot/dts/wm8650.dtsi
index bc057b6f7d16..a68c82c8035e 100644
--- a/arch/arm/boot/dts/wm8650.dtsi
+++ b/arch/arm/boot/dts/wm8650.dtsi
@@ -10,6 +10,8 @@ / {
 	#size-cells = <1>;
 	compatible = "wm,wm8650";
 
+	chosen {};
+
 	cpus {
 		#address-cells = <0>;
 		#size-cells = <0>;
diff --git a/arch/arm/boot/dts/wm8850.dtsi b/arch/arm/boot/dts/wm8850.dtsi
index 65c9271050e6..c864883ae777 100644
--- a/arch/arm/boot/dts/wm8850.dtsi
+++ b/arch/arm/boot/dts/wm8850.dtsi
@@ -10,6 +10,8 @@ / {
 	#size-cells = <1>;
 	compatible = "wm,wm8850";
 
+	chosen {};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-- 
2.28.0


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

* Re: [PATCH] ARM: dts: Add empty "chosen" node to WM8xxx device trees
  2020-10-09 16:57 [PATCH] ARM: dts: Add empty "chosen" node to WM8xxx device trees Brigham Campbell
@ 2020-10-24 21:09 ` Brigham Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Brigham Campbell @ 2020-10-24 21:09 UTC (permalink / raw)
  To: robh+dt, robh, devicetree, linux-kernel, alchark

On Fri, Oct 09, 2020 at 10:57:42AM -0600, Brigham Campbell wrote:
> The following patch is a bug fix for an issue introduced by commit
> abe60a3a7afb4058278864aa18c5faf62094c11a which removed the deprecated
> device tree skeletons.
> 
> For the devices corresponding to these device trees, an updated version
> of U-Boot is not available. Therefore, we must append DTBs to the kernel
> instead of counting on the bootloader to load one into memory and pass
> the pointer to the kernel during init.
> 
> For some reason, when this method of appending DTBs to the kernel is
> used with any revision after abe60a3a7, the DTB seems to load correctly,
> but the kernel parameters aren't loaded correctly. Regardless of whether
> the kernel parameters are built into the kernel or passed in via U-Boot,
> they simply aren't registered by the running kernel.
> 
> Adding an empty "chosen" node to the device tree fixes this issue. I've
> tested this with a WM8650-based laptop. Regrettably, I'd be lying if I
> said that I know exactly why this fixes the problem. However, I know
> that this solution works. I'm happy to hear suggestions/ridicule
> regarding these changes.
> 
> Finally, I have my suspicions that the WM8xxx series devices aren't the
> only ones affected by this issue. I think this solution, if acceptable,
> could be applied to other devices which may or may not be having issues
> related to appended DTBs and kernel parameters. Perhaps other devices
> which commit abe60a3a7 changed?
> 
> This is my first patch submission to the Linux kernel, so please tear it
> apart. Let me know what I've done incorrectly. And thanks, Alexey, for
> helping me along. I have much to learn and I wouldn't have made it half
> as far without his patience.
> 
> Thanks,
> Brigham Campbell
> 
> Signed-off-by: Brigham Campbell <me@brighamcampbell.com>
> 
> ---
>  arch/arm/boot/dts/wm8505.dtsi | 2 ++
>  arch/arm/boot/dts/wm8650.dtsi | 2 ++
>  arch/arm/boot/dts/wm8850.dtsi | 2 ++
>  3 files changed, 6 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/wm8505.dtsi b/arch/arm/boot/dts/wm8505.dtsi
> index 168cd12b07bc..2b814b48b458 100644
> --- a/arch/arm/boot/dts/wm8505.dtsi
> +++ b/arch/arm/boot/dts/wm8505.dtsi
> @@ -10,6 +10,8 @@ / {
>  	#size-cells = <1>;
>  	compatible = "wm,wm8505";
>  
> +	chosen {};
> +
>  	cpus {
>  		#address-cells = <0>;
>  		#size-cells = <0>;
> diff --git a/arch/arm/boot/dts/wm8650.dtsi b/arch/arm/boot/dts/wm8650.dtsi
> index bc057b6f7d16..a68c82c8035e 100644
> --- a/arch/arm/boot/dts/wm8650.dtsi
> +++ b/arch/arm/boot/dts/wm8650.dtsi
> @@ -10,6 +10,8 @@ / {
>  	#size-cells = <1>;
>  	compatible = "wm,wm8650";
>  
> +	chosen {};
> +
>  	cpus {
>  		#address-cells = <0>;
>  		#size-cells = <0>;
> diff --git a/arch/arm/boot/dts/wm8850.dtsi b/arch/arm/boot/dts/wm8850.dtsi
> index 65c9271050e6..c864883ae777 100644
> --- a/arch/arm/boot/dts/wm8850.dtsi
> +++ b/arch/arm/boot/dts/wm8850.dtsi
> @@ -10,6 +10,8 @@ / {
>  	#size-cells = <1>;
>  	compatible = "wm,wm8850";
>  
> +	chosen {};
> +
>  	cpus {
>  		#address-cells = <1>;
>  		#size-cells = <0>;
> -- 
> 2.28.0
> 

Sorry to generate another notification, but I don't believe I've
recieved a response on this patch in the ~two weeks it's been up. Did I
format something incorrectly or have I sent it to the wrong addresses?
Maybe the relevant maintainer has just been busy?

Thanks,
Brigham Campbell

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

end of thread, other threads:[~2020-10-24 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 16:57 [PATCH] ARM: dts: Add empty "chosen" node to WM8xxx device trees Brigham Campbell
2020-10-24 21:09 ` Brigham Campbell

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.