All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 18:57 ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

    Hi all,

This patch series fixes a problem when the thermal-rcar device is
instantiated from the device tree on the r8a7791-based Koelsch development
board. The driver fails during initialization with:

    rcar_thermal e61f0000.thermal: thermal sensor was broken

This does not happen when using legacy platform devices.

This series was tested using Koelsch reference (DT) and non-reference
(legacy) kernel configurations. It was not tested on r8a7790/Lager
(which is very similar).

    [1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
    [2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
    [3/4] thermal: rcar: Add missing clock handling
    [4/4] thermal: rcar: Spelling s/delaye/delay/g

Thanks for your comments!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* [PATCH 0/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 18:57 ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto
  Cc: linux-sh, linux-arm-kernel, linux-pm

    Hi all,

This patch series fixes a problem when the thermal-rcar device is
instantiated from the device tree on the r8a7791-based Koelsch development
board. The driver fails during initialization with:

    rcar_thermal e61f0000.thermal: thermal sensor was broken

This does not happen when using legacy platform devices.

This series was tested using Koelsch reference (DT) and non-reference
(legacy) kernel configurations. It was not tested on r8a7790/Lager
(which is very similar).

    [1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
    [2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
    [3/4] thermal: rcar: Add missing clock handling
    [4/4] thermal: rcar: Spelling s/delaye/delay/g

Thanks for your comments!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* [PATCH 0/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 18:57 ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

    Hi all,

This patch series fixes a problem when the thermal-rcar device is
instantiated from the device tree on the r8a7791-based Koelsch development
board. The driver fails during initialization with:

    rcar_thermal e61f0000.thermal: thermal sensor was broken

This does not happen when using legacy platform devices.

This series was tested using Koelsch reference (DT) and non-reference
(legacy) kernel configurations. It was not tested on r8a7790/Lager
(which is very similar).

    [1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
    [2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
    [3/4] thermal: rcar: Add missing clock handling
    [4/4] thermal: rcar: Spelling s/delaye/delay/g

Thanks for your comments!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

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

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

* [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
  2014-01-07 18:57 ` Geert Uytterhoeven
  (?)
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Add the missing thermal MSTP clock to the thermal device node.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 arch/arm/boot/dts/r8a7791.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index d8dbf7e7b6a9..3233041d8a44 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -151,6 +151,7 @@
 		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
 	};
 
 	timer {
-- 
1.7.9.5


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

* [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto
  Cc: linux-sh, linux-arm-kernel, linux-pm, Geert Uytterhoeven

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Add the missing thermal MSTP clock to the thermal device node.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 arch/arm/boot/dts/r8a7791.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index d8dbf7e7b6a9..3233041d8a44 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -151,6 +151,7 @@
 		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
 	};
 
 	timer {
-- 
1.7.9.5


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

* [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Add the missing thermal MSTP clock to the thermal device node.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 arch/arm/boot/dts/r8a7791.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index d8dbf7e7b6a9..3233041d8a44 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -151,6 +151,7 @@
 		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
 	};
 
 	timer {
-- 
1.7.9.5

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

* [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
  2014-01-07 18:57 ` Geert Uytterhoeven
  (?)
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Add the missing thermal MSTP clock to the thermal device node.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 arch/arm/boot/dts/r8a7790.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index f48487c2a970..b53834e6a55f 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -168,6 +168,7 @@
 		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
 	};
 
 	timer {
-- 
1.7.9.5


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

* [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto
  Cc: linux-sh, linux-arm-kernel, linux-pm, Geert Uytterhoeven

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Add the missing thermal MSTP clock to the thermal device node.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 arch/arm/boot/dts/r8a7790.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index f48487c2a970..b53834e6a55f 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -168,6 +168,7 @@
 		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
 	};
 
 	timer {
-- 
1.7.9.5


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

* [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Add the missing thermal MSTP clock to the thermal device node.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 arch/arm/boot/dts/r8a7790.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index f48487c2a970..b53834e6a55f 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -168,6 +168,7 @@
 		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
 	};
 
 	timer {
-- 
1.7.9.5

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-07 18:57 ` Geert Uytterhoeven
  (?)
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

When using DT to instantiate the rcar-thermal device, it prints the
following error:

    rcar_thermal e61f0000.thermal: thermal sensor was broken

Explicitly request and enable the thermal clock to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
 1 file changed, 33 insertions(+), 7 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 88f92e1a9944..a5629500723a 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -17,6 +17,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
+#include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/irq.h>
@@ -53,6 +54,7 @@ struct rcar_thermal_common {
 	struct device *dev;
 	struct list_head head;
 	spinlock_t lock;
+	struct clk *clk;
 };
 
 struct rcar_thermal_priv {
@@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	spin_lock_init(&common->lock);
 	common->dev = dev;
 
+	common->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(common->clk)) {
+		dev_err(&pdev->dev, "cannot get clock\n");
+		return PTR_ERR(common->clk);
+	}
+
+	ret = clk_prepare(common->clk);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "unable to prepare clock\n");
+		return ret;
+	}
+
+	clk_enable(common->clk);
+
 	pm_runtime_enable(dev);
 	pm_runtime_get_sync(dev);
 
 	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (irq) {
-		int ret;
+		int ret2;
 
 		/*
 		 * platform has IRQ support.
 		 * Then, drier use common register
 		 */
 
-		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
-				       dev_name(dev), common);
-		if (ret) {
+		ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
+					dev_name(dev), common);
+		if (ret2) {
 			dev_err(dev, "irq request failed\n ");
-			return ret;
+			ret = ret2;
+			goto error_unpm;
 		}
 
 		/*
@@ -402,8 +419,10 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		 */
 		res = platform_get_resource(pdev, IORESOURCE_MEM, mres++);
 		common->base = devm_ioremap_resource(dev, res);
-		if (IS_ERR(common->base))
-			return PTR_ERR(common->base);
+		if (IS_ERR(common->base)) {
+			ret = PTR_ERR(common->base);
+			goto error_unpm;
+		}
 
 		/* enable temperature comparation */
 		rcar_thermal_common_write(common, ENR, 0x00030303);
@@ -465,9 +484,13 @@ error_unregister:
 			rcar_thermal_irq_disable(priv);
 	}
 
+error_unpm:
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
+	clk_disable(common->clk);
+	clk_unprepare(common->clk);
+
 	return ret;
 }
 
@@ -486,6 +509,9 @@ static int rcar_thermal_remove(struct platform_device *pdev)
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
+	clk_disable(common->clk);
+	clk_unprepare(common->clk);
+
 	return 0;
 }
 
-- 
1.7.9.5


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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto
  Cc: linux-sh, linux-arm-kernel, linux-pm, Geert Uytterhoeven

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

When using DT to instantiate the rcar-thermal device, it prints the
following error:

    rcar_thermal e61f0000.thermal: thermal sensor was broken

Explicitly request and enable the thermal clock to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
 1 file changed, 33 insertions(+), 7 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 88f92e1a9944..a5629500723a 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -17,6 +17,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
+#include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/irq.h>
@@ -53,6 +54,7 @@ struct rcar_thermal_common {
 	struct device *dev;
 	struct list_head head;
 	spinlock_t lock;
+	struct clk *clk;
 };
 
 struct rcar_thermal_priv {
@@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	spin_lock_init(&common->lock);
 	common->dev = dev;
 
+	common->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(common->clk)) {
+		dev_err(&pdev->dev, "cannot get clock\n");
+		return PTR_ERR(common->clk);
+	}
+
+	ret = clk_prepare(common->clk);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "unable to prepare clock\n");
+		return ret;
+	}
+
+	clk_enable(common->clk);
+
 	pm_runtime_enable(dev);
 	pm_runtime_get_sync(dev);
 
 	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (irq) {
-		int ret;
+		int ret2;
 
 		/*
 		 * platform has IRQ support.
 		 * Then, drier use common register
 		 */
 
-		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
-				       dev_name(dev), common);
-		if (ret) {
+		ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
+					dev_name(dev), common);
+		if (ret2) {
 			dev_err(dev, "irq request failed\n ");
-			return ret;
+			ret = ret2;
+			goto error_unpm;
 		}
 
 		/*
@@ -402,8 +419,10 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		 */
 		res = platform_get_resource(pdev, IORESOURCE_MEM, mres++);
 		common->base = devm_ioremap_resource(dev, res);
-		if (IS_ERR(common->base))
-			return PTR_ERR(common->base);
+		if (IS_ERR(common->base)) {
+			ret = PTR_ERR(common->base);
+			goto error_unpm;
+		}
 
 		/* enable temperature comparation */
 		rcar_thermal_common_write(common, ENR, 0x00030303);
@@ -465,9 +484,13 @@ error_unregister:
 			rcar_thermal_irq_disable(priv);
 	}
 
+error_unpm:
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
+	clk_disable(common->clk);
+	clk_unprepare(common->clk);
+
 	return ret;
 }
 
@@ -486,6 +509,9 @@ static int rcar_thermal_remove(struct platform_device *pdev)
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
+	clk_disable(common->clk);
+	clk_unprepare(common->clk);
+
 	return 0;
 }
 
-- 
1.7.9.5


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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

When using DT to instantiate the rcar-thermal device, it prints the
following error:

    rcar_thermal e61f0000.thermal: thermal sensor was broken

Explicitly request and enable the thermal clock to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
 1 file changed, 33 insertions(+), 7 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 88f92e1a9944..a5629500723a 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -17,6 +17,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
+#include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/irq.h>
@@ -53,6 +54,7 @@ struct rcar_thermal_common {
 	struct device *dev;
 	struct list_head head;
 	spinlock_t lock;
+	struct clk *clk;
 };
 
 struct rcar_thermal_priv {
@@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	spin_lock_init(&common->lock);
 	common->dev = dev;
 
+	common->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(common->clk)) {
+		dev_err(&pdev->dev, "cannot get clock\n");
+		return PTR_ERR(common->clk);
+	}
+
+	ret = clk_prepare(common->clk);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "unable to prepare clock\n");
+		return ret;
+	}
+
+	clk_enable(common->clk);
+
 	pm_runtime_enable(dev);
 	pm_runtime_get_sync(dev);
 
 	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (irq) {
-		int ret;
+		int ret2;
 
 		/*
 		 * platform has IRQ support.
 		 * Then, drier use common register
 		 */
 
-		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
-				       dev_name(dev), common);
-		if (ret) {
+		ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
+					dev_name(dev), common);
+		if (ret2) {
 			dev_err(dev, "irq request failed\n ");
-			return ret;
+			ret = ret2;
+			goto error_unpm;
 		}
 
 		/*
@@ -402,8 +419,10 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		 */
 		res = platform_get_resource(pdev, IORESOURCE_MEM, mres++);
 		common->base = devm_ioremap_resource(dev, res);
-		if (IS_ERR(common->base))
-			return PTR_ERR(common->base);
+		if (IS_ERR(common->base)) {
+			ret = PTR_ERR(common->base);
+			goto error_unpm;
+		}
 
 		/* enable temperature comparation */
 		rcar_thermal_common_write(common, ENR, 0x00030303);
@@ -465,9 +484,13 @@ error_unregister:
 			rcar_thermal_irq_disable(priv);
 	}
 
+error_unpm:
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
+	clk_disable(common->clk);
+	clk_unprepare(common->clk);
+
 	return ret;
 }
 
@@ -486,6 +509,9 @@ static int rcar_thermal_remove(struct platform_device *pdev)
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
+	clk_disable(common->clk);
+	clk_unprepare(common->clk);
+
 	return 0;
 }
 
-- 
1.7.9.5

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

* [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
  2014-01-07 18:57 ` Geert Uytterhoeven
  (?)
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Cc: Jiri Kosina <trivial@kernel.org>
---
 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index a5629500723a..32d591087307 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		/* enable temperature comparation */
 		rcar_thermal_common_write(common, ENR, 0x00030303);
 
-		idle = 0; /* polling delaye is not needed */
+		idle = 0; /* polling delay is not needed */
 	}
 
 	for (i = 0;; i++) {
-- 
1.7.9.5


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

* [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto
  Cc: linux-sh, linux-arm-kernel, linux-pm, Geert Uytterhoeven, Jiri Kosina

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Cc: Jiri Kosina <trivial@kernel.org>
---
 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index a5629500723a..32d591087307 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		/* enable temperature comparation */
 		rcar_thermal_common_write(common, ENR, 0x00030303);
 
-		idle = 0; /* polling delaye is not needed */
+		idle = 0; /* polling delay is not needed */
 	}
 
 	for (i = 0;; i++) {
-- 
1.7.9.5


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

* [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
@ 2014-01-07 18:57   ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Cc: Jiri Kosina <trivial@kernel.org>
---
 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index a5629500723a..32d591087307 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		/* enable temperature comparation */
 		rcar_thermal_common_write(common, ENR, 0x00030303);
 
-		idle = 0; /* polling delaye is not needed */
+		idle = 0; /* polling delay is not needed */
 	}
 
 	for (i = 0;; i++) {
-- 
1.7.9.5

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-07 18:57   ` Geert Uytterhoeven
  (?)
@ 2014-01-07 20:04     ` Sergei Shtylyov
  -1 siblings, 0 replies; 73+ messages in thread
From: Sergei Shtylyov @ 2014-01-07 20:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 07-01-2014 22:57, Geert Uytterhoeven wrote:

> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

> When using DT to instantiate the rcar-thermal device, it prints the
> following error:

>      rcar_thermal e61f0000.thermal: thermal sensor was broken

> Explicitly request and enable the thermal clock to fix this.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> ---
>   drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
>   1 file changed, 33 insertions(+), 7 deletions(-)

> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 88f92e1a9944..a5629500723a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
[...]
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
[...]
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +

    Why not just clk_prepare_enable()?

[...]
> @@ -465,9 +484,13 @@ error_unregister:
>   			rcar_thermal_irq_disable(priv);
>   	}
>
> +error_unpm:
>   	pm_runtime_put_sync(dev);
>   	pm_runtime_disable(dev);
>
> +	clk_disable(common->clk);
> +	clk_unprepare(common->clk);
> +

    Why not just clk_disable_unprepare()?

>   	return ret;
>   }
>
> @@ -486,6 +509,9 @@ static int rcar_thermal_remove(struct platform_device *pdev)
>   	pm_runtime_put_sync(dev);
>   	pm_runtime_disable(dev);
>
> +	clk_disable(common->clk);
> +	clk_unprepare(common->clk);
> +

    Likewise.

WBR, Sergei


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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 20:04     ` Sergei Shtylyov
  0 siblings, 0 replies; 73+ messages in thread
From: Sergei Shtylyov @ 2014-01-07 20:04 UTC (permalink / raw)
  To: Geert Uytterhoeven, Zhang Rui, Eduardo Valentin, Simon Horman,
	Magnus Damm, Kuninori Morimoto
  Cc: linux-sh, linux-arm-kernel, linux-pm, Geert Uytterhoeven

Hello.

On 07-01-2014 22:57, Geert Uytterhoeven wrote:

> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

> When using DT to instantiate the rcar-thermal device, it prints the
> following error:

>      rcar_thermal e61f0000.thermal: thermal sensor was broken

> Explicitly request and enable the thermal clock to fix this.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> ---
>   drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
>   1 file changed, 33 insertions(+), 7 deletions(-)

> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 88f92e1a9944..a5629500723a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
[...]
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
[...]
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +

    Why not just clk_prepare_enable()?

[...]
> @@ -465,9 +484,13 @@ error_unregister:
>   			rcar_thermal_irq_disable(priv);
>   	}
>
> +error_unpm:
>   	pm_runtime_put_sync(dev);
>   	pm_runtime_disable(dev);
>
> +	clk_disable(common->clk);
> +	clk_unprepare(common->clk);
> +

    Why not just clk_disable_unprepare()?

>   	return ret;
>   }
>
> @@ -486,6 +509,9 @@ static int rcar_thermal_remove(struct platform_device *pdev)
>   	pm_runtime_put_sync(dev);
>   	pm_runtime_disable(dev);
>
> +	clk_disable(common->clk);
> +	clk_unprepare(common->clk);
> +

    Likewise.

WBR, Sergei


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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 20:04     ` Sergei Shtylyov
  0 siblings, 0 replies; 73+ messages in thread
From: Sergei Shtylyov @ 2014-01-07 20:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 07-01-2014 22:57, Geert Uytterhoeven wrote:

> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

> When using DT to instantiate the rcar-thermal device, it prints the
> following error:

>      rcar_thermal e61f0000.thermal: thermal sensor was broken

> Explicitly request and enable the thermal clock to fix this.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> ---
>   drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
>   1 file changed, 33 insertions(+), 7 deletions(-)

> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 88f92e1a9944..a5629500723a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
[...]
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
[...]
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +

    Why not just clk_prepare_enable()?

[...]
> @@ -465,9 +484,13 @@ error_unregister:
>   			rcar_thermal_irq_disable(priv);
>   	}
>
> +error_unpm:
>   	pm_runtime_put_sync(dev);
>   	pm_runtime_disable(dev);
>
> +	clk_disable(common->clk);
> +	clk_unprepare(common->clk);
> +

    Why not just clk_disable_unprepare()?

>   	return ret;
>   }
>
> @@ -486,6 +509,9 @@ static int rcar_thermal_remove(struct platform_device *pdev)
>   	pm_runtime_put_sync(dev);
>   	pm_runtime_disable(dev);
>
> +	clk_disable(common->clk);
> +	clk_unprepare(common->clk);
> +

    Likewise.

WBR, Sergei

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-07 18:57   ` Geert Uytterhoeven
  (?)
@ 2014-01-07 20:57     ` Gerhard Sittig
  -1 siblings, 0 replies; 73+ messages in thread
From: Gerhard Sittig @ 2014-01-07 20:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 07, 2014 at 19:57 +0100, Geert Uytterhoeven wrote:
> 
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	spin_lock_init(&common->lock);
>  	common->dev = dev;
>  
> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>  	pm_runtime_enable(dev);
>  	pm_runtime_get_sync(dev);

clk_enable() can fail, too, so you should check its return value


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office@denx.de

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 20:57     ` Gerhard Sittig
  0 siblings, 0 replies; 73+ messages in thread
From: Gerhard Sittig @ 2014-01-07 20:57 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, Geert Uytterhoeven, linux-pm,
	linux-arm-kernel, linux-sh

On Tue, Jan 07, 2014 at 19:57 +0100, Geert Uytterhoeven wrote:
> 
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	spin_lock_init(&common->lock);
>  	common->dev = dev;
>  
> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>  	pm_runtime_enable(dev);
>  	pm_runtime_get_sync(dev);

clk_enable() can fail, too, so you should check its return value


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office@denx.de

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 20:57     ` Gerhard Sittig
  0 siblings, 0 replies; 73+ messages in thread
From: Gerhard Sittig @ 2014-01-07 20:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 07, 2014 at 19:57 +0100, Geert Uytterhoeven wrote:
> 
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	spin_lock_init(&common->lock);
>  	common->dev = dev;
>  
> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>  	pm_runtime_enable(dev);
>  	pm_runtime_get_sync(dev);

clk_enable() can fail, too, so you should check its return value


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de

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

* Re: [PATCH 0/4] thermal: rcar: Add missing clock handling
  2014-01-07 18:57 ` Geert Uytterhoeven
  (?)
@ 2014-01-07 21:52   ` Valentine
  -1 siblings, 0 replies; 73+ messages in thread
From: Valentine @ 2014-01-07 21:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/07/2014 10:57 PM, Geert Uytterhoeven wrote:
>      Hi all,

Hi Geert,

>
> This patch series fixes a problem when the thermal-rcar device is
> instantiated from the device tree on the r8a7791-based Koelsch development
> board. The driver fails during initialization with:

I think explicitly acquiring the clocks should not be needed.
Could you please try the patches from the following series instead?

http://marc.info/?l=linux-sh&m\x138823255807611&w=2

Thanks,
Val.

>
>      rcar_thermal e61f0000.thermal: thermal sensor was broken
>
> This does not happen when using legacy platform devices.
>
> This series was tested using Koelsch reference (DT) and non-reference
> (legacy) kernel configurations. It was not tested on r8a7790/Lager
> (which is very similar).
>
>      [1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
>      [2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
>      [3/4] thermal: rcar: Add missing clock handling
>      [4/4] thermal: rcar: Spelling s/delaye/delay/g
>

> Thanks for your comments!
>
> Gr{oetje,eeting}s,
>
> 						Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


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

* Re: [PATCH 0/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 21:52   ` Valentine
  0 siblings, 0 replies; 73+ messages in thread
From: Valentine @ 2014-01-07 21:52 UTC (permalink / raw)
  To: Geert Uytterhoeven, Zhang Rui, Eduardo Valentin, Simon Horman,
	Magnus Damm, Kuninori Morimoto
  Cc: linux-sh, linux-arm-kernel, linux-pm

On 01/07/2014 10:57 PM, Geert Uytterhoeven wrote:
>      Hi all,

Hi Geert,

>
> This patch series fixes a problem when the thermal-rcar device is
> instantiated from the device tree on the r8a7791-based Koelsch development
> board. The driver fails during initialization with:

I think explicitly acquiring the clocks should not be needed.
Could you please try the patches from the following series instead?

http://marc.info/?l=linux-sh&m=138823255807611&w=2

Thanks,
Val.

>
>      rcar_thermal e61f0000.thermal: thermal sensor was broken
>
> This does not happen when using legacy platform devices.
>
> This series was tested using Koelsch reference (DT) and non-reference
> (legacy) kernel configurations. It was not tested on r8a7790/Lager
> (which is very similar).
>
>      [1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
>      [2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
>      [3/4] thermal: rcar: Add missing clock handling
>      [4/4] thermal: rcar: Spelling s/delaye/delay/g
>

> Thanks for your comments!
>
> Gr{oetje,eeting}s,
>
> 						Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


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

* [PATCH 0/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 21:52   ` Valentine
  0 siblings, 0 replies; 73+ messages in thread
From: Valentine @ 2014-01-07 21:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/07/2014 10:57 PM, Geert Uytterhoeven wrote:
>      Hi all,

Hi Geert,

>
> This patch series fixes a problem when the thermal-rcar device is
> instantiated from the device tree on the r8a7791-based Koelsch development
> board. The driver fails during initialization with:

I think explicitly acquiring the clocks should not be needed.
Could you please try the patches from the following series instead?

http://marc.info/?l=linux-sh&m=138823255807611&w=2

Thanks,
Val.

>
>      rcar_thermal e61f0000.thermal: thermal sensor was broken
>
> This does not happen when using legacy platform devices.
>
> This series was tested using Koelsch reference (DT) and non-reference
> (legacy) kernel configurations. It was not tested on r8a7790/Lager
> (which is very similar).
>
>      [1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
>      [2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
>      [3/4] thermal: rcar: Add missing clock handling
>      [4/4] thermal: rcar: Spelling s/delaye/delay/g
>

> Thanks for your comments!
>
> Gr{oetje,eeting}s,
>
> 						Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
>
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH 0/4] thermal: rcar: Add missing clock handling
  2014-01-07 21:52   ` Valentine
  (?)
@ 2014-01-07 22:13     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 22:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Valentine,

On Tue, Jan 7, 2014 at 10:52 PM, Valentine
<valentine.barshak@cogentembedded.com> wrote:
> On 01/07/2014 10:57 PM, Geert Uytterhoeven wrote:
>> This patch series fixes a problem when the thermal-rcar device is
>> instantiated from the device tree on the r8a7791-based Koelsch development
>> board. The driver fails during initialization with:
>
>
> I think explicitly acquiring the clocks should not be needed.
> Could you please try the patches from the following series instead?
>
> http://marc.info/?l=linux-sh&m\x138823255807611&w=2

I already had these applied, and the problem persists.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH 0/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 22:13     ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 22:13 UTC (permalink / raw)
  To: Valentine
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, Linux-sh list, linux-arm-kernel,
	Linux PM list

Hi Valentine,

On Tue, Jan 7, 2014 at 10:52 PM, Valentine
<valentine.barshak@cogentembedded.com> wrote:
> On 01/07/2014 10:57 PM, Geert Uytterhoeven wrote:
>> This patch series fixes a problem when the thermal-rcar device is
>> instantiated from the device tree on the r8a7791-based Koelsch development
>> board. The driver fails during initialization with:
>
>
> I think explicitly acquiring the clocks should not be needed.
> Could you please try the patches from the following series instead?
>
> http://marc.info/?l=linux-sh&m=138823255807611&w=2

I already had these applied, and the problem persists.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* [PATCH 0/4] thermal: rcar: Add missing clock handling
@ 2014-01-07 22:13     ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-07 22:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Valentine,

On Tue, Jan 7, 2014 at 10:52 PM, Valentine
<valentine.barshak@cogentembedded.com> wrote:
> On 01/07/2014 10:57 PM, Geert Uytterhoeven wrote:
>> This patch series fixes a problem when the thermal-rcar device is
>> instantiated from the device tree on the r8a7791-based Koelsch development
>> board. The driver fails during initialization with:
>
>
> I think explicitly acquiring the clocks should not be needed.
> Could you please try the patches from the following series instead?
>
> http://marc.info/?l=linux-sh&m=138823255807611&w=2

I already had these applied, and the problem persists.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

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

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

* Re: [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
  2014-01-07 18:57   ` Geert Uytterhoeven
  (?)
@ 2014-01-08  0:12     ` Simon Horman
  -1 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 07, 2014 at 07:57:16PM +0100, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> Cc: Jiri Kosina <trivial@kernel.org>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  drivers/thermal/rcar_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index a5629500723a..32d591087307 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  		/* enable temperature comparation */
>  		rcar_thermal_common_write(common, ENR, 0x00030303);
>  
> -		idle = 0; /* polling delaye is not needed */
> +		idle = 0; /* polling delay is not needed */
>  	}
>  
>  	for (i = 0;; i++) {
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
@ 2014-01-08  0:12     ` Simon Horman
  0 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Zhang Rui, Eduardo Valentin, Magnus Damm, Kuninori Morimoto,
	linux-sh, linux-arm-kernel, linux-pm, Geert Uytterhoeven,
	Jiri Kosina

On Tue, Jan 07, 2014 at 07:57:16PM +0100, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> Cc: Jiri Kosina <trivial@kernel.org>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  drivers/thermal/rcar_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index a5629500723a..32d591087307 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  		/* enable temperature comparation */
>  		rcar_thermal_common_write(common, ENR, 0x00030303);
>  
> -		idle = 0; /* polling delaye is not needed */
> +		idle = 0; /* polling delay is not needed */
>  	}
>  
>  	for (i = 0;; i++) {
> -- 
> 1.7.9.5
> 

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

* [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
@ 2014-01-08  0:12     ` Simon Horman
  0 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 07, 2014 at 07:57:16PM +0100, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> Cc: Jiri Kosina <trivial@kernel.org>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  drivers/thermal/rcar_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index a5629500723a..32d591087307 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  		/* enable temperature comparation */
>  		rcar_thermal_common_write(common, ENR, 0x00030303);
>  
> -		idle = 0; /* polling delaye is not needed */
> +		idle = 0; /* polling delay is not needed */
>  	}
>  
>  	for (i = 0;; i++) {
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
  2014-01-07 18:57   ` Geert Uytterhoeven
  (?)
@ 2014-01-08  0:20     ` Laurent Pinchart
  -1 siblings, 0 replies; 73+ messages in thread
From: Laurent Pinchart @ 2014-01-08  0:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Geert,

Thank you for the patch.

On Tuesday 07 January 2014 19:57:14 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Add the missing thermal MSTP clock to the thermal device node.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/r8a7790.dtsi |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
> index f48487c2a970..b53834e6a55f 100644
> --- a/arch/arm/boot/dts/r8a7790.dtsi
> +++ b/arch/arm/boot/dts/r8a7790.dtsi
> @@ -168,6 +168,7 @@
>  		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
>  	};
> 
>  	timer {
-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
@ 2014-01-08  0:20     ` Laurent Pinchart
  0 siblings, 0 replies; 73+ messages in thread
From: Laurent Pinchart @ 2014-01-08  0:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, linux-sh, linux-arm-kernel, linux-pm,
	Geert Uytterhoeven

Hi Geert,

Thank you for the patch.

On Tuesday 07 January 2014 19:57:14 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Add the missing thermal MSTP clock to the thermal device node.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/r8a7790.dtsi |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
> index f48487c2a970..b53834e6a55f 100644
> --- a/arch/arm/boot/dts/r8a7790.dtsi
> +++ b/arch/arm/boot/dts/r8a7790.dtsi
> @@ -168,6 +168,7 @@
>  		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
>  	};
> 
>  	timer {
-- 
Regards,

Laurent Pinchart


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

* [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
@ 2014-01-08  0:20     ` Laurent Pinchart
  0 siblings, 0 replies; 73+ messages in thread
From: Laurent Pinchart @ 2014-01-08  0:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Geert,

Thank you for the patch.

On Tuesday 07 January 2014 19:57:14 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Add the missing thermal MSTP clock to the thermal device node.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/r8a7790.dtsi |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
> index f48487c2a970..b53834e6a55f 100644
> --- a/arch/arm/boot/dts/r8a7790.dtsi
> +++ b/arch/arm/boot/dts/r8a7790.dtsi
> @@ -168,6 +168,7 @@
>  		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
>  	};
> 
>  	timer {
-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
  2014-01-07 18:57   ` Geert Uytterhoeven
  (?)
@ 2014-01-08  0:20     ` Laurent Pinchart
  -1 siblings, 0 replies; 73+ messages in thread
From: Laurent Pinchart @ 2014-01-08  0:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Geert,

Thank you for the patch.

On Tuesday 07 January 2014 19:57:13 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Add the missing thermal MSTP clock to the thermal device node.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/r8a7791.dtsi |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
> index d8dbf7e7b6a9..3233041d8a44 100644
> --- a/arch/arm/boot/dts/r8a7791.dtsi
> +++ b/arch/arm/boot/dts/r8a7791.dtsi
> @@ -151,6 +151,7 @@
>  		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
>  	};
> 
>  	timer {
-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
@ 2014-01-08  0:20     ` Laurent Pinchart
  0 siblings, 0 replies; 73+ messages in thread
From: Laurent Pinchart @ 2014-01-08  0:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, linux-sh, linux-arm-kernel, linux-pm,
	Geert Uytterhoeven

Hi Geert,

Thank you for the patch.

On Tuesday 07 January 2014 19:57:13 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Add the missing thermal MSTP clock to the thermal device node.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/r8a7791.dtsi |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
> index d8dbf7e7b6a9..3233041d8a44 100644
> --- a/arch/arm/boot/dts/r8a7791.dtsi
> +++ b/arch/arm/boot/dts/r8a7791.dtsi
> @@ -151,6 +151,7 @@
>  		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
>  	};
> 
>  	timer {
-- 
Regards,

Laurent Pinchart


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

* [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
@ 2014-01-08  0:20     ` Laurent Pinchart
  0 siblings, 0 replies; 73+ messages in thread
From: Laurent Pinchart @ 2014-01-08  0:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Geert,

Thank you for the patch.

On Tuesday 07 January 2014 19:57:13 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Add the missing thermal MSTP clock to the thermal device node.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/r8a7791.dtsi |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
> index d8dbf7e7b6a9..3233041d8a44 100644
> --- a/arch/arm/boot/dts/r8a7791.dtsi
> +++ b/arch/arm/boot/dts/r8a7791.dtsi
> @@ -151,6 +151,7 @@
>  		reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
>  	};
> 
>  	timer {
-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
  2014-01-08  0:20     ` Laurent Pinchart
  (?)
@ 2014-01-08  0:52       ` Simon Horman
  -1 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 08, 2014 at 01:20:08AM +0100, Laurent Pinchart wrote:
> Hi Geert,
> 
> Thank you for the patch.
> 
> On Tuesday 07 January 2014 19:57:14 Geert Uytterhoeven wrote:
> > From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> > 
> > Add the missing thermal MSTP clock to the thermal device node.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks, I will queue this up.

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

* Re: [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
@ 2014-01-08  0:52       ` Simon Horman
  0 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:52 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Geert Uytterhoeven, Zhang Rui, Eduardo Valentin, Magnus Damm,
	Kuninori Morimoto, linux-sh, linux-arm-kernel, linux-pm,
	Geert Uytterhoeven

On Wed, Jan 08, 2014 at 01:20:08AM +0100, Laurent Pinchart wrote:
> Hi Geert,
> 
> Thank you for the patch.
> 
> On Tuesday 07 January 2014 19:57:14 Geert Uytterhoeven wrote:
> > From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> > 
> > Add the missing thermal MSTP clock to the thermal device node.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks, I will queue this up.

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

* [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree
@ 2014-01-08  0:52       ` Simon Horman
  0 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 08, 2014 at 01:20:08AM +0100, Laurent Pinchart wrote:
> Hi Geert,
> 
> Thank you for the patch.
> 
> On Tuesday 07 January 2014 19:57:14 Geert Uytterhoeven wrote:
> > From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> > 
> > Add the missing thermal MSTP clock to the thermal device node.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks, I will queue this up.

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

* Re: [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
  2014-01-08  0:20     ` Laurent Pinchart
  (?)
@ 2014-01-08  0:52       ` Simon Horman
  -1 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 08, 2014 at 01:20:09AM +0100, Laurent Pinchart wrote:
> Hi Geert,
> 
> Thank you for the patch.
> 
> On Tuesday 07 January 2014 19:57:13 Geert Uytterhoeven wrote:
> > From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> > 
> > Add the missing thermal MSTP clock to the thermal device node.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks, I will queue this up.

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

* Re: [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
@ 2014-01-08  0:52       ` Simon Horman
  0 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:52 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Geert Uytterhoeven, Zhang Rui, Eduardo Valentin, Magnus Damm,
	Kuninori Morimoto, linux-sh, linux-arm-kernel, linux-pm,
	Geert Uytterhoeven

On Wed, Jan 08, 2014 at 01:20:09AM +0100, Laurent Pinchart wrote:
> Hi Geert,
> 
> Thank you for the patch.
> 
> On Tuesday 07 January 2014 19:57:13 Geert Uytterhoeven wrote:
> > From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> > 
> > Add the missing thermal MSTP clock to the thermal device node.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks, I will queue this up.

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

* [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree
@ 2014-01-08  0:52       ` Simon Horman
  0 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-08  0:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 08, 2014 at 01:20:09AM +0100, Laurent Pinchart wrote:
> Hi Geert,
> 
> Thank you for the patch.
> 
> On Tuesday 07 January 2014 19:57:13 Geert Uytterhoeven wrote:
> > From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> > 
> > Add the missing thermal MSTP clock to the thermal device node.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks, I will queue this up.

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-07 18:57   ` Geert Uytterhoeven
  (?)
@ 2014-01-08  1:08     ` Kuninori Morimoto
  -1 siblings, 0 replies; 73+ messages in thread
From: Kuninori Morimoto @ 2014-01-08  1:08 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Geert

> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>  	pm_runtime_enable(dev);
>  	pm_runtime_get_sync(dev);

You can use "dev" instead of "&pdev->dev" :)

And this patch seems strange for me.
pm_runtime_xxx() is doing same things.
If it didn't work, wrong place is not driver, clock side ?



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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08  1:08     ` Kuninori Morimoto
  0 siblings, 0 replies; 73+ messages in thread
From: Kuninori Morimoto @ 2014-01-08  1:08 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, linux-sh, linux-arm-kernel, linux-pm,
	Geert Uytterhoeven


Hi Geert

> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>  	pm_runtime_enable(dev);
>  	pm_runtime_get_sync(dev);

You can use "dev" instead of "&pdev->dev" :)

And this patch seems strange for me.
pm_runtime_xxx() is doing same things.
If it didn't work, wrong place is not driver, clock side ?



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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08  1:08     ` Kuninori Morimoto
  0 siblings, 0 replies; 73+ messages in thread
From: Kuninori Morimoto @ 2014-01-08  1:08 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Geert

> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>  	pm_runtime_enable(dev);
>  	pm_runtime_get_sync(dev);

You can use "dev" instead of "&pdev->dev" :)

And this patch seems strange for me.
pm_runtime_xxx() is doing same things.
If it didn't work, wrong place is not driver, clock side ?

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-08  1:08     ` Kuninori Morimoto
  (?)
@ 2014-01-08 10:23       ` Geert Uytterhoeven
  -1 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-08 10:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
>> +     if (IS_ERR(common->clk)) {
>> +             dev_err(&pdev->dev, "cannot get clock\n");
>> +             return PTR_ERR(common->clk);
>> +     }
>> +
>> +     ret = clk_prepare(common->clk);
>> +     if (ret < 0) {
>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
>> +             return ret;
>> +     }
>> +
>> +     clk_enable(common->clk);
>> +
>>       pm_runtime_enable(dev);
>>       pm_runtime_get_sync(dev);
>
> And this patch seems strange for me.
> pm_runtime_xxx() is doing same things.
> If it didn't work, wrong place is not driver, clock side ?

That's an interesting observation...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08 10:23       ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-08 10:23 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, Linux-sh list, linux-arm-kernel,
	Linux PM list, Geert Uytterhoeven

On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
>> +     if (IS_ERR(common->clk)) {
>> +             dev_err(&pdev->dev, "cannot get clock\n");
>> +             return PTR_ERR(common->clk);
>> +     }
>> +
>> +     ret = clk_prepare(common->clk);
>> +     if (ret < 0) {
>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
>> +             return ret;
>> +     }
>> +
>> +     clk_enable(common->clk);
>> +
>>       pm_runtime_enable(dev);
>>       pm_runtime_get_sync(dev);
>
> And this patch seems strange for me.
> pm_runtime_xxx() is doing same things.
> If it didn't work, wrong place is not driver, clock side ?

That's an interesting observation...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08 10:23       ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-08 10:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
>> +     if (IS_ERR(common->clk)) {
>> +             dev_err(&pdev->dev, "cannot get clock\n");
>> +             return PTR_ERR(common->clk);
>> +     }
>> +
>> +     ret = clk_prepare(common->clk);
>> +     if (ret < 0) {
>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
>> +             return ret;
>> +     }
>> +
>> +     clk_enable(common->clk);
>> +
>>       pm_runtime_enable(dev);
>>       pm_runtime_get_sync(dev);
>
> And this patch seems strange for me.
> pm_runtime_xxx() is doing same things.
> If it didn't work, wrong place is not driver, clock side ?

That's an interesting observation...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

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

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-07 20:57     ` Gerhard Sittig
  (?)
@ 2014-01-08 12:20       ` Ben Dooks
  -1 siblings, 0 replies; 73+ messages in thread
From: Ben Dooks @ 2014-01-08 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/01/14 20:57, Gerhard Sittig wrote:
> On Tue, Jan 07, 2014 at 19:57 +0100, Geert Uytterhoeven wrote:
>>
>> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>>   	spin_lock_init(&common->lock);
>>   	common->dev = dev;
>>
>> +	common->clk = devm_clk_get(&pdev->dev, NULL);
>> +	if (IS_ERR(common->clk)) {
>> +		dev_err(&pdev->dev, "cannot get clock\n");
>> +		return PTR_ERR(common->clk);
>> +	}
>> +
>> +	ret = clk_prepare(common->clk);
>> +	if (ret < 0) {
>> +		dev_err(&pdev->dev, "unable to prepare clock\n");
>> +		return ret;
>> +	}
>> +
>> +	clk_enable(common->clk);
>> +
>>   	pm_runtime_enable(dev);
>>   	pm_runtime_get_sync(dev);
>
> clk_enable() can fail, too, so you should check its return value

Also, if you enable the pm-runtime then the device clock is actually
handled by the common pm-clock framework.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08 12:20       ` Ben Dooks
  0 siblings, 0 replies; 73+ messages in thread
From: Ben Dooks @ 2014-01-08 12:20 UTC (permalink / raw)
  To: Gerhard Sittig
  Cc: Geert Uytterhoeven, Zhang Rui, Eduardo Valentin, Simon Horman,
	Magnus Damm, Kuninori Morimoto, Geert Uytterhoeven, linux-pm,
	linux-arm-kernel, linux-sh

On 07/01/14 20:57, Gerhard Sittig wrote:
> On Tue, Jan 07, 2014 at 19:57 +0100, Geert Uytterhoeven wrote:
>>
>> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>>   	spin_lock_init(&common->lock);
>>   	common->dev = dev;
>>
>> +	common->clk = devm_clk_get(&pdev->dev, NULL);
>> +	if (IS_ERR(common->clk)) {
>> +		dev_err(&pdev->dev, "cannot get clock\n");
>> +		return PTR_ERR(common->clk);
>> +	}
>> +
>> +	ret = clk_prepare(common->clk);
>> +	if (ret < 0) {
>> +		dev_err(&pdev->dev, "unable to prepare clock\n");
>> +		return ret;
>> +	}
>> +
>> +	clk_enable(common->clk);
>> +
>>   	pm_runtime_enable(dev);
>>   	pm_runtime_get_sync(dev);
>
> clk_enable() can fail, too, so you should check its return value

Also, if you enable the pm-runtime then the device clock is actually
handled by the common pm-clock framework.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08 12:20       ` Ben Dooks
  0 siblings, 0 replies; 73+ messages in thread
From: Ben Dooks @ 2014-01-08 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/01/14 20:57, Gerhard Sittig wrote:
> On Tue, Jan 07, 2014 at 19:57 +0100, Geert Uytterhoeven wrote:
>>
>> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>>   	spin_lock_init(&common->lock);
>>   	common->dev = dev;
>>
>> +	common->clk = devm_clk_get(&pdev->dev, NULL);
>> +	if (IS_ERR(common->clk)) {
>> +		dev_err(&pdev->dev, "cannot get clock\n");
>> +		return PTR_ERR(common->clk);
>> +	}
>> +
>> +	ret = clk_prepare(common->clk);
>> +	if (ret < 0) {
>> +		dev_err(&pdev->dev, "unable to prepare clock\n");
>> +		return ret;
>> +	}
>> +
>> +	clk_enable(common->clk);
>> +
>>   	pm_runtime_enable(dev);
>>   	pm_runtime_get_sync(dev);
>
> clk_enable() can fail, too, so you should check its return value

Also, if you enable the pm-runtime then the device clock is actually
handled by the common pm-clock framework.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-07 18:57   ` Geert Uytterhoeven
  (?)
@ 2014-01-08 12:23     ` Ben Dooks
  -1 siblings, 0 replies; 73+ messages in thread
From: Ben Dooks @ 2014-01-08 12:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/01/14 18:57, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
>
> When using DT to instantiate the rcar-thermal device, it prints the
> following error:
>
>      rcar_thermal e61f0000.thermal: thermal sensor was broken
>
> Explicitly request and enable the thermal clock to fix this.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> ---
>   drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
>   1 file changed, 33 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 88f92e1a9944..a5629500723a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -17,6 +17,7 @@
>    *  with this program; if not, write to the Free Software Foundation, Inc.,
>    *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
>    */
> +#include <linux/clk.h>
>   #include <linux/delay.h>
>   #include <linux/err.h>
>   #include <linux/irq.h>
> @@ -53,6 +54,7 @@ struct rcar_thermal_common {
>   	struct device *dev;
>   	struct list_head head;
>   	spinlock_t lock;
> +	struct clk *clk;
>   };
>
>   struct rcar_thermal_priv {
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>   	spin_lock_init(&common->lock);
>   	common->dev = dev;
>
> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>   	pm_runtime_enable(dev);
>   	pm_runtime_get_sync(dev);
>
>   	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>   	if (irq) {
> -		int ret;
> +		int ret2;
>
>   		/*
>   		 * platform has IRQ support.
>   		 * Then, drier use common register
>   		 */
>
> -		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> -				       dev_name(dev), common);
> -		if (ret) {
> +		ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> +					dev_name(dev), common);
> +		if (ret2) {
>   			dev_err(dev, "irq request failed\n ");
> -			return ret;
> +			ret = ret2;
> +			goto error_unpm;
>   		}

I'd suggest not renaming ret2 and just use the original ret.


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08 12:23     ` Ben Dooks
  0 siblings, 0 replies; 73+ messages in thread
From: Ben Dooks @ 2014-01-08 12:23 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, linux-sh, linux-arm-kernel, linux-pm,
	Geert Uytterhoeven

On 07/01/14 18:57, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
>
> When using DT to instantiate the rcar-thermal device, it prints the
> following error:
>
>      rcar_thermal e61f0000.thermal: thermal sensor was broken
>
> Explicitly request and enable the thermal clock to fix this.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> ---
>   drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
>   1 file changed, 33 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 88f92e1a9944..a5629500723a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -17,6 +17,7 @@
>    *  with this program; if not, write to the Free Software Foundation, Inc.,
>    *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
>    */
> +#include <linux/clk.h>
>   #include <linux/delay.h>
>   #include <linux/err.h>
>   #include <linux/irq.h>
> @@ -53,6 +54,7 @@ struct rcar_thermal_common {
>   	struct device *dev;
>   	struct list_head head;
>   	spinlock_t lock;
> +	struct clk *clk;
>   };
>
>   struct rcar_thermal_priv {
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>   	spin_lock_init(&common->lock);
>   	common->dev = dev;
>
> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>   	pm_runtime_enable(dev);
>   	pm_runtime_get_sync(dev);
>
>   	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>   	if (irq) {
> -		int ret;
> +		int ret2;
>
>   		/*
>   		 * platform has IRQ support.
>   		 * Then, drier use common register
>   		 */
>
> -		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> -				       dev_name(dev), common);
> -		if (ret) {
> +		ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> +					dev_name(dev), common);
> +		if (ret2) {
>   			dev_err(dev, "irq request failed\n ");
> -			return ret;
> +			ret = ret2;
> +			goto error_unpm;
>   		}

I'd suggest not renaming ret2 and just use the original ret.


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08 12:23     ` Ben Dooks
  0 siblings, 0 replies; 73+ messages in thread
From: Ben Dooks @ 2014-01-08 12:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/01/14 18:57, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
>
> When using DT to instantiate the rcar-thermal device, it prints the
> following error:
>
>      rcar_thermal e61f0000.thermal: thermal sensor was broken
>
> Explicitly request and enable the thermal clock to fix this.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> ---
>   drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
>   1 file changed, 33 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 88f92e1a9944..a5629500723a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -17,6 +17,7 @@
>    *  with this program; if not, write to the Free Software Foundation, Inc.,
>    *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
>    */
> +#include <linux/clk.h>
>   #include <linux/delay.h>
>   #include <linux/err.h>
>   #include <linux/irq.h>
> @@ -53,6 +54,7 @@ struct rcar_thermal_common {
>   	struct device *dev;
>   	struct list_head head;
>   	spinlock_t lock;
> +	struct clk *clk;
>   };
>
>   struct rcar_thermal_priv {
> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>   	spin_lock_init(&common->lock);
>   	common->dev = dev;
>
> +	common->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(common->clk)) {
> +		dev_err(&pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(common->clk);
> +	}
> +
> +	ret = clk_prepare(common->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "unable to prepare clock\n");
> +		return ret;
> +	}
> +
> +	clk_enable(common->clk);
> +
>   	pm_runtime_enable(dev);
>   	pm_runtime_get_sync(dev);
>
>   	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>   	if (irq) {
> -		int ret;
> +		int ret2;
>
>   		/*
>   		 * platform has IRQ support.
>   		 * Then, drier use common register
>   		 */
>
> -		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> -				       dev_name(dev), common);
> -		if (ret) {
> +		ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> +					dev_name(dev), common);
> +		if (ret2) {
>   			dev_err(dev, "irq request failed\n ");
> -			return ret;
> +			ret = ret2;
> +			goto error_unpm;
>   		}

I'd suggest not renaming ret2 and just use the original ret.


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-08 12:23     ` Ben Dooks
  (?)
@ 2014-01-08 12:58       ` Geert Uytterhoeven
  -1 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-08 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 8, 2014 at 1:23 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device
>> *pdev)
>>         spin_lock_init(&common->lock);
>>         common->dev = dev;
>>
>> +       common->clk = devm_clk_get(&pdev->dev, NULL);
>> +       if (IS_ERR(common->clk)) {
>> +               dev_err(&pdev->dev, "cannot get clock\n");
>> +               return PTR_ERR(common->clk);
>> +       }
>> +
>> +       ret = clk_prepare(common->clk);
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "unable to prepare clock\n");
>> +               return ret;
>> +       }
>> +
>> +       clk_enable(common->clk);
>> +
>>         pm_runtime_enable(dev);
>>         pm_runtime_get_sync(dev);
>>
>>         irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>>         if (irq) {
>> -               int ret;
>> +               int ret2;
>>
>>                 /*
>>                  * platform has IRQ support.
>>                  * Then, drier use common register
>>                  */
>>
>> -               ret = devm_request_irq(dev, irq->start, rcar_thermal_irq,
>> 0,
>> -                                      dev_name(dev), common);
>> -               if (ret) {
>> +               ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq,
>> 0,
>> +                                       dev_name(dev), common);
>> +               if (ret2) {
>>                         dev_err(dev, "irq request failed\n ");
>> -                       return ret;
>> +                       ret = ret2;
>> +                       goto error_unpm;
>>                 }
>
> I'd suggest not renaming ret2 and just use the original ret.

I did that because the for loop after that block depends on ret still being
-ENODEV. Upon closer look, I did break that myself by assigning it
the return value of clk_prepare().
So I'll use the original ret, and reset it to -ENODEV before the for loop
(unless we manage to fix it in pm_runtime_*()).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08 12:58       ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-08 12:58 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, Linux-sh list, linux-arm-kernel,
	Linux PM list, Geert Uytterhoeven

On Wed, Jan 8, 2014 at 1:23 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device
>> *pdev)
>>         spin_lock_init(&common->lock);
>>         common->dev = dev;
>>
>> +       common->clk = devm_clk_get(&pdev->dev, NULL);
>> +       if (IS_ERR(common->clk)) {
>> +               dev_err(&pdev->dev, "cannot get clock\n");
>> +               return PTR_ERR(common->clk);
>> +       }
>> +
>> +       ret = clk_prepare(common->clk);
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "unable to prepare clock\n");
>> +               return ret;
>> +       }
>> +
>> +       clk_enable(common->clk);
>> +
>>         pm_runtime_enable(dev);
>>         pm_runtime_get_sync(dev);
>>
>>         irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>>         if (irq) {
>> -               int ret;
>> +               int ret2;
>>
>>                 /*
>>                  * platform has IRQ support.
>>                  * Then, drier use common register
>>                  */
>>
>> -               ret = devm_request_irq(dev, irq->start, rcar_thermal_irq,
>> 0,
>> -                                      dev_name(dev), common);
>> -               if (ret) {
>> +               ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq,
>> 0,
>> +                                       dev_name(dev), common);
>> +               if (ret2) {
>>                         dev_err(dev, "irq request failed\n ");
>> -                       return ret;
>> +                       ret = ret2;
>> +                       goto error_unpm;
>>                 }
>
> I'd suggest not renaming ret2 and just use the original ret.

I did that because the for loop after that block depends on ret still being
-ENODEV. Upon closer look, I did break that myself by assigning it
the return value of clk_prepare().
So I'll use the original ret, and reset it to -ENODEV before the for loop
(unless we manage to fix it in pm_runtime_*()).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-08 12:58       ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-08 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 8, 2014 at 1:23 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>> @@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device
>> *pdev)
>>         spin_lock_init(&common->lock);
>>         common->dev = dev;
>>
>> +       common->clk = devm_clk_get(&pdev->dev, NULL);
>> +       if (IS_ERR(common->clk)) {
>> +               dev_err(&pdev->dev, "cannot get clock\n");
>> +               return PTR_ERR(common->clk);
>> +       }
>> +
>> +       ret = clk_prepare(common->clk);
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "unable to prepare clock\n");
>> +               return ret;
>> +       }
>> +
>> +       clk_enable(common->clk);
>> +
>>         pm_runtime_enable(dev);
>>         pm_runtime_get_sync(dev);
>>
>>         irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>>         if (irq) {
>> -               int ret;
>> +               int ret2;
>>
>>                 /*
>>                  * platform has IRQ support.
>>                  * Then, drier use common register
>>                  */
>>
>> -               ret = devm_request_irq(dev, irq->start, rcar_thermal_irq,
>> 0,
>> -                                      dev_name(dev), common);
>> -               if (ret) {
>> +               ret2 = devm_request_irq(dev, irq->start, rcar_thermal_irq,
>> 0,
>> +                                       dev_name(dev), common);
>> +               if (ret2) {
>>                         dev_err(dev, "irq request failed\n ");
>> -                       return ret;
>> +                       ret = ret2;
>> +                       goto error_unpm;
>>                 }
>
> I'd suggest not renaming ret2 and just use the original ret.

I did that because the for loop after that block depends on ret still being
-ENODEV. Upon closer look, I did break that myself by assigning it
the return value of clk_prepare().
So I'll use the original ret, and reset it to -ENODEV before the for loop
(unless we manage to fix it in pm_runtime_*()).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

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

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-08 10:23       ` Geert Uytterhoeven
  (?)
@ 2014-01-13  8:57         ` Geert Uytterhoeven
  -1 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-13  8:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Morimoto-san,

On Wed, Jan 8, 2014 at 11:23 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
>>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
>>> +     if (IS_ERR(common->clk)) {
>>> +             dev_err(&pdev->dev, "cannot get clock\n");
>>> +             return PTR_ERR(common->clk);
>>> +     }
>>> +
>>> +     ret = clk_prepare(common->clk);
>>> +     if (ret < 0) {
>>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
>>> +             return ret;
>>> +     }
>>> +
>>> +     clk_enable(common->clk);
>>> +
>>>       pm_runtime_enable(dev);
>>>       pm_runtime_get_sync(dev);
>>
>> And this patch seems strange for me.
>> pm_runtime_xxx() is doing same things.
>> If it didn't work, wrong place is not driver, clock side ?
>
> That's an interesting observation...

You were right. After applying both of "ARM: shmobile: compile drivers/sh
for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
prepare/unprepare count" from Ben Dooks the issue went away.

So my patch can be dropped.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-13  8:57         ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-13  8:57 UTC (permalink / raw)
  To: Kuninori Morimoto, Ben Dooks
  Cc: Zhang Rui, Eduardo Valentin, Simon Horman, Magnus Damm,
	Kuninori Morimoto, Linux-sh list, linux-arm-kernel,
	Linux PM list, Geert Uytterhoeven

Hi Morimoto-san,

On Wed, Jan 8, 2014 at 11:23 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
>>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
>>> +     if (IS_ERR(common->clk)) {
>>> +             dev_err(&pdev->dev, "cannot get clock\n");
>>> +             return PTR_ERR(common->clk);
>>> +     }
>>> +
>>> +     ret = clk_prepare(common->clk);
>>> +     if (ret < 0) {
>>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
>>> +             return ret;
>>> +     }
>>> +
>>> +     clk_enable(common->clk);
>>> +
>>>       pm_runtime_enable(dev);
>>>       pm_runtime_get_sync(dev);
>>
>> And this patch seems strange for me.
>> pm_runtime_xxx() is doing same things.
>> If it didn't work, wrong place is not driver, clock side ?
>
> That's an interesting observation...

You were right. After applying both of "ARM: shmobile: compile drivers/sh
for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
prepare/unprepare count" from Ben Dooks the issue went away.

So my patch can be dropped.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-13  8:57         ` Geert Uytterhoeven
  0 siblings, 0 replies; 73+ messages in thread
From: Geert Uytterhoeven @ 2014-01-13  8:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Morimoto-san,

On Wed, Jan 8, 2014 at 11:23 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
>>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
>>> +     if (IS_ERR(common->clk)) {
>>> +             dev_err(&pdev->dev, "cannot get clock\n");
>>> +             return PTR_ERR(common->clk);
>>> +     }
>>> +
>>> +     ret = clk_prepare(common->clk);
>>> +     if (ret < 0) {
>>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
>>> +             return ret;
>>> +     }
>>> +
>>> +     clk_enable(common->clk);
>>> +
>>>       pm_runtime_enable(dev);
>>>       pm_runtime_get_sync(dev);
>>
>> And this patch seems strange for me.
>> pm_runtime_xxx() is doing same things.
>> If it didn't work, wrong place is not driver, clock side ?
>
> That's an interesting observation...

You were right. After applying both of "ARM: shmobile: compile drivers/sh
for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
prepare/unprepare count" from Ben Dooks the issue went away.

So my patch can be dropped.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

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

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-13  8:57         ` Geert Uytterhoeven
  (?)
@ 2014-01-14  0:20           ` Kuninori Morimoto
  -1 siblings, 0 replies; 73+ messages in thread
From: Kuninori Morimoto @ 2014-01-14  0:20 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Geert

> >> And this patch seems strange for me.
> >> pm_runtime_xxx() is doing same things.
> >> If it didn't work, wrong place is not driver, clock side ?
(snipO
> You were right. After applying both of "ARM: shmobile: compile drivers/sh
> for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
> prepare/unprepare count" from Ben Dooks the issue went away.

Nice !
Thank you for your help :)

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-14  0:20           ` Kuninori Morimoto
  0 siblings, 0 replies; 73+ messages in thread
From: Kuninori Morimoto @ 2014-01-14  0:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Ben Dooks, Zhang Rui, Eduardo Valentin, Simon Horman,
	Magnus Damm, Kuninori Morimoto, Linux-sh list, linux-arm-kernel,
	Linux PM list, Geert Uytterhoeven


Hi Geert

> >> And this patch seems strange for me.
> >> pm_runtime_xxx() is doing same things.
> >> If it didn't work, wrong place is not driver, clock side ?
(snipO
> You were right. After applying both of "ARM: shmobile: compile drivers/sh
> for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
> prepare/unprepare count" from Ben Dooks the issue went away.

Nice !
Thank you for your help :)

Best regards
---
Kuninori Morimoto

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-14  0:20           ` Kuninori Morimoto
  0 siblings, 0 replies; 73+ messages in thread
From: Kuninori Morimoto @ 2014-01-14  0:20 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Geert

> >> And this patch seems strange for me.
> >> pm_runtime_xxx() is doing same things.
> >> If it didn't work, wrong place is not driver, clock side ?
(snipO
> You were right. After applying both of "ARM: shmobile: compile drivers/sh
> for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
> prepare/unprepare count" from Ben Dooks the issue went away.

Nice !
Thank you for your help :)

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
  2014-01-13  8:57         ` Geert Uytterhoeven
  (?)
@ 2014-01-14  1:27           ` Simon Horman
  -1 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-14  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 13, 2014 at 09:57:08AM +0100, Geert Uytterhoeven wrote:
> Hi Morimoto-san,
> 
> On Wed, Jan 8, 2014 at 11:23 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
> > <kuninori.morimoto.gx@gmail.com> wrote:
> >>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
> >>> +     if (IS_ERR(common->clk)) {
> >>> +             dev_err(&pdev->dev, "cannot get clock\n");
> >>> +             return PTR_ERR(common->clk);
> >>> +     }
> >>> +
> >>> +     ret = clk_prepare(common->clk);
> >>> +     if (ret < 0) {
> >>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
> >>> +             return ret;
> >>> +     }
> >>> +
> >>> +     clk_enable(common->clk);
> >>> +
> >>>       pm_runtime_enable(dev);
> >>>       pm_runtime_get_sync(dev);
> >>
> >> And this patch seems strange for me.
> >> pm_runtime_xxx() is doing same things.
> >> If it didn't work, wrong place is not driver, clock side ?
> >
> > That's an interesting observation...
> 
> You were right. After applying both of "ARM: shmobile: compile drivers/sh
> for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
> prepare/unprepare count" from Ben Dooks the issue went away.

There seems to be some lively discussion around Ben's patch.

> So my patch can be dropped.

I have marked this patch as Rejected accordingly.

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

* Re: [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-14  1:27           ` Simon Horman
  0 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-14  1:27 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Kuninori Morimoto, Ben Dooks, Zhang Rui, Eduardo Valentin,
	Magnus Damm, Kuninori Morimoto, Linux-sh list, linux-arm-kernel,
	Linux PM list, Geert Uytterhoeven

On Mon, Jan 13, 2014 at 09:57:08AM +0100, Geert Uytterhoeven wrote:
> Hi Morimoto-san,
> 
> On Wed, Jan 8, 2014 at 11:23 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
> > <kuninori.morimoto.gx@gmail.com> wrote:
> >>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
> >>> +     if (IS_ERR(common->clk)) {
> >>> +             dev_err(&pdev->dev, "cannot get clock\n");
> >>> +             return PTR_ERR(common->clk);
> >>> +     }
> >>> +
> >>> +     ret = clk_prepare(common->clk);
> >>> +     if (ret < 0) {
> >>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
> >>> +             return ret;
> >>> +     }
> >>> +
> >>> +     clk_enable(common->clk);
> >>> +
> >>>       pm_runtime_enable(dev);
> >>>       pm_runtime_get_sync(dev);
> >>
> >> And this patch seems strange for me.
> >> pm_runtime_xxx() is doing same things.
> >> If it didn't work, wrong place is not driver, clock side ?
> >
> > That's an interesting observation...
> 
> You were right. After applying both of "ARM: shmobile: compile drivers/sh
> for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
> prepare/unprepare count" from Ben Dooks the issue went away.

There seems to be some lively discussion around Ben's patch.

> So my patch can be dropped.

I have marked this patch as Rejected accordingly.

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

* [PATCH 3/4] thermal: rcar: Add missing clock handling
@ 2014-01-14  1:27           ` Simon Horman
  0 siblings, 0 replies; 73+ messages in thread
From: Simon Horman @ 2014-01-14  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 13, 2014 at 09:57:08AM +0100, Geert Uytterhoeven wrote:
> Hi Morimoto-san,
> 
> On Wed, Jan 8, 2014 at 11:23 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > On Wed, Jan 8, 2014 at 2:08 AM, Kuninori Morimoto
> > <kuninori.morimoto.gx@gmail.com> wrote:
> >>> +     common->clk = devm_clk_get(&pdev->dev, NULL);
> >>> +     if (IS_ERR(common->clk)) {
> >>> +             dev_err(&pdev->dev, "cannot get clock\n");
> >>> +             return PTR_ERR(common->clk);
> >>> +     }
> >>> +
> >>> +     ret = clk_prepare(common->clk);
> >>> +     if (ret < 0) {
> >>> +             dev_err(&pdev->dev, "unable to prepare clock\n");
> >>> +             return ret;
> >>> +     }
> >>> +
> >>> +     clk_enable(common->clk);
> >>> +
> >>>       pm_runtime_enable(dev);
> >>>       pm_runtime_get_sync(dev);
> >>
> >> And this patch seems strange for me.
> >> pm_runtime_xxx() is doing same things.
> >> If it didn't work, wrong place is not driver, clock side ?
> >
> > That's an interesting observation...
> 
> You were right. After applying both of "ARM: shmobile: compile drivers/sh
> for CONFIG_ARCH_SHMOBILE_MULTI" and "power: clock_ops.c: fixup clk
> prepare/unprepare count" from Ben Dooks the issue went away.

There seems to be some lively discussion around Ben's patch.

> So my patch can be dropped.

I have marked this patch as Rejected accordingly.

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

* [PATCH 2/4] ARM: shmobile: r8a7790: add audio clock
  2014-01-07 18:57   ` Geert Uytterhoeven
                     ` (2 preceding siblings ...)
  (?)
@ 2014-01-14  2:25   ` Kuninori Morimoto
  -1 siblings, 0 replies; 73+ messages in thread
From: Kuninori Morimoto @ 2014-01-14  2:25 UTC (permalink / raw)
  To: linux-sh

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current audio clock doesn't have dependency to device/driver,
but, it is not good design for DT support.
To avoid branch merge conflict issue,
it uses this load map, and this patch is 1) part.
 1) add old/new style clock in platform
 2) add new style clock method in driver
 3) remove old tyle clock from platform

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7790.dtsi         |   23 +++++++++++++++++++++++
 arch/arm/mach-shmobile/clock-r8a7790.c |   20 ++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 3cc834b..b4f0cd5 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -414,6 +414,29 @@
 			clock-output-names = "extal";
 		};
 
+		/*
+		 * The external audio clocks are configured as 0 Hz fixed frequency clocks by
+		 * default. Boards that provide audio clocks should override them.
+		 */
+		audio_clk_a: audio_clk_a {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <0>;
+			clock-output-names = "audio_clk_a";
+		};
+		audio_clk_b: audio_clk_b {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <0>;
+			clock-output-names = "audio_clk_b";
+		};
+		audio_clk_c: audio_clk_c {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <0>;
+			clock-output-names = "audio_clk_c";
+		};
+
 		/* Special CPG clocks */
 		cpg_clocks: cpg_clocks@e6150000 {
 			compatible = "renesas,r8a7790-cpg-clocks",
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index f25b43a..77fd456 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -91,6 +91,15 @@ static struct clk main_clk = {
 	.ops	= &followparent_clk_ops,
 };
 
+static struct clk audio_clk_a = {
+};
+
+static struct clk audio_clk_b = {
+};
+
+static struct clk audio_clk_c = {
+};
+
 /*
  * clock ratio of these clock will be updated
  * on r8a7790_clock_init()
@@ -124,6 +133,9 @@ SH_FIXED_RATIO_CLK_SET(ddr_clk,			pll3_clk,	1, 8);
 SH_FIXED_RATIO_CLK_SET(mp_clk,			pll1_div2_clk,	1, 15);
 
 static struct clk *main_clks[] = {
+	&audio_clk_a,
+	&audio_clk_b,
+	&audio_clk_c,
 	&extal_clk,
 	&extal_div2_clk,
 	&main_clk,
@@ -266,6 +278,10 @@ static struct clk mstp_clks[MSTP_NR] = {
 static struct clk_lookup lookups[] = {
 
 	/* main clocks */
+	CLKDEV_CON_ID("audio_clk_a",	&audio_clk_a),
+	CLKDEV_CON_ID("audio_clk_b",	&audio_clk_b),
+	CLKDEV_CON_ID("audio_clk_c",	&audio_clk_c),
+	CLKDEV_CON_ID("audio_clk_internal",	&m2_clk),
 	CLKDEV_CON_ID("extal",		&extal_clk),
 	CLKDEV_CON_ID("extal_div2",	&extal_div2_clk),
 	CLKDEV_CON_ID("main",		&main_clk),
@@ -353,6 +369,10 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_ICK_ID("du.0", "rcar-du-r8a7790", &mstp_clks[MSTP724]),
 	CLKDEV_ICK_ID("du.1", "rcar-du-r8a7790", &mstp_clks[MSTP723]),
 	CLKDEV_ICK_ID("du.2", "rcar-du-r8a7790", &mstp_clks[MSTP722]),
+	CLKDEV_ICK_ID("clk_a", "rcar_sound", &audio_clk_a),
+	CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
+	CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
+	CLKDEV_ICK_ID("clk_i", "rcar_sound", &m2_clk),
 	CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP1015]),
 	CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP1014]),
 	CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP1013]),
-- 
1.7.9.5


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

* Re: [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
  2014-01-07 18:57   ` Geert Uytterhoeven
  (?)
@ 2014-01-17  8:23     ` Zhang Rui
  -1 siblings, 0 replies; 73+ messages in thread
From: Zhang Rui @ 2014-01-17  8:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2014-01-07 at 19:57 +0100, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> Cc: Jiri Kosina <trivial@kernel.org>

applied.

thanks,
rui
> ---
>  drivers/thermal/rcar_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index a5629500723a..32d591087307 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  		/* enable temperature comparation */
>  		rcar_thermal_common_write(common, ENR, 0x00030303);
>  
> -		idle = 0; /* polling delaye is not needed */
> +		idle = 0; /* polling delay is not needed */
>  	}
>  
>  	for (i = 0;; i++) {



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

* Re: [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
@ 2014-01-17  8:23     ` Zhang Rui
  0 siblings, 0 replies; 73+ messages in thread
From: Zhang Rui @ 2014-01-17  8:23 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Eduardo Valentin, Simon Horman, Magnus Damm, Kuninori Morimoto,
	linux-sh, linux-arm-kernel, linux-pm, Geert Uytterhoeven,
	Jiri Kosina

On Tue, 2014-01-07 at 19:57 +0100, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> Cc: Jiri Kosina <trivial@kernel.org>

applied.

thanks,
rui
> ---
>  drivers/thermal/rcar_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index a5629500723a..32d591087307 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  		/* enable temperature comparation */
>  		rcar_thermal_common_write(common, ENR, 0x00030303);
>  
> -		idle = 0; /* polling delaye is not needed */
> +		idle = 0; /* polling delay is not needed */
>  	}
>  
>  	for (i = 0;; i++) {



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

* [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g
@ 2014-01-17  8:23     ` Zhang Rui
  0 siblings, 0 replies; 73+ messages in thread
From: Zhang Rui @ 2014-01-17  8:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2014-01-07 at 19:57 +0100, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> Cc: Jiri Kosina <trivial@kernel.org>

applied.

thanks,
rui
> ---
>  drivers/thermal/rcar_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index a5629500723a..32d591087307 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -427,7 +427,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  		/* enable temperature comparation */
>  		rcar_thermal_common_write(common, ENR, 0x00030303);
>  
> -		idle = 0; /* polling delaye is not needed */
> +		idle = 0; /* polling delay is not needed */
>  	}
>  
>  	for (i = 0;; i++) {

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

* [PATCH 1/4] ARM: shmobile: r8a7791: add IIC0/1 clock macros
  2014-01-07 18:57   ` Geert Uytterhoeven
                     ` (2 preceding siblings ...)
  (?)
@ 2014-02-23 12:40   ` Wolfram Sang
  -1 siblings, 0 replies; 73+ messages in thread
From: Wolfram Sang @ 2014-02-23 12:40 UTC (permalink / raw)
  To: linux-sh

From: Wolfram Sang <wsa@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
---
 include/dt-bindings/clock/r8a7791-clock.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/dt-bindings/clock/r8a7791-clock.h b/include/dt-bindings/clock/r8a7791-clock.h
index 30f82f2..9aa60f4 100644
--- a/include/dt-bindings/clock/r8a7791-clock.h
+++ b/include/dt-bindings/clock/r8a7791-clock.h
@@ -55,6 +55,8 @@
 #define R8A7791_CLK_CMT1		29
 #define R8A7791_CLK_USBDMAC0		30
 #define R8A7791_CLK_USBDMAC1		31
+#define R8A7791_CLK_IIC0		18
+#define R8A7791_CLK_IIC1		23
 
 /* MSTP5 */
 #define R8A7791_CLK_THERMAL		22
-- 
1.8.5.1


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

* Re: [PATCH 1/4] ARM: shmobile: r8a7791: add IIC0/1 clock macros
  2014-01-07 18:57   ` Geert Uytterhoeven
                     ` (3 preceding siblings ...)
  (?)
@ 2014-02-23 22:13   ` Laurent Pinchart
  -1 siblings, 0 replies; 73+ messages in thread
From: Laurent Pinchart @ 2014-02-23 22:13 UTC (permalink / raw)
  To: linux-sh

Hi Wolfram,

Thank you for the patch.

On Sunday 23 February 2014 13:40:21 Wolfram Sang wrote:
> From: Wolfram Sang <wsa@sang-engineering.com>
> 
> Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
> ---
>  include/dt-bindings/clock/r8a7791-clock.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/dt-bindings/clock/r8a7791-clock.h
> b/include/dt-bindings/clock/r8a7791-clock.h index 30f82f2..9aa60f4 100644
> --- a/include/dt-bindings/clock/r8a7791-clock.h
> +++ b/include/dt-bindings/clock/r8a7791-clock.h
> @@ -55,6 +55,8 @@
>  #define R8A7791_CLK_CMT1		29
>  #define R8A7791_CLK_USBDMAC0		30
>  #define R8A7791_CLK_USBDMAC1		31
> +#define R8A7791_CLK_IIC0		18
> +#define R8A7791_CLK_IIC1		23

Could you please keep the entries sorted by value ?

>  /* MSTP5 */
>  #define R8A7791_CLK_THERMAL		22

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH 1/4] ARM: shmobile: r8a7791: add IIC0/1 clock macros
  2014-01-07 18:57   ` Geert Uytterhoeven
                     ` (4 preceding siblings ...)
  (?)
@ 2014-02-24 10:33   ` Wolfram Sang
  -1 siblings, 0 replies; 73+ messages in thread
From: Wolfram Sang @ 2014-02-24 10:33 UTC (permalink / raw)
  To: linux-sh

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

On Sun, Feb 23, 2014 at 11:13:42PM +0100, Laurent Pinchart wrote:
> Hi Wolfram,
> 
> Thank you for the patch.
> 
> On Sunday 23 February 2014 13:40:21 Wolfram Sang wrote:
> > From: Wolfram Sang <wsa@sang-engineering.com>
> > 
> > Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
> > ---
> >  include/dt-bindings/clock/r8a7791-clock.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/dt-bindings/clock/r8a7791-clock.h
> > b/include/dt-bindings/clock/r8a7791-clock.h index 30f82f2..9aa60f4 100644
> > --- a/include/dt-bindings/clock/r8a7791-clock.h
> > +++ b/include/dt-bindings/clock/r8a7791-clock.h
> > @@ -55,6 +55,8 @@
> >  #define R8A7791_CLK_CMT1		29
> >  #define R8A7791_CLK_USBDMAC0		30
> >  #define R8A7791_CLK_USBDMAC1		31
> > +#define R8A7791_CLK_IIC0		18
> > +#define R8A7791_CLK_IIC1		23
> 
> Could you please keep the entries sorted by value ?

Ehrm, yes, sure. Very weird, I am pretty sure I looked for the sorting
and thought I found a chornological one. Will fix.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-02-24 10:33 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-07 18:57 [PATCH 0/4] thermal: rcar: Add missing clock handling Geert Uytterhoeven
2014-01-07 18:57 ` Geert Uytterhoeven
2014-01-07 18:57 ` Geert Uytterhoeven
2014-01-07 18:57 ` [PATCH 1/4] ARM: shmobile: r8a7791: Add thermal clock in device tree Geert Uytterhoeven
2014-01-07 18:57   ` Geert Uytterhoeven
2014-01-07 18:57   ` Geert Uytterhoeven
2014-01-08  0:20   ` Laurent Pinchart
2014-01-08  0:20     ` Laurent Pinchart
2014-01-08  0:20     ` Laurent Pinchart
2014-01-08  0:52     ` Simon Horman
2014-01-08  0:52       ` Simon Horman
2014-01-08  0:52       ` Simon Horman
2014-02-23 12:40   ` [PATCH 1/4] ARM: shmobile: r8a7791: add IIC0/1 clock macros Wolfram Sang
2014-02-23 22:13   ` Laurent Pinchart
2014-02-24 10:33   ` Wolfram Sang
2014-01-07 18:57 ` [PATCH 2/4] ARM: shmobile: r8a7790: Add thermal clock in device tree Geert Uytterhoeven
2014-01-07 18:57   ` Geert Uytterhoeven
2014-01-07 18:57   ` Geert Uytterhoeven
2014-01-08  0:20   ` Laurent Pinchart
2014-01-08  0:20     ` Laurent Pinchart
2014-01-08  0:20     ` Laurent Pinchart
2014-01-08  0:52     ` Simon Horman
2014-01-08  0:52       ` Simon Horman
2014-01-08  0:52       ` Simon Horman
2014-01-14  2:25   ` [PATCH 2/4] ARM: shmobile: r8a7790: add audio clock Kuninori Morimoto
2014-01-07 18:57 ` [PATCH 3/4] thermal: rcar: Add missing clock handling Geert Uytterhoeven
2014-01-07 18:57   ` Geert Uytterhoeven
2014-01-07 18:57   ` Geert Uytterhoeven
2014-01-07 20:04   ` Sergei Shtylyov
2014-01-07 20:04     ` Sergei Shtylyov
2014-01-07 20:04     ` Sergei Shtylyov
2014-01-07 20:57   ` Gerhard Sittig
2014-01-07 20:57     ` Gerhard Sittig
2014-01-07 20:57     ` Gerhard Sittig
2014-01-08 12:20     ` Ben Dooks
2014-01-08 12:20       ` Ben Dooks
2014-01-08 12:20       ` Ben Dooks
2014-01-08  1:08   ` Kuninori Morimoto
2014-01-08  1:08     ` Kuninori Morimoto
2014-01-08  1:08     ` Kuninori Morimoto
2014-01-08 10:23     ` Geert Uytterhoeven
2014-01-08 10:23       ` Geert Uytterhoeven
2014-01-08 10:23       ` Geert Uytterhoeven
2014-01-13  8:57       ` Geert Uytterhoeven
2014-01-13  8:57         ` Geert Uytterhoeven
2014-01-13  8:57         ` Geert Uytterhoeven
2014-01-14  0:20         ` Kuninori Morimoto
2014-01-14  0:20           ` Kuninori Morimoto
2014-01-14  0:20           ` Kuninori Morimoto
2014-01-14  1:27         ` Simon Horman
2014-01-14  1:27           ` Simon Horman
2014-01-14  1:27           ` Simon Horman
2014-01-08 12:23   ` Ben Dooks
2014-01-08 12:23     ` Ben Dooks
2014-01-08 12:23     ` Ben Dooks
2014-01-08 12:58     ` Geert Uytterhoeven
2014-01-08 12:58       ` Geert Uytterhoeven
2014-01-08 12:58       ` Geert Uytterhoeven
2014-01-07 18:57 ` [PATCH -trivial 4/4] thermal: rcar: Spelling s/delaye/delay/g Geert Uytterhoeven
2014-01-07 18:57   ` Geert Uytterhoeven
2014-01-07 18:57   ` Geert Uytterhoeven
2014-01-08  0:12   ` Simon Horman
2014-01-08  0:12     ` Simon Horman
2014-01-08  0:12     ` Simon Horman
2014-01-17  8:23   ` Zhang Rui
2014-01-17  8:23     ` Zhang Rui
2014-01-17  8:23     ` Zhang Rui
2014-01-07 21:52 ` [PATCH 0/4] thermal: rcar: Add missing clock handling Valentine
2014-01-07 21:52   ` Valentine
2014-01-07 21:52   ` Valentine
2014-01-07 22:13   ` Geert Uytterhoeven
2014-01-07 22:13     ` Geert Uytterhoeven
2014-01-07 22:13     ` Geert Uytterhoeven

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.