Skip to contentSkip to conversation

Fixes for 3.8-rc1

PATCH New Andrew Lunn 2 participants 4 messages Dec 18, 2012 – Dec 27, 2012

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

cover Fixes for 3.8-rc1

These two patches are fixes needed for Linux 3.8.

The first patch fixes a lockup due to the missing SDIO clock. Since the clkdev alias is missing, the sdio driver fails to clk_prepare_enable() the clock. The lateinit call in the clk framework then disables the clock since nobody owns it. The next access to the SDIO register space causes the SoC to lockup.

The second patch fixes a null-pointer dereference. The conversion of Kirkwood to pinctrl/gpio resulted in that using GPIO calls inside the board-*.c file causes an exception, since the gpio driver has not yet been loaded. Topkick is using the GPIO to control power to the SATA0 device. So convert the gpio to a fixed regulator, in DT, which gets loaded after the gpio driver is available.

Andrew Lunn (2):
ARM: Kirkwood: Fix missing sdio clock
ARM: Kirkwood: Use fixed-regulator instead of board gpio call

 arch/arm/boot/dts/kirkwood-topkick.dts     |   17 +++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c          |    4 ++++
 arch/arm/mach-kirkwood/board-usi_topkick.c |    4 ----
 3 files changed, 21 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/2 ARM: Kirkwood: Fix missing sdio clock

We moved to declaring clk gates in DT. However, device which do not yet have a DT binding need to have a clkdev alias. This was missing for SDIO.

---
 arch/arm/mach-kirkwood/board-dt.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-kirkwood/board-dt.c +4 -0
index ff4150a..de4fd2b 100644
@@ -67,6 +67,10 @@ static void __init kirkwood_legacy_clk_init(void)
 	orion_clkdev_add(NULL, "mv643xx_eth_port.1",
 			 of_clk_get_from_provider(&clkspec));
 
+	clkspec.args[0] = CGC_BIT_SDIO;
+	orion_clkdev_add(NULL, "mvsdio",
+			 of_clk_get_from_provider(&clkspec));
+
 }
 
 static void __init kirkwood_of_clk_init(void)
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/2 ARM: Kirkwood: Use fixed-regulator instead of board gpio call

In reply to Andrew Lunn

With the change to a DT based pinctrl/gpio driver, using gpio API calls in board-*.c files no longer works, a dereferenced NULL pointer exception occurs instead. By converting the GPIO code into a fixed-regulator which gets probed later once pinctrl/gpio is available, we avoid the exception.

---
 arch/arm/boot/dts/kirkwood-topkick.dts     |   17 +++++++++++++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c |    4 ----
 2 files changed, 17 insertions(+), 4 deletions(-)
arch/arm/boot/dts/kirkwood-topkick.dts +17 -0
index c0de5a7..cd15452 100644
@@ -82,4 +82,21 @@
 			gpios = <&gpio1 16 1>;
 		};
 	};
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		sata0_power: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "SATA0 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio1 4 0>;
+		};
+	};
 };
arch/arm/mach-kirkwood/board-usi_topkick.c +0 -4
index 15e69fc..23d2dd1 100644
@@ -64,8 +64,6 @@ static unsigned int topkick_mpp_config[] __initdata = {
 	0
 };
 
-#define TOPKICK_SATA0_PWR_ENABLE 36
-
 void __init usi_topkick_init(void)
 {
 	/*
@@ -73,8 +71,6 @@ void __init usi_topkick_init(void)
 	 */
 	kirkwood_mpp_conf(topkick_mpp_config);
 
-	/* SATA0 power enable */
-	gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);
 
 	kirkwood_ge00_init(&topkick_ge00_data);
 	kirkwood_sdio_init(&topkick_mvsdio_data);
Signature · 1 line
1.7.10.4
#3 lore raw

cover Fixes for 3.8-rc1

In reply to Andrew Lunn
Quoted 15 lines · Andrew Lunn

These two patches are fixes needed for Linux 3.8.

The first patch fixes a lockup due to the missing SDIO clock. Since the clkdev alias is missing, the sdio driver fails to clk_prepare_enable() the clock. The lateinit call in the clk framework then disables the clock since nobody owns it. The next access to the SDIO register space causes the SoC to lockup.

The second patch fixes a null-pointer dereference. The conversion of Kirkwood to pinctrl/gpio resulted in that using GPIO calls inside the board-*.c file causes an exception, since the gpio driver has not yet been loaded. Topkick is using the GPIO to control power to the SATA0 device. So convert the gpio to a fixed regulator, in DT, which gets loaded after the gpio driver is available.

Quoted 9 lines

Andrew Lunn (2):
ARM: Kirkwood: Fix missing sdio clock
ARM: Kirkwood: Use fixed-regulator instead of board gpio call

 arch/arm/boot/dts/kirkwood-topkick.dts     |   17 +++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c          |    4 ++++
 arch/arm/mach-kirkwood/board-usi_topkick.c |    4 ----
 3 files changed, 21 insertions(+), 4 deletions(-)
Signature · 2 lines
MPL AG, Switzerland                     http://www.mpl.ch
Tel. +41 (0)56 483 34 34          Fax: +41(0)56 493 30 20