Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1506976 > unrolled thread
| Started by | Daniel Hung-yu Wu <hywu@google.com> |
|---|---|
| First post | 2016-10-24 10:00 +0200 |
| Last post | 2016-10-26 16:20 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] CHROMIUM: ec: register shutdown function to clear delayed works Daniel Hung-yu Wu <hywu@google.com> - 2016-10-24 10:00 +0200
Re: [PATCH] CHROMIUM: ec: register shutdown function to clear delayed works Lee Jones <lee.jones@linaro.org> - 2016-10-26 16:10 +0200
Re: [PATCH] CHROMIUM: ec: register shutdown function to clear delayed works Lee Jones <lee.jones@linaro.org> - 2016-10-26 16:20 +0200
| From | Daniel Hung-yu Wu <hywu@google.com> |
|---|---|
| Date | 2016-10-24 10:00 +0200 |
| Subject | [PATCH] CHROMIUM: ec: register shutdown function to clear delayed works |
| Message-ID | <svIkO-4BM-23@gated-at.bofh.it> |
This patch applies on top of "mfd: cros_ec: Add EC console read structures
definitions" (https://patchwork.kernel.org/patch/9294887/).
This patch is currently against a linux 3.18 kernel.
Reboot or shutdown during delayed works could corrupt communication with EC,
and certain I2C controller may not be able to recover from the error state.
A shutdown function is registered to clear delayed works or wait for them to
finish.
Signed-off-by: Daniel Hung-yu Wu <hywu@chromium.org>
---
drivers/mfd/cros_ec_dev.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index 8618a7c..3e548f1 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -613,6 +613,14 @@ static int ec_device_remove(struct platform_device *pdev)
return 0;
}
+static void ec_device_shutdown(struct platform_device *pdev)
+{
+ struct cros_ec_dev *ec = dev_get_drvdata(&pdev->dev);
+
+ /* Be sure to clear up debugfs delayed works */
+ cros_ec_debugfs_remove(ec);
+}
+
static int ec_device_suspend(struct device *dev)
{
struct cros_ec_dev *ec = dev_get_drvdata(dev);
@@ -656,6 +664,7 @@ static struct platform_driver cros_ec_dev_driver = {
},
.probe = ec_device_probe,
.remove = ec_device_remove,
+ .shutdown = ec_device_shutdown,
};
static int __init cros_ec_dev_init(void)
--
2.8.0.rc3.226.g39d4020
[toc] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-10-26 16:10 +0200 |
| Subject | Re: [PATCH] CHROMIUM: ec: register shutdown function to clear delayed works |
| Message-ID | <swx3Y-4Lr-21@gated-at.bofh.it> |
| In reply to | #1506976 |
On Mon, 24 Oct 2016, Daniel Hung-yu Wu wrote:
> This patch applies on top of "mfd: cros_ec: Add EC console read structures
> definitions" (https://patchwork.kernel.org/patch/9294887/).
>
> This patch is currently against a linux 3.18 kernel.
>
> Reboot or shutdown during delayed works could corrupt communication with EC,
> and certain I2C controller may not be able to recover from the error state.
> A shutdown function is registered to clear delayed works or wait for them to
> finish.
>
> Signed-off-by: Daniel Hung-yu Wu <hywu@chromium.org>
> ---
> drivers/mfd/cros_ec_dev.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
Applied, thanks.
> diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
> index 8618a7c..3e548f1 100644
> --- a/drivers/mfd/cros_ec_dev.c
> +++ b/drivers/mfd/cros_ec_dev.c
> @@ -613,6 +613,14 @@ static int ec_device_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static void ec_device_shutdown(struct platform_device *pdev)
> +{
> + struct cros_ec_dev *ec = dev_get_drvdata(&pdev->dev);
> +
> + /* Be sure to clear up debugfs delayed works */
> + cros_ec_debugfs_remove(ec);
> +}
> +
> static int ec_device_suspend(struct device *dev)
> {
> struct cros_ec_dev *ec = dev_get_drvdata(dev);
> @@ -656,6 +664,7 @@ static struct platform_driver cros_ec_dev_driver = {
> },
> .probe = ec_device_probe,
> .remove = ec_device_remove,
> + .shutdown = ec_device_shutdown,
> };
>
> static int __init cros_ec_dev_init(void)
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-10-26 16:20 +0200 |
| Subject | Re: [PATCH] CHROMIUM: ec: register shutdown function to clear delayed works |
| Message-ID | <swxdE-4QU-7@gated-at.bofh.it> |
| In reply to | #1509469 |
On Wed, 26 Oct 2016, Lee Jones wrote:
> On Mon, 24 Oct 2016, Daniel Hung-yu Wu wrote:
>
> > This patch applies on top of "mfd: cros_ec: Add EC console read structures
> > definitions" (https://patchwork.kernel.org/patch/9294887/).
> >
> > This patch is currently against a linux 3.18 kernel.
> >
> > Reboot or shutdown during delayed works could corrupt communication with EC,
> > and certain I2C controller may not be able to recover from the error state.
> > A shutdown function is registered to clear delayed works or wait for them to
> > finish.
> >
> > Signed-off-by: Daniel Hung-yu Wu <hywu@chromium.org>
> > ---
> > drivers/mfd/cros_ec_dev.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
>
> Applied, thanks.
Ah, I thought you'd at least ported it to Mainline!
You need to do that before posting patches.
> > diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
> > index 8618a7c..3e548f1 100644
> > --- a/drivers/mfd/cros_ec_dev.c
> > +++ b/drivers/mfd/cros_ec_dev.c
> > @@ -613,6 +613,14 @@ static int ec_device_remove(struct platform_device *pdev)
> > return 0;
> > }
> >
> > +static void ec_device_shutdown(struct platform_device *pdev)
> > +{
> > + struct cros_ec_dev *ec = dev_get_drvdata(&pdev->dev);
> > +
> > + /* Be sure to clear up debugfs delayed works */
> > + cros_ec_debugfs_remove(ec);
> > +}
> > +
> > static int ec_device_suspend(struct device *dev)
> > {
> > struct cros_ec_dev *ec = dev_get_drvdata(dev);
> > @@ -656,6 +664,7 @@ static struct platform_driver cros_ec_dev_driver = {
> > },
> > .probe = ec_device_probe,
> > .remove = ec_device_remove,
> > + .shutdown = ec_device_shutdown,
> > };
> >
> > static int __init cros_ec_dev_init(void)
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web