Skip to contentSkip to conversation

linux-next: manual merge of the irqchip tree with Linus' tree

DISCUSSION Stephen Rothwell 4 participants 5 messages Mar 16, 2015 – Apr 13, 2015

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

Hi Jason,

Today's linux-next merge of the irqchip tree got a conflict in arch/arm/mach-exynos/suspend.c between commit ace283a04a4a ("ARM:
EXYNOS: Fix wrong hwirq of RTC interrupt for Exynos3250 SoC") from Linus' tree and commit be42c9ea7b5f ("ARM: exynos4/5: convert pmu wakeup to stacked domains") from the irqchip tree.

I fixed it up (I just randomly chose to use the irqchip tree version) and can carry the fix as necessary (no action is required).

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#1 lore raw

Hi Stephen, Jason,

Quoted 11 lines · Stephen Rothwell

Hi Jason,

Today's linux-next merge of the irqchip tree got a conflict in arch/arm/mach-exynos/suspend.c between commit ace283a04a4a ("ARM:
EXYNOS: Fix wrong hwirq of RTC interrupt for Exynos3250 SoC") from Linus' tree and commit be42c9ea7b5f ("ARM: exynos4/5: convert pmu wakeup to stacked domains") from the irqchip tree.

I fixed it up (I just randomly chose to use the irqchip tree version) and can carry the fix as necessary (no action is required).

Actually, the fix is slightly less obvious, mostly because I introduced a bug while converting the code to stacked domains. I noticed that something was amiss in the Exynos code, but fixed it the wrong way (I assumed the DT was wrong, while it was the code).

Now, in the light of ace283a04a4a, the fix should be:

arch/arm/boot/dts/exynos3250.dtsi +1 -1
index 554e9be..580b2109 100644
@@ -186,7 +186,7 @@
 		rtc: rtc@10070000 {
 			compatible = "samsung,exynos3250-rtc";
 			reg = <0x10070000 0x100>;
-			interrupts = <0 41 0>, <0 42 0>;
+			interrupts = <0 73 0>, <0 74 0>;
 			interrupt-parent = <&pmu_system_controller>;
 			status = "disabled";
 		};
arch/arm/mach-exynos/suspend.c +2 -2
index 891e431..7b09e76 100644
@@ -89,8 +89,8 @@ static unsigned int exynos_pmu_spare3;
 static u32 exynos_irqwake_intmask = 0xffffffff;
 
 static const struct exynos_wkup_irq exynos3250_wkup_irq[] = {
-	{ 41, BIT(1) }, /* RTC alarm */
-	{ 42, BIT(2) }, /* RTC tick */
+	{ 73, BIT(1) }, /* RTC alarm */
+	{ 74, BIT(2) }, /* RTC tick */
 	{ /* sentinel */ },
 };
 

Jason, any chance you could apply this on top of be42c9ea7b5f? We'll still have a conflict when the two branches get merged, but at least we'll know what the resolution is.

Thanks,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#2 lore raw
Quoted 15 lines · Marc Zyngier

Hi Stephen, Jason,

Quoted 11 lines · Stephen Rothwell

Hi Jason,

Today's linux-next merge of the irqchip tree got a conflict in arch/arm/mach-exynos/suspend.c between commit ace283a04a4a ("ARM:
EXYNOS: Fix wrong hwirq of RTC interrupt for Exynos3250 SoC") from Linus' tree and commit be42c9ea7b5f ("ARM: exynos4/5: convert pmu wakeup to stacked domains") from the irqchip tree.

I fixed it up (I just randomly chose to use the irqchip tree version) and can carry the fix as necessary (no action is required).

Quoted 6 lines

Actually, the fix is slightly less obvious, mostly because I introduced a bug while converting the code to stacked domains. I noticed that something was amiss in the Exynos code, but fixed it the wrong way (I assumed the DT was wrong, while it was the code).

Now, in the light of ace283a04a4a, the fix should be:

Squashed in and a new irqchip/stacked-exynos posted. Result attached.

thx,

Jason.

--------------->8------------------------------------- commit 8b283c025443e4c3a3323c92777f422fa504caa5

Author: Marc Zyngier <[email protected]>
Date:   Wed Mar 11 15:44:52 2015 +0000

ARM: exynos4/5: convert pmu wakeup to stacked domains

Exynos has been (ab)using the gic_arch_extn to provide wakeup from suspend, and it makes a lot of sense to convert this code to use stacked domains instead.

This patch does just this, updating the DT files to actually reflect what the HW provides.

BIG FAT WARNING: because the DTs were so far lying by not exposing the fact that the PMU block is actually the first interrupt controller in the chain for RTC, kernels with this patch applied wont have any suspend-resume facility when booted with old DTs, and old kernels with updated DTs may not even boot.

Also, I strongly suspect that there is more than two wake-up interrupts on these platforms, but I leave it to the maintainers to fix their mess.

[ jac: squash in maz's fixup from
https://lkml.kernel.org/r/[email protected] ]

arch/arm/boot/dts/exynos3250.dtsi +4 -0
index 277b48b0b6f9..580b21095eab 100644
@@ -130,6 +130,9 @@
 		pmu_system_controller: system-controller@10020000 {
 			compatible = "samsung,exynos3250-pmu", "syscon";
 			reg = <0x10020000 0x4000>;
+			interrupt-controller;
+			#interrupt-cells = <3>;
+			interrupt-parent = <&gic>;
 		};
 
 		mipi_phy: video-phy@10020710 {
@@ -184,6 +187,7 @@
 			compatible = "samsung,exynos3250-rtc";
 			reg = <0x10070000 0x100>;
 			interrupts = <0 73 0>, <0 74 0>;
+			interrupt-parent = <&pmu_system_controller>;
 			status = "disabled";
 		};
 
arch/arm/boot/dts/exynos4.dtsi +4 -0
index 76173cacd450..1d21f0272390 100644
@@ -152,6 +152,9 @@
 	pmu_system_controller: system-controller@10020000 {
 		compatible = "samsung,exynos4210-pmu", "syscon";
 		reg = <0x10020000 0x4000>;
+		interrupt-controller;
+		#interrupt-cells = <3>;
+		interrupt-parent = <&gic>;
 	};
 
 	dsi_0: dsi@11C80000 {
@@ -264,6 +267,7 @@
 	rtc@10070000 {
 		compatible = "samsung,s3c6410-rtc";
 		reg = <0x10070000 0x100>;
+		interrupt-parent = <&pmu_system_controller>;
 		interrupts = <0 44 0>, <0 45 0>;
 		clocks = <&clock CLK_RTC>;
 		clock-names = "rtc";
arch/arm/boot/dts/exynos5250.dtsi +4 -0
index 9bb1b0b738f5..72fa2d196629 100644
@@ -196,6 +196,9 @@
 		clock-names = "clkout16";
 		clocks = <&clock CLK_FIN_PLL>;
 		#clock-cells = <1>;
+		interrupt-controller;
+		#interrupt-cells = <3>;
+		interrupt-parent = <&gic>;
 	};
 
 	sysreg_system_controller: syscon@10050000 {
@@ -232,6 +235,7 @@
 	rtc: rtc@101E0000 {
 		clocks = <&clock CLK_RTC>;
 		clock-names = "rtc";
+		interrupt-parent = <&pmu_system_controller>;
 		status = "disabled";
 	};
 
arch/arm/boot/dts/exynos5420.dtsi +4 -0
index 9dc2e9773b30..d11a6ab4ecd2 100644
@@ -327,6 +327,7 @@
 	rtc: rtc@101E0000 {
 		clocks = <&clock CLK_RTC>;
 		clock-names = "rtc";
+		interrupt-parent = <&pmu_system_controller>;
 		status = "disabled";
 	};
 
@@ -769,6 +770,9 @@
 		clock-names = "clkout16";
 		clocks = <&clock CLK_FIN_PLL>;
 		#clock-cells = <1>;
+		interrupt-controller;
+		#interrupt-cells = <3>;
+		interrupt-parent = <&gic>;
 	};
 
 	sysreg_system_controller: syscon@10050000 {
arch/arm/mach-exynos/exynos.c +5 -10
index 9e9dfdfad9d7..f44c2e05c82e 100644
@@ -166,16 +166,14 @@ static void __init exynos_init_io(void)
 	exynos_map_io();
 }
 
+/*
+ * Apparently, these SoCs are not able to wake-up from suspend using
+ * the PMU. Too bad. Should they suddenly become capable of such a
+ * feat, the matches below should be moved to suspend.c.
+ */
 static const struct of_device_id exynos_dt_pmu_match[] = {
-	{ .compatible = "samsung,exynos3250-pmu" },
-	{ .compatible = "samsung,exynos4210-pmu" },
-	{ .compatible = "samsung,exynos4212-pmu" },
-	{ .compatible = "samsung,exynos4412-pmu" },
-	{ .compatible = "samsung,exynos4415-pmu" },
-	{ .compatible = "samsung,exynos5250-pmu" },
 	{ .compatible = "samsung,exynos5260-pmu" },
 	{ .compatible = "samsung,exynos5410-pmu" },
-	{ .compatible = "samsung,exynos5420-pmu" },
 	{ /*sentinel*/ },
 };
 
@@ -186,9 +184,6 @@ static void exynos_map_pmu(void)
 	np = of_find_matching_node(NULL, exynos_dt_pmu_match);
 	if (np)
 		pmu_base_addr = of_iomap(np, 0);
-
-	if (!pmu_base_addr)
-		panic("failed to find exynos pmu register\n");
 }
 
 static void __init exynos_init_irq(void)
arch/arm/mach-exynos/suspend.c +123 -12

175 lines not on this page · raw message

#3 lore raw
Quoted 16 lines · Jason Cooper
Quoted 15 lines · Marc Zyngier

Hi Stephen, Jason,

Quoted 11 lines · Stephen Rothwell

Hi Jason,

Today's linux-next merge of the irqchip tree got a conflict in arch/arm/mach-exynos/suspend.c between commit ace283a04a4a ("ARM:
EXYNOS: Fix wrong hwirq of RTC interrupt for Exynos3250 SoC") from Linus' tree and commit be42c9ea7b5f ("ARM: exynos4/5: convert pmu wakeup to stacked domains") from the irqchip tree.

I fixed it up (I just randomly chose to use the irqchip tree version) and can carry the fix as necessary (no action is required).

Quoted 8 lines
Quoted 6 lines

Actually, the fix is slightly less obvious, mostly because I introduced a bug while converting the code to stacked domains. I noticed that something was amiss in the Exynos code, but fixed it the wrong way (I assumed the DT was wrong, while it was the code).

Now, in the light of ace283a04a4a, the fix should be:

Squashed in and a new irqchip/stacked-exynos posted. Result attached.

[...]

Looks good, thanks Jason. There will be a small fixup for the Exynos tree, adjusting their RTC irqs in the right direction, but I'll provide this independently.

Thanks again,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#4 lore raw
In reply to Jason Cooper
Quoted 14 lines · Jason Cooper
arch/arm/mach-exynos/suspend.c +3 -2
@@ -615,17 +724,19 @@ static struct syscore_ops exynos_pm_syscore_ops;
 void __init exynos_pm_init(void)
 {
        const struct of_device_id *match;
+       struct device_node *np;
        u32 tmp;
 
-       of_find_matching_node_and_match(NULL, exynos_pmu_of_device_ids, &match);
-       if (!match) {
+       np = of_find_matching_node_and_match(NULL, exynos_pmu_of_device_ids, &match);
+       if (!np) {
                pr_err("Failed to find PMU node\n");

arch/arm/mach-exynos/suspend.c static struct syscore_ops exynos_pm_syscore_ops; · line 739

Quoted 10 lines
arch/arm/mach-exynos/suspend.c +4 -3
                return;
        }
-       pm_data = (struct exynos_pm_data *) match->data;
 
-       /* Platform-specific GIC callback */
-       gic_arch_extn.irq_set_wake = exynos_irq_set_wake;
+       if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL)))
+               pr_warn("Outdated DT detected, suspend/resume will NOT work\n");
+
+       pm_data = (struct exynos_pm_data *) match->data;

Upon first look, the cast above should be "const".
Upon second look, the cast is not needed at all (assigning "const void *" to "const struct exynos_pm_data *").

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds