Skip to contentSkip to conversation

clk: nomadik: fix multiplatform problem

PATCH New Linus Walleij 3 participants 5 messages Jan 21, 2014 – Feb 26, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: nomadik: fix multiplatform problem

The Nomadik debugfs screws up multiplatform boots if debugfs is enabled on the multiplatform image, since it's a simple initcall that is unconditionally executed and reads from certain memory locations.

Fix this by checking that the driver has been properly initialized, so a base offset to the Nomadik SRC controller exists, before proceeding to register debugfs files.

---
 drivers/clk/clk-nomadik.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/clk-nomadik.c +3 -0
index 6a934a5296bd..05e04ce0f148 100644
@@ -494,6 +494,9 @@ static const struct file_operations nomadik_src_clk_debugfs_ops = {
 
 static int __init nomadik_src_clk_init_debugfs(void)
 {
+	/* Vital for multiplatform */
+	if (!src_base)
+		return -ENODEV;
 	src_pcksr0_boot = readl(src_base + SRC_PCKSR0);
 	src_pcksr1_boot = readl(src_base + SRC_PCKSR1);
 	debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO,
Signature · 1 line
1.8.4.2
#1 lore raw

PATCH 1/1 clk: nomadik: fix multiplatform problem

Quoted 11 lines · Linus Walleij

The Nomadik debugfs screws up multiplatform boots if debugfs is enabled on the multiplatform image, since it's a simple initcall that is unconditionally executed and reads from certain memory locations.

Fix this by checking that the driver has been properly initialized, so a base offset to the Nomadik SRC controller exists, before proceeding to register debugfs files.

Hi Linus

Thanks for fixing this so quick. I tested on my kirkwood, no longer crashes.

Thanks
Andrew

Quoted 26 lines
---
 drivers/clk/clk-nomadik.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/clk-nomadik.c +3 -0
index 6a934a5296bd..05e04ce0f148 100644
@@ -494,6 +494,9 @@ static const struct file_operations nomadik_src_clk_debugfs_ops = {
 
 static int __init nomadik_src_clk_init_debugfs(void)
 {
+	/* Vital for multiplatform */
+	if (!src_base)
+		return -ENODEV;
 	src_pcksr0_boot = readl(src_base + SRC_PCKSR0);
 	src_pcksr1_boot = readl(src_base + SRC_PCKSR1);
 	debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO,
Signature · 7 lines
1.8.4.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH 1/1 clk: nomadik: fix multiplatform problem

In reply to Linus Walleij
Quoted 11 lines · Linus Walleij

The Nomadik debugfs screws up multiplatform boots if debugfs is enabled on the multiplatform image, since it's a simple initcall that is unconditionally executed and reads from certain memory locations.

Fix this by checking that the driver has been properly initialized, so a base offset to the Nomadik SRC controller exists, before proceeding to register debugfs files.

Ping Mike, pls pick this for fixes!

Yours,
Linus Walleij

#3 lore raw

PATCH 1/1 clk: nomadik: fix multiplatform problem

Quoted 7 lines · Linus Walleij
Quoted 5 lines · Linus Walleij

The Nomadik debugfs screws up multiplatform boots if debugfs is enabled on the multiplatform image, since it's a simple initcall that is unconditionally executed and reads from certain memory locations.

Quoted 8 lines
Quoted 6 lines

Fix this by checking that the driver has been properly initialized, so a base offset to the Nomadik SRC controller exists, before proceeding to register debugfs files.

Ping Mike, pls pick this for fixes!

Ping Mike, this needs to go into fixes!

ARM SoC folks: Mike seems to be busy, maybe you can pick this patch into the ARM SoC tree instead?

Yours,
Linus Walleij

#4 lore raw

PATCH 1/1 clk: nomadik: fix multiplatform problem

Quoting Linus Walleij (2014-02-25 13:35:37)

Quoted 12 lines · Linus Walleij
Quoted 11 lines · Linus Walleij
Quoted 10 lines

The Nomadik debugfs screws up multiplatform boots if debugfs is enabled on the multiplatform image, since it's a simple initcall that is unconditionally executed and reads from certain memory locations.

Fix this by checking that the driver has been properly initialized, so a base offset to the Nomadik SRC controller exists, before proceeding to register debugfs files.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Ping Mike, pls pick this for fixes!

Ping Mike, this needs to go into fixes!

Taken into clk-fixes for the next batch.

Thanks!
Mike

Quoted 6 lines

ARM SoC folks: Mike seems to be busy, maybe you can pick this patch into the ARM SoC tree instead?

Yours,
Linus Walleij