Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Guenter Roeck

On 01/25/2015 12:15 PM, Guenter Roeck wrote:

Hi Sebastian,

On 01/25/2015 12:06 PM, Sebastian Reichel wrote:


Maybe update the battery/master branch?



I thought I did. Tip is "99a7956 power: ds2782_battery: Simplify the PM hooks"

Does that look correct ?


Never mind, that was -next. I just resent the series, rebased on top of 
battery/master.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Guenter Roeck

Hi Sebastian,

On 01/25/2015 12:06 PM, Sebastian Reichel wrote:


Maybe update the battery/master branch?



I thought I did. Tip is "99a7956 power: ds2782_battery: Simplify the PM hooks"

Does that look correct ?

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Sebastian Reichel
Hi Guenter,

On Sun, Jan 25, 2015 at 11:07:16AM -0800, Guenter Roeck wrote:
> On 01/25/2015 10:40 AM, Sebastian Reichel wrote:
> >On Sun, Jan 25, 2015 at 10:13:37AM -0800, Guenter Roeck wrote:
> >>Register with kernel restart handler instead of setting arm_pm_restart
> >>directly. Select high priority since the restart handler is instantiated
> >>through devicetree, indicating that it should be used if configured.
> >
> >This does not apply clean for me. Please rebase on top of
> >
> >http://git.infradead.org/battery-2.6.git/
> 
> Sure, will do. I assume you mean battery/next-next since it applies cleanly
> to battery/master.

uhm no, I was talking about battery/master.
It does not apply cleanly for me:

Applying: power/reset: arm-versatile: Register with kernel restart handler
error: patch failed: drivers/power/reset/arm-versatile-reboot.c:13
error: drivers/power/reset/arm-versatile-reboot.c: patch does not apply

The error looks correct:

$ grep -A8 "+++ b/drivers/power/reset/arm-versatile-reboot.c" 
guenter_roeck.patch
+++ b/drivers/power/reset/arm-versatile-reboot.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define REALVIEW_SYS_LOCK_OFFSET   0x20
 #define REALVIEW_SYS_LOCK_VAL  0xA05F
$ git blame -L13,20 drivers/power/reset/arm-versatile-reboot.c
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 13) #include 
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 14) #include 
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 15) #include 
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 16) #include 

0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 17) 
0160817d (Linus Walleij 2014-12-19 16:56:27 +0100 18) #define 
INTEGRATOR_HDR_CTRL_OFFSET0x0C
0160817d (Linus Walleij 2014-12-19 16:56:27 +0100 19) #define 
INTEGRATOR_HDR_LOCK_OFFSET0x14
0160817d (Linus Walleij 2014-12-19 16:56:27 +0100 20) #define 
INTEGRATOR_CM_CTRL_RESET  (1 << 3)
$ git show -s --format=%ci 0160817d
2015-01-20 13:58:27 +0100

Maybe update the battery/master branch?

-- Sebastian


signature.asc
Description: Digital signature


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Guenter Roeck

On 01/25/2015 10:40 AM, Sebastian Reichel wrote:

Hi,

On Sun, Jan 25, 2015 at 10:13:37AM -0800, Guenter Roeck wrote:

Register with kernel restart handler instead of setting arm_pm_restart
directly. Select high priority since the restart handler is instantiated
through devicetree, indicating that it should be used if configured.


This does not apply clean for me. Please rebase on top of

http://git.infradead.org/battery-2.6.git/



Hi Sebastian,

Sure, will do. I assume you mean battery/next-next since it applies cleanly
to battery/master.

Thanks,
Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Sebastian Reichel
Hi,

On Sun, Jan 25, 2015 at 10:13:37AM -0800, Guenter Roeck wrote:
> Register with kernel restart handler instead of setting arm_pm_restart
> directly. Select high priority since the restart handler is instantiated
> through devicetree, indicating that it should be used if configured.

This does not apply clean for me. Please rebase on top of 

http://git.infradead.org/battery-2.6.git/

-- Sebastian


signature.asc
Description: Digital signature


[PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Guenter Roeck
Register with kernel restart handler instead of setting arm_pm_restart
directly. Select high priority since the restart handler is instantiated
through devicetree, indicating that it should be used if configured.

Signed-off-by: Guenter Roeck 
---
 drivers/power/reset/arm-versatile-reboot.c | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/power/reset/arm-versatile-reboot.c 
b/drivers/power/reset/arm-versatile-reboot.c
index 5b08bff..e533812 100644
--- a/drivers/power/reset/arm-versatile-reboot.c
+++ b/drivers/power/reset/arm-versatile-reboot.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define REALVIEW_SYS_LOCK_OFFSET   0x20
 #define REALVIEW_SYS_LOCK_VAL  0xA05F
@@ -57,7 +56,8 @@ static const struct of_device_id versatile_reboot_of_match[] 
= {
},
 };
 
-static void versatile_reboot(enum reboot_mode mode, const char *cmd)
+static int versatile_reboot(struct notifier_block *this, unsigned long mode,
+   void *cmd)
 {
/* Unlock the reset register */
regmap_write(syscon_regmap, REALVIEW_SYS_LOCK_OFFSET,
@@ -87,12 +87,20 @@ static void versatile_reboot(enum reboot_mode mode, const 
char *cmd)
break;
}
dsb();
+
+   return NOTIFY_DONE;
 }
 
+static struct notifier_block versatile_reboot_nb = {
+   .notifier_call = versatile_reboot,
+   .priority = 192,
+};
+
 static int __init versatile_reboot_probe(void)
 {
const struct of_device_id *reboot_id;
struct device_node *np;
+   int err;
 
np = of_find_matching_node_and_match(NULL, versatile_reboot_of_match,
 _id);
@@ -104,7 +112,10 @@ static int __init versatile_reboot_probe(void)
if (IS_ERR(syscon_regmap))
return PTR_ERR(syscon_regmap);
 
-   arm_pm_restart = versatile_reboot;
+   err = register_restart_handler(_reboot_nb);
+   if (err)
+   return err;
+
pr_info("versatile reboot driver registered\n");
return 0;
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Guenter Roeck

On 01/25/2015 10:40 AM, Sebastian Reichel wrote:

Hi,

On Sun, Jan 25, 2015 at 10:13:37AM -0800, Guenter Roeck wrote:

Register with kernel restart handler instead of setting arm_pm_restart
directly. Select high priority since the restart handler is instantiated
through devicetree, indicating that it should be used if configured.


This does not apply clean for me. Please rebase on top of

http://git.infradead.org/battery-2.6.git/



Hi Sebastian,

Sure, will do. I assume you mean battery/next-next since it applies cleanly
to battery/master.

Thanks,
Guenter

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Sebastian Reichel
Hi,

On Sun, Jan 25, 2015 at 10:13:37AM -0800, Guenter Roeck wrote:
 Register with kernel restart handler instead of setting arm_pm_restart
 directly. Select high priority since the restart handler is instantiated
 through devicetree, indicating that it should be used if configured.

This does not apply clean for me. Please rebase on top of 

http://git.infradead.org/battery-2.6.git/

-- Sebastian


signature.asc
Description: Digital signature


[PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Guenter Roeck
Register with kernel restart handler instead of setting arm_pm_restart
directly. Select high priority since the restart handler is instantiated
through devicetree, indicating that it should be used if configured.

Signed-off-by: Guenter Roeck li...@roeck-us.net
---
 drivers/power/reset/arm-versatile-reboot.c | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/power/reset/arm-versatile-reboot.c 
b/drivers/power/reset/arm-versatile-reboot.c
index 5b08bff..e533812 100644
--- a/drivers/power/reset/arm-versatile-reboot.c
+++ b/drivers/power/reset/arm-versatile-reboot.c
@@ -13,7 +13,6 @@
 #include linux/reboot.h
 #include linux/regmap.h
 #include linux/of.h
-#include asm/system_misc.h
 
 #define REALVIEW_SYS_LOCK_OFFSET   0x20
 #define REALVIEW_SYS_LOCK_VAL  0xA05F
@@ -57,7 +56,8 @@ static const struct of_device_id versatile_reboot_of_match[] 
= {
},
 };
 
-static void versatile_reboot(enum reboot_mode mode, const char *cmd)
+static int versatile_reboot(struct notifier_block *this, unsigned long mode,
+   void *cmd)
 {
/* Unlock the reset register */
regmap_write(syscon_regmap, REALVIEW_SYS_LOCK_OFFSET,
@@ -87,12 +87,20 @@ static void versatile_reboot(enum reboot_mode mode, const 
char *cmd)
break;
}
dsb();
+
+   return NOTIFY_DONE;
 }
 
+static struct notifier_block versatile_reboot_nb = {
+   .notifier_call = versatile_reboot,
+   .priority = 192,
+};
+
 static int __init versatile_reboot_probe(void)
 {
const struct of_device_id *reboot_id;
struct device_node *np;
+   int err;
 
np = of_find_matching_node_and_match(NULL, versatile_reboot_of_match,
 reboot_id);
@@ -104,7 +112,10 @@ static int __init versatile_reboot_probe(void)
if (IS_ERR(syscon_regmap))
return PTR_ERR(syscon_regmap);
 
-   arm_pm_restart = versatile_reboot;
+   err = register_restart_handler(versatile_reboot_nb);
+   if (err)
+   return err;
+
pr_info(versatile reboot driver registered\n);
return 0;
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Sebastian Reichel
Hi Guenter,

On Sun, Jan 25, 2015 at 11:07:16AM -0800, Guenter Roeck wrote:
 On 01/25/2015 10:40 AM, Sebastian Reichel wrote:
 On Sun, Jan 25, 2015 at 10:13:37AM -0800, Guenter Roeck wrote:
 Register with kernel restart handler instead of setting arm_pm_restart
 directly. Select high priority since the restart handler is instantiated
 through devicetree, indicating that it should be used if configured.
 
 This does not apply clean for me. Please rebase on top of
 
 http://git.infradead.org/battery-2.6.git/
 
 Sure, will do. I assume you mean battery/next-next since it applies cleanly
 to battery/master.

uhm no, I was talking about battery/master.
It does not apply cleanly for me:

Applying: power/reset: arm-versatile: Register with kernel restart handler
error: patch failed: drivers/power/reset/arm-versatile-reboot.c:13
error: drivers/power/reset/arm-versatile-reboot.c: patch does not apply

The error looks correct:

$ grep -A8 +++ b/drivers/power/reset/arm-versatile-reboot.c 
guenter_roeck.patch
+++ b/drivers/power/reset/arm-versatile-reboot.c
@@ -13,7 +13,6 @@
 #include linux/reboot.h
 #include linux/regmap.h
 #include linux/of.h
-#include asm/system_misc.h
 
 #define REALVIEW_SYS_LOCK_OFFSET   0x20
 #define REALVIEW_SYS_LOCK_VAL  0xA05F
$ git blame -L13,20 drivers/power/reset/arm-versatile-reboot.c
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 13) #include linux/reboot.h
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 14) #include linux/regmap.h
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 15) #include linux/of.h
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 16) #include 
asm/system_misc.h
0e545f57 (Linus Walleij 2014-05-22 10:20:38 +0200 17) 
0160817d (Linus Walleij 2014-12-19 16:56:27 +0100 18) #define 
INTEGRATOR_HDR_CTRL_OFFSET0x0C
0160817d (Linus Walleij 2014-12-19 16:56:27 +0100 19) #define 
INTEGRATOR_HDR_LOCK_OFFSET0x14
0160817d (Linus Walleij 2014-12-19 16:56:27 +0100 20) #define 
INTEGRATOR_CM_CTRL_RESET  (1  3)
$ git show -s --format=%ci 0160817d
2015-01-20 13:58:27 +0100

Maybe update the battery/master branch?

-- Sebastian


signature.asc
Description: Digital signature


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Guenter Roeck

Hi Sebastian,

On 01/25/2015 12:06 PM, Sebastian Reichel wrote:


Maybe update the battery/master branch?



I thought I did. Tip is 99a7956 power: ds2782_battery: Simplify the PM hooks

Does that look correct ?

Guenter

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] power/reset: arm-versatile: Register with kernel restart handler

2015-01-25 Thread Guenter Roeck

On 01/25/2015 12:15 PM, Guenter Roeck wrote:

Hi Sebastian,

On 01/25/2015 12:06 PM, Sebastian Reichel wrote:


Maybe update the battery/master branch?



I thought I did. Tip is 99a7956 power: ds2782_battery: Simplify the PM hooks

Does that look correct ?


Never mind, that was -next. I just resent the series, rebased on top of 
battery/master.

Guenter

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/