Skip to contentSkip to conversation

CHROMIUM: ec: register shutdown function to clear delayed works

PATCH Applied Daniel Hung-yu Wu 2 participants 4 messages Oct 24, 2016 – Nov 2, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CHROMIUM: ec: register shutdown function to clear delayed works

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.

---
 drivers/mfd/cros_ec_dev.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/mfd/cros_ec_dev.c +9 -0
index 8618a7c..3e548f1 100644
@@ -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)
Signature · 1 line
2.8.0.rc3.226.g39d4020
Applied
#1 lore raw
Quoted 10 lines · Daniel Hung-yu Wu

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.

Quoted 4 lines
---
 drivers/mfd/cros_ec_dev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Applied, thanks.

Quoted 27 lines
drivers/mfd/cros_ec_dev.c +9 -0
index 8618a7c..3e548f1 100644
@@ -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)
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw
Quoted 12 lines · Lee Jones
Quoted 10 lines · Daniel Hung-yu Wu

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.

Quoted 6 lines
Quoted 4 lines
---
 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.

Quoted 28 lines
Quoted 27 lines
drivers/mfd/cros_ec_dev.c +9 -0
index 8618a7c..3e548f1 100644
@@ -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)
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw
Quoted 51 lines · Lee Jones
Quoted 12 lines · Lee Jones
Quoted 10 lines · Daniel Hung-yu Wu

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.

Quoted 6 lines
Quoted 4 lines
---
 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.

Quoted 26 lines
Quoted 26 lines
drivers/mfd/cros_ec_dev.c +9 -0
index 8618a7c..3e548f1 100644
@@ -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,
 };
 
Quoted 8 lines
Quoted 2 lines
Quoted 1 line
drivers/mfd/cros_ec_dev.c +0 -0
 static int __init cros_ec_dev_init(void)
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

The patch for Mainline is submitted. Thanks.