* [PATCH] mfd: axp20x: Add a 500ms delay at the end of axp20x_power_off
@ 2016-06-05 13:50 Hans de Goede
2016-06-05 15:03 ` Chen-Yu Tsai
2016-06-08 15:42 ` Lee Jones
0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2016-06-05 13:50 UTC (permalink / raw)
To: linux-arm-kernel
The kernel expects the power_off function to not return, and if it does
it panics. At a slight delay after the i2c write which turns off power
through the pmic, to give capacitors etc. some time to drain.
Without this the kernel lives on long enough after the poweroff to
print the following on the serial console on my Mele A1000G quad:
[ 248.583588] reboot: Power down
[ 248.600490] Kernel pa
With the delay the start of printing "Kernel panic" is gone.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/mfd/axp20x.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 6364dab..fd80b09 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -17,6 +17,7 @@
*/
#include <linux/err.h>
+#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
@@ -677,6 +678,9 @@ static void axp20x_power_off(void)
regmap_write(axp20x_pm_power_off->regmap, AXP20X_OFF_CTRL,
AXP20X_OFF);
+
+ /* Give capacitors etc. time to drain to avoid kernel panic msg. */
+ msleep(500);
}
int axp20x_match_device(struct axp20x_dev *axp20x)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] mfd: axp20x: Add a 500ms delay at the end of axp20x_power_off
2016-06-05 13:50 [PATCH] mfd: axp20x: Add a 500ms delay at the end of axp20x_power_off Hans de Goede
@ 2016-06-05 15:03 ` Chen-Yu Tsai
2016-06-08 15:42 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Chen-Yu Tsai @ 2016-06-05 15:03 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Jun 5, 2016 at 9:50 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> The kernel expects the power_off function to not return, and if it does
> it panics. At a slight delay after the i2c write which turns off power
^^^ Add?
Otherwise,
Acked-by: Chen-Yu Tsai <wens@csie.org>
> through the pmic, to give capacitors etc. some time to drain.
>
> Without this the kernel lives on long enough after the poweroff to
> print the following on the serial console on my Mele A1000G quad:
>
> [ 248.583588] reboot: Power down
> [ 248.600490] Kernel pa
>
> With the delay the start of printing "Kernel panic" is gone.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/mfd/axp20x.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 6364dab..fd80b09 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -17,6 +17,7 @@
> */
>
> #include <linux/err.h>
> +#include <linux/delay.h>
> #include <linux/interrupt.h>
> #include <linux/kernel.h>
> #include <linux/module.h>
> @@ -677,6 +678,9 @@ static void axp20x_power_off(void)
>
> regmap_write(axp20x_pm_power_off->regmap, AXP20X_OFF_CTRL,
> AXP20X_OFF);
> +
> + /* Give capacitors etc. time to drain to avoid kernel panic msg. */
> + msleep(500);
> }
>
> int axp20x_match_device(struct axp20x_dev *axp20x)
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] mfd: axp20x: Add a 500ms delay at the end of axp20x_power_off
2016-06-05 13:50 [PATCH] mfd: axp20x: Add a 500ms delay at the end of axp20x_power_off Hans de Goede
2016-06-05 15:03 ` Chen-Yu Tsai
@ 2016-06-08 15:42 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2016-06-08 15:42 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, 05 Jun 2016, Hans de Goede wrote:
> The kernel expects the power_off function to not return, and if it does
> it panics. At a slight delay after the i2c write which turns off power
> through the pmic, to give capacitors etc. some time to drain.
>
> Without this the kernel lives on long enough after the poweroff to
> print the following on the serial console on my Mele A1000G quad:
>
> [ 248.583588] reboot: Power down
> [ 248.600490] Kernel pa
>
> With the delay the start of printing "Kernel panic" is gone.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/mfd/axp20x.c | 4 ++++
> 1 file changed, 4 insertions(+)
Applied, thanks.
> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 6364dab..fd80b09 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -17,6 +17,7 @@
> */
>
> #include <linux/err.h>
> +#include <linux/delay.h>
> #include <linux/interrupt.h>
> #include <linux/kernel.h>
> #include <linux/module.h>
> @@ -677,6 +678,9 @@ static void axp20x_power_off(void)
>
> regmap_write(axp20x_pm_power_off->regmap, AXP20X_OFF_CTRL,
> AXP20X_OFF);
> +
> + /* Give capacitors etc. time to drain to avoid kernel panic msg. */
> + msleep(500);
> }
>
> int axp20x_match_device(struct axp20x_dev *axp20x)
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-08 15:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-05 13:50 [PATCH] mfd: axp20x: Add a 500ms delay at the end of axp20x_power_off Hans de Goede
2016-06-05 15:03 ` Chen-Yu Tsai
2016-06-08 15:42 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).