* [PATCH 01/23] Documentation: dt: atmel-at91: add clocks to system timer, rstc and shdwc
2015-07-31 9:39 [PATCH 00/23] ARM: at91: Properly handle slow clock Alexandre Belloni
@ 2015-07-31 9:39 ` Alexandre Belloni
2015-08-05 18:11 ` Sebastian Reichel
2015-07-31 9:39 ` [PATCH 17/23] power/reset: at91-reset: remove useless at91_reset_platform_probe() Alexandre Belloni
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2015-07-31 9:39 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, linux-pm, Dmitry Eremin-Solenikov, linux-kernel,
Sebastian Reichel, Alexandre Belloni, Maxime Ripard,
Jean-Christophe Plagniol-Villard, linux-arm-kernel
The system timer (at91rm9200), the reset controller and the shutdown
controller need an input clock. This is the slow clock and they will not
function without it.
Also fix the shutdown controller example.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-pm@vger.kernel.org
Documentation/devicetree/bindings/arm/atmel-at91.txt | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt
index 424ac8cbfa08..209710cdf3aa 100644
--- a/Documentation/devicetree/bindings/arm/atmel-at91.txt
+++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt
@@ -50,6 +50,7 @@ System Timer (ST) required properties:
- reg: Should contain registers location and length
- interrupts: Should contain interrupt for the ST which is the IRQ line
shared across all System Controller members.
+- clocks: phandle to input clock.
Its subnodes can be:
- watchdog: compatible should be "atmel,at91rm9200-wdt"
@@ -89,12 +90,14 @@ RSTC Reset Controller required properties:
- compatible: Should be "atmel,<chip>-rstc".
<chip> can be "at91sam9260" or "at91sam9g45"
- reg: Should contain registers location and length
+- clocks: phandle to input clock.
Example:
rstc@fffffd00 {
compatible = "atmel,at91sam9260-rstc";
reg = <0xfffffd00 0x10>;
+ clocks = <&clk32k>;
};
RAMC SDRAM/DDR Controller required properties:
@@ -117,6 +120,7 @@ required properties:
- compatible: Should be "atmel,<chip>-shdwc".
<chip> can be "at91sam9260", "at91sam9rl" or "at91sam9x5".
- reg: Should contain registers location and length
+- clocks: phandle to input clock.
optional properties:
- atmel,wakeup-mode: String, operation mode of the wakeup mode.
@@ -135,9 +139,10 @@ optional at91sam9x5 properties:
Example:
- rstc@fffffd00 {
- compatible = "atmel,at91sam9260-rstc";
- reg = <0xfffffd00 0x10>;
+ shdwc@fffffd10 {
+ compatible = "atmel,at91sam9260-shdwc";
+ reg = <0xfffffd10 0x10>;
+ clocks = <&clk32k>;
};
Special Function Registers (SFR)
--
2.1.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 01/23] Documentation: dt: atmel-at91: add clocks to system timer, rstc and shdwc
2015-07-31 9:39 ` [PATCH 01/23] Documentation: dt: atmel-at91: add clocks to system timer, rstc and shdwc Alexandre Belloni
@ 2015-08-05 18:11 ` Sebastian Reichel
0 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2015-08-05 18:11 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Nicolas Ferre, Boris Brezillon, Maxime Ripard,
Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
Dmitry Eremin-Solenikov, linux-pm
[-- Attachment #1: Type: text/plain, Size: 360 bytes --]
Hi,
On Fri, Jul 31, 2015 at 11:39:37AM +0200, Alexandre Belloni wrote:
> The system timer (at91rm9200), the reset controller and the shutdown
> controller need an input clock. This is the slow clock and they will not
> function without it.
>
> Also fix the shutdown controller example.
Acked-By: Sebastian Reichel <sre@kernel.org>
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 17/23] power/reset: at91-reset: remove useless at91_reset_platform_probe()
2015-07-31 9:39 [PATCH 00/23] ARM: at91: Properly handle slow clock Alexandre Belloni
2015-07-31 9:39 ` [PATCH 01/23] Documentation: dt: atmel-at91: add clocks to system timer, rstc and shdwc Alexandre Belloni
@ 2015-07-31 9:39 ` Alexandre Belloni
2015-07-31 9:39 ` [PATCH 18/23] power/reset: at91-reset: get and use slow clock Alexandre Belloni
` (3 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2015-07-31 9:39 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Maxime Ripard, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Alexandre Belloni,
Sebastian Reichel, Dmitry Eremin-Solenikov, linux-pm
Since all the at91 platforms are now DT only, at91_reset_platform_probe()
is now useless, remove it.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-pm@vger.kernel.or
drivers/power/reset/at91-reset.c | 47 +++-------------------------------------
1 file changed, 3 insertions(+), 44 deletions(-)
diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
index 36dc52fb2ec8..3225c8590ed0 100644
--- a/drivers/power/reset/at91-reset.c
+++ b/drivers/power/reset/at91-reset.c
@@ -169,11 +169,11 @@ static struct notifier_block at91_restart_nb = {
.priority = 192,
};
-static int at91_reset_of_probe(struct platform_device *pdev)
+static int at91_reset_probe(struct platform_device *pdev)
{
const struct of_device_id *match;
struct device_node *np;
- int idx = 0;
+ int ret, idx = 0;
at91_rstc_base = of_iomap(pdev->dev.of_node, 0);
if (!at91_rstc_base) {
@@ -192,49 +192,8 @@ static int at91_reset_of_probe(struct platform_device *pdev)
match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
at91_restart_nb.notifier_call = match->data;
- return register_restart_handler(&at91_restart_nb);
-}
-
-static int at91_reset_platform_probe(struct platform_device *pdev)
-{
- const struct platform_device_id *match;
- struct resource *res;
- int idx = 0;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- at91_rstc_base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(at91_rstc_base)) {
- dev_err(&pdev->dev, "Could not map reset controller address\n");
- return PTR_ERR(at91_rstc_base);
- }
-
- for (idx = 0; idx < 2; idx++) {
- res = platform_get_resource(pdev, IORESOURCE_MEM, idx + 1 );
- at91_ramc_base[idx] = devm_ioremap(&pdev->dev, res->start,
- resource_size(res));
- if (!at91_ramc_base[idx]) {
- dev_err(&pdev->dev, "Could not map ram controller address\n");
- return -ENOMEM;
- }
- }
-
- match = platform_get_device_id(pdev);
- at91_restart_nb.notifier_call =
- (int (*)(struct notifier_block *,
- unsigned long, void *)) match->driver_data;
-
- return register_restart_handler(&at91_restart_nb);
-}
-
-static int at91_reset_probe(struct platform_device *pdev)
-{
- int ret;
-
- if (pdev->dev.of_node)
- ret = at91_reset_of_probe(pdev);
- else
- ret = at91_reset_platform_probe(pdev);
+ ret = register_restart_handler(&at91_restart_nb);
if (ret)
return ret;
--
2.1.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 18/23] power/reset: at91-reset: get and use slow clock
2015-07-31 9:39 [PATCH 00/23] ARM: at91: Properly handle slow clock Alexandre Belloni
2015-07-31 9:39 ` [PATCH 01/23] Documentation: dt: atmel-at91: add clocks to system timer, rstc and shdwc Alexandre Belloni
2015-07-31 9:39 ` [PATCH 17/23] power/reset: at91-reset: remove useless at91_reset_platform_probe() Alexandre Belloni
@ 2015-07-31 9:39 ` Alexandre Belloni
2015-08-05 18:22 ` Sebastian Reichel
2015-07-31 9:39 ` [PATCH 19/23] power/reset: at91-poweroff: " Alexandre Belloni
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2015-07-31 9:39 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Maxime Ripard, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Alexandre Belloni,
Sebastian Reichel, Dmitry Eremin-Solenikov, linux-pm
Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
hang") added a workaround for the slow clock as it is not properly handled
by its users.
Get and use the slow clock as it is necessary for the at91 reset
controller.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-pm@vger.kernel.org
drivers/power/reset/at91-reset.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
index 3225c8590ed0..19fdd4c107dc 100644
--- a/drivers/power/reset/at91-reset.c
+++ b/drivers/power/reset/at91-reset.c
@@ -11,6 +11,7 @@
* warranty of any kind, whether express or implied.
*/
+#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of_address.h>
@@ -46,6 +47,7 @@ enum reset_type {
};
static void __iomem *at91_ramc_base[2], *at91_rstc_base;
+static struct clk *sclk;
/*
* unless the SDRAM is cleanly shutdown before we hit the
@@ -193,9 +195,21 @@ static int at91_reset_probe(struct platform_device *pdev)
match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
at91_restart_nb.notifier_call = match->data;
+ sclk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(sclk))
+ return PTR_ERR(sclk);
+
+ ret = clk_prepare_enable(sclk);
+ if (ret) {
+ dev_err(&pdev->dev, "Could not enable slow clock\n");
+ return ret;
+ }
+
ret = register_restart_handler(&at91_restart_nb);
- if (ret)
+ if (ret) {
+ clk_disable_unprepare(sclk);
return ret;
+ }
at91_reset_status(pdev);
--
2.1.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 18/23] power/reset: at91-reset: get and use slow clock
2015-07-31 9:39 ` [PATCH 18/23] power/reset: at91-reset: get and use slow clock Alexandre Belloni
@ 2015-08-05 18:22 ` Sebastian Reichel
2015-08-10 15:50 ` Alexandre Belloni
0 siblings, 1 reply; 13+ messages in thread
From: Sebastian Reichel @ 2015-08-05 18:22 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Nicolas Ferre, Boris Brezillon, Maxime Ripard,
Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
Dmitry Eremin-Solenikov, linux-pm
[-- Attachment #1: Type: text/plain, Size: 454 bytes --]
Hi,
On Fri, Jul 31, 2015 at 11:39:54AM +0200, Alexandre Belloni wrote:
> Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
> hang") added a workaround for the slow clock as it is not properly handled
> by its users.
>
> Get and use the slow clock as it is necessary for the at91 reset
> controller.
You call clk_prepare_enable during probe without a matching
clk_disable_unprepare on module removal.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 18/23] power/reset: at91-reset: get and use slow clock
2015-08-05 18:22 ` Sebastian Reichel
@ 2015-08-10 15:50 ` Alexandre Belloni
2015-08-10 17:11 ` Sebastian Reichel
0 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2015-08-10 15:50 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Nicolas Ferre, Boris Brezillon, Maxime Ripard,
Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
Dmitry Eremin-Solenikov, linux-pm
On 05/08/2015 at 20:22:20 +0200, Sebastian Reichel wrote :
> Hi,
>
> On Fri, Jul 31, 2015 at 11:39:54AM +0200, Alexandre Belloni wrote:
> > Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
> > hang") added a workaround for the slow clock as it is not properly handled
> > by its users.
> >
> > Get and use the slow clock as it is necessary for the at91 reset
> > controller.
>
> You call clk_prepare_enable during probe without a matching
> clk_disable_unprepare on module removal.
>
They will never be compiled as modules as the Kconfig option is a bool
so we don't have a .remove and the module will never be removed.
Do you want me to change at91-reset and at91-poweroff to work as
modules?
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 18/23] power/reset: at91-reset: get and use slow clock
2015-08-10 15:50 ` Alexandre Belloni
@ 2015-08-10 17:11 ` Sebastian Reichel
0 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2015-08-10 17:11 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Nicolas Ferre, Boris Brezillon, Maxime Ripard,
Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
Dmitry Eremin-Solenikov, linux-pm
[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]
Hi,
On Mon, Aug 10, 2015 at 05:50:05PM +0200, Alexandre Belloni wrote:
> On 05/08/2015 at 20:22:20 +0200, Sebastian Reichel wrote :
> > On Fri, Jul 31, 2015 at 11:39:54AM +0200, Alexandre Belloni wrote:
> > > Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
> > > hang") added a workaround for the slow clock as it is not properly handled
> > > by its users.
> > >
> > > Get and use the slow clock as it is necessary for the at91 reset
> > > controller.
> >
> > You call clk_prepare_enable during probe without a matching
> > clk_disable_unprepare on module removal.
>
> They will never be compiled as modules as the Kconfig option is a
> bool so we don't have a .remove and the module will never be removed.
In that case the module_platform_driver() statement at the bottom
should be replaced with builtin_platform_driver().
> Do you want me to change at91-reset and at91-poweroff to work as
> modules?
That would also be fine.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 19/23] power/reset: at91-poweroff: get and use slow clock
2015-07-31 9:39 [PATCH 00/23] ARM: at91: Properly handle slow clock Alexandre Belloni
` (2 preceding siblings ...)
2015-07-31 9:39 ` [PATCH 18/23] power/reset: at91-reset: get and use slow clock Alexandre Belloni
@ 2015-07-31 9:39 ` Alexandre Belloni
2015-08-05 18:22 ` Sebastian Reichel
2015-07-31 9:59 ` [PATCH 00/23] ARM: at91: Properly handle " Boris Brezillon
2015-07-31 15:21 ` Alexandre Belloni
5 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2015-07-31 9:39 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Maxime Ripard, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Alexandre Belloni,
Sebastian Reichel, Dmitry Eremin-Solenikov, linux-pm
Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
hang") added a workaround for the slow clock as it is not properly handled
by its users.
Get and use the slow clock as it is necessary for the at91 shutdown
controller.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-pm@vger.kernel.org
drivers/power/reset/at91-poweroff.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c
index 9847cfb7e23d..fadd1a41729b 100644
--- a/drivers/power/reset/at91-poweroff.c
+++ b/drivers/power/reset/at91-poweroff.c
@@ -10,6 +10,7 @@
* warranty of any kind, whether express or implied.
*/
+#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -48,6 +49,7 @@ static const char *shdwc_wakeup_modes[] = {
};
static void __iomem *at91_shdwc_base;
+static struct clk *sclk;
static void __init at91_wakeup_status(void)
{
@@ -122,6 +124,7 @@ static void at91_poweroff_dt_set_wakeup_mode(struct platform_device *pdev)
static int at91_poweroff_probe(struct platform_device *pdev)
{
struct resource *res;
+ int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
at91_shdwc_base = devm_ioremap_resource(&pdev->dev, res);
@@ -130,6 +133,16 @@ static int at91_poweroff_probe(struct platform_device *pdev)
return PTR_ERR(at91_shdwc_base);
}
+ sclk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(sclk))
+ return PTR_ERR(sclk);
+
+ ret = clk_prepare_enable(sclk);
+ if (ret) {
+ dev_err(&pdev->dev, "Could not enable slow clock\n");
+ return ret;
+ }
+
at91_wakeup_status();
if (pdev->dev.of_node)
--
2.1.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 19/23] power/reset: at91-poweroff: get and use slow clock
2015-07-31 9:39 ` [PATCH 19/23] power/reset: at91-poweroff: " Alexandre Belloni
@ 2015-08-05 18:22 ` Sebastian Reichel
0 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2015-08-05 18:22 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Nicolas Ferre, Boris Brezillon, Maxime Ripard,
Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
Dmitry Eremin-Solenikov, linux-pm
[-- Attachment #1: Type: text/plain, Size: 457 bytes --]
Hi,
On Fri, Jul 31, 2015 at 11:39:55AM +0200, Alexandre Belloni wrote:
> Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
> hang") added a workaround for the slow clock as it is not properly handled
> by its users.
>
> Get and use the slow clock as it is necessary for the at91 shutdown
> controller.
You call clk_prepare_enable during probe without a matching
clk_disable_unprepare on module removal.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 00/23] ARM: at91: Properly handle slow clock
2015-07-31 9:39 [PATCH 00/23] ARM: at91: Properly handle slow clock Alexandre Belloni
` (3 preceding siblings ...)
2015-07-31 9:39 ` [PATCH 19/23] power/reset: at91-poweroff: " Alexandre Belloni
@ 2015-07-31 9:59 ` Boris Brezillon
2015-07-31 10:20 ` Alexandre Belloni
2015-07-31 15:21 ` Alexandre Belloni
5 siblings, 1 reply; 13+ messages in thread
From: Boris Brezillon @ 2015-07-31 9:59 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Nicolas Ferre, Maxime Ripard, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Alessandro Zummo, Arnd Bergmann,
Daniel Lezcano, Dmitry Eremin-Solenikov, Greg Kroah-Hartman,
linux-clk, linux-pm, linux-pwm, linux-watchdog, Michael Turquette,
rtc-linux, Sebastian Reichel, Stephen Boyd, Thierry Reding,
Thomas Gleixner, Wim Van Sebroeck
Hi Alexandre,
On Fri, 31 Jul 2015 11:39:36 +0200
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:
> Hi,
>
> It was discovered that all the slow clock user were not properly claiming it.
> This can end up in a system hang because the last registered user is releasing
> it, and it gets disabled.
>
> commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system hang")
> was a workaround. This series is adding the slow clock to the necessary drivers
> to avoid the issue and then removes that workaround.
>
> The Documentation updates and DT patches should probably go through the AT91
> tree this cycle to avoid breakage.
>
> Then the other patches can go through each subsystem tree. They are trivial
> enough to also go in this cycle.
>
> The final clk patch depends on the other ones and may be taken for the next
> cycle to avoid synchronization issues.
>
> I've thrown in a cleanup for at91-reset as it avoids adding support for that
> clock to the platform data initialization
I would have squashed commit 5 to 14 into a single patch, but apart
from that it looks good to me.
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Thanks,
Boris
>
> Changes in v2:
> - statisticize the global in the atmel-st change
> - merge at91_reset_of_probe() in at91_reset_probe()
> - added patches from Boris for the TCB
> - added the slow clock to the TCB
>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-clk@vger.kernel.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-pwm@vger.kernel.org
> Cc: linux-watchdog@vger.kernel.org
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: rtc-linux@googlegroups.com
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Wim Van Sebroeck <wim@iguana.be>
>
> Alexandre Belloni (20):
> Documentation: dt: atmel-at91: add clocks to system timer, rstc and
> shdwc
> Documentation: watchdog: at91sam9_wdt: add clocks property
> Documentation: dt: rtc: at91rm9200: add clocks property
> ARM: at91/dt: at91rm9200: use slow clock where necessary
> ARM: at91/dt: at91sam9260: use slow clock where necessary
> ARM: at91/dt: at91sam9261: use slow clock where necessary
> ARM: at91/dt: at91sam9263: use slow clock where necessary
> ARM: at91/dt: at91sam9g45: use slow clock where necessary
> ARM: at91/dt: at91sam9n12: use slow clock where necessary
> ARM: at91/dt: at91sam9rl: use slow clock where necessary
> ARM: at91/dt: at91sam9x5: use slow clock where necessary
> ARM: at91/dt: sama5d3: use slow clock where necessary
> ARM: at91/dt: sama5d4: use slow clock where necessary
> rtc: at91rm9200: get and use slow clock
> watchdog: at91sam9: get and use slow clock
> power/reset: at91-reset: remove useless at91_reset_platform_probe()
> power/reset: at91-reset: get and use slow clock
> power/reset: at91-poweroff: get and use slow clock
> clocksource: atmel-st: get and use slow clock
> clk: at91: Revert "keep slow clk enabled to prevent system hang"
>
> Boris Brezillon (3):
> Documentation: dt: atmel-at91: add slow clock to tcb
> clocksource: tcb_clksrc: fix setup_clkevents error path
> misc: atmel_tclib: get and use slow clock
>
> .../devicetree/bindings/arm/atmel-at91.txt | 13 +++--
> .../bindings/rtc/atmel,at91rm9200-rtc.txt | 2 +
> .../devicetree/bindings/watchdog/atmel-wdt.txt | 2 +
> arch/arm/boot/dts/at91rm9200.dtsi | 10 ++--
> arch/arm/boot/dts/at91sam9260.dtsi | 11 +++--
> arch/arm/boot/dts/at91sam9261.dtsi | 7 ++-
> arch/arm/boot/dts/at91sam9263.dtsi | 7 ++-
> arch/arm/boot/dts/at91sam9g45.dtsi | 12 +++--
> arch/arm/boot/dts/at91sam9n12.dtsi | 12 +++--
> arch/arm/boot/dts/at91sam9rl.dtsi | 8 ++-
> arch/arm/boot/dts/at91sam9x5.dtsi | 12 +++--
> arch/arm/boot/dts/sama5d3.dtsi | 8 ++-
> arch/arm/boot/dts/sama5d3_tcb1.dtsi | 4 +-
> arch/arm/boot/dts/sama5d4.dtsi | 12 +++--
> drivers/clk/at91/clk-slow.c | 27 ----------
> drivers/clocksource/tcb_clksrc.c | 10 +++-
> drivers/clocksource/timer-atmel-st.c | 31 ++++++++----
> drivers/misc/atmel_tclib.c | 4 ++
> drivers/power/reset/at91-poweroff.c | 13 +++++
> drivers/power/reset/at91-reset.c | 57 ++++++----------------
> drivers/pwm/pwm-atmel-tcb.c | 23 ++++++---
> drivers/rtc/rtc-at91rm9200.c | 27 ++++++++--
> drivers/watchdog/at91sam9_wdt.c | 22 ++++++++-
> include/linux/atmel_tc.h | 1 +
> 24 files changed, 206 insertions(+), 129 deletions(-)
>
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 00/23] ARM: at91: Properly handle slow clock
2015-07-31 9:59 ` [PATCH 00/23] ARM: at91: Properly handle " Boris Brezillon
@ 2015-07-31 10:20 ` Alexandre Belloni
0 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2015-07-31 10:20 UTC (permalink / raw)
To: Boris Brezillon
Cc: Nicolas Ferre, Maxime Ripard, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Alessandro Zummo, Arnd Bergmann,
Daniel Lezcano, Dmitry Eremin-Solenikov, Greg Kroah-Hartman,
linux-clk, linux-pm, linux-pwm, linux-watchdog, Michael Turquette,
rtc-linux, Sebastian Reichel, Stephen Boyd, Thierry Reding,
Thomas Gleixner, Wim Van Sebroeck
Hi,
On 31/07/2015 at 11:59:03 +0200, Boris Brezillon wrote :
> I would have squashed commit 5 to 14 into a single patch, but apart
> from that it looks good to me.
>
I wanted to clearly list were the slow clock was needed for each soc. It
actually allowed me to find one that was missing.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 00/23] ARM: at91: Properly handle slow clock
2015-07-31 9:39 [PATCH 00/23] ARM: at91: Properly handle slow clock Alexandre Belloni
` (4 preceding siblings ...)
2015-07-31 9:59 ` [PATCH 00/23] ARM: at91: Properly handle " Boris Brezillon
@ 2015-07-31 15:21 ` Alexandre Belloni
5 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2015-07-31 15:21 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Maxime Ripard, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Alessandro Zummo, Arnd Bergmann,
Daniel Lezcano, Dmitry Eremin-Solenikov, Greg Kroah-Hartman,
linux-clk, linux-pm, linux-pwm, linux-watchdog, Michael Turquette,
rtc-linux, Sebastian Reichel, Stephen Boyd, Thierry Reding,
Thomas Gleixner, Wim Van Sebroeck
Hi,
I realize now that I forgot to add the v2 tag in the subject lines. This
is really v2 :)
On 31/07/2015 at 11:39:36 +0200, Alexandre Belloni wrote :
> Hi,
>
> It was discovered that all the slow clock user were not properly claiming it.
> This can end up in a system hang because the last registered user is releasing
> it, and it gets disabled.
>
> commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system hang")
> was a workaround. This series is adding the slow clock to the necessary drivers
> to avoid the issue and then removes that workaround.
>
> The Documentation updates and DT patches should probably go through the AT91
> tree this cycle to avoid breakage.
>
> Then the other patches can go through each subsystem tree. They are trivial
> enough to also go in this cycle.
>
> The final clk patch depends on the other ones and may be taken for the next
> cycle to avoid synchronization issues.
>
> I've thrown in a cleanup for at91-reset as it avoids adding support for that
> clock to the platform data initialization
>
> Changes in v2:
> - statisticize the global in the atmel-st change
> - merge at91_reset_of_probe() in at91_reset_probe()
> - added patches from Boris for the TCB
> - added the slow clock to the TCB
>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-clk@vger.kernel.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-pwm@vger.kernel.org
> Cc: linux-watchdog@vger.kernel.org
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: rtc-linux@googlegroups.com
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Wim Van Sebroeck <wim@iguana.be>
>
> Alexandre Belloni (20):
> Documentation: dt: atmel-at91: add clocks to system timer, rstc and
> shdwc
> Documentation: watchdog: at91sam9_wdt: add clocks property
> Documentation: dt: rtc: at91rm9200: add clocks property
> ARM: at91/dt: at91rm9200: use slow clock where necessary
> ARM: at91/dt: at91sam9260: use slow clock where necessary
> ARM: at91/dt: at91sam9261: use slow clock where necessary
> ARM: at91/dt: at91sam9263: use slow clock where necessary
> ARM: at91/dt: at91sam9g45: use slow clock where necessary
> ARM: at91/dt: at91sam9n12: use slow clock where necessary
> ARM: at91/dt: at91sam9rl: use slow clock where necessary
> ARM: at91/dt: at91sam9x5: use slow clock where necessary
> ARM: at91/dt: sama5d3: use slow clock where necessary
> ARM: at91/dt: sama5d4: use slow clock where necessary
> rtc: at91rm9200: get and use slow clock
> watchdog: at91sam9: get and use slow clock
> power/reset: at91-reset: remove useless at91_reset_platform_probe()
> power/reset: at91-reset: get and use slow clock
> power/reset: at91-poweroff: get and use slow clock
> clocksource: atmel-st: get and use slow clock
> clk: at91: Revert "keep slow clk enabled to prevent system hang"
>
> Boris Brezillon (3):
> Documentation: dt: atmel-at91: add slow clock to tcb
> clocksource: tcb_clksrc: fix setup_clkevents error path
> misc: atmel_tclib: get and use slow clock
>
> .../devicetree/bindings/arm/atmel-at91.txt | 13 +++--
> .../bindings/rtc/atmel,at91rm9200-rtc.txt | 2 +
> .../devicetree/bindings/watchdog/atmel-wdt.txt | 2 +
> arch/arm/boot/dts/at91rm9200.dtsi | 10 ++--
> arch/arm/boot/dts/at91sam9260.dtsi | 11 +++--
> arch/arm/boot/dts/at91sam9261.dtsi | 7 ++-
> arch/arm/boot/dts/at91sam9263.dtsi | 7 ++-
> arch/arm/boot/dts/at91sam9g45.dtsi | 12 +++--
> arch/arm/boot/dts/at91sam9n12.dtsi | 12 +++--
> arch/arm/boot/dts/at91sam9rl.dtsi | 8 ++-
> arch/arm/boot/dts/at91sam9x5.dtsi | 12 +++--
> arch/arm/boot/dts/sama5d3.dtsi | 8 ++-
> arch/arm/boot/dts/sama5d3_tcb1.dtsi | 4 +-
> arch/arm/boot/dts/sama5d4.dtsi | 12 +++--
> drivers/clk/at91/clk-slow.c | 27 ----------
> drivers/clocksource/tcb_clksrc.c | 10 +++-
> drivers/clocksource/timer-atmel-st.c | 31 ++++++++----
> drivers/misc/atmel_tclib.c | 4 ++
> drivers/power/reset/at91-poweroff.c | 13 +++++
> drivers/power/reset/at91-reset.c | 57 ++++++----------------
> drivers/pwm/pwm-atmel-tcb.c | 23 ++++++---
> drivers/rtc/rtc-at91rm9200.c | 27 ++++++++--
> drivers/watchdog/at91sam9_wdt.c | 22 ++++++++-
> include/linux/atmel_tc.h | 1 +
> 24 files changed, 206 insertions(+), 129 deletions(-)
>
> --
> 2.1.4
>
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 13+ messages in thread