Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1709071 > unrolled thread

[PATCH 4/8] platform/chrome: cros_ec: register shutdown function for debugfs

Started byThierry Escande <thierry.escande@collabora.com>
First post2017-08-11 00:20 +0200
Last post2017-08-11 06:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/8] platform/chrome: cros_ec: register shutdown function for debugfs Thierry Escande <thierry.escande@collabora.com> - 2017-08-11 00:20 +0200
    Re: [PATCH 4/8] platform/chrome: cros_ec: register shutdown function  for debugfs Benson Leung <bleung@google.com> - 2017-08-11 06:10 +0200

#1709071 — [PATCH 4/8] platform/chrome: cros_ec: register shutdown function for debugfs

FromThierry Escande <thierry.escande@collabora.com>
Date2017-08-11 00:20 +0200
Subject[PATCH 4/8] platform/chrome: cros_ec: register shutdown function for debugfs
Message-ID<ud3Y6-3tF-21@gated-at.bofh.it>
From: Daniel Hung-yu Wu <hywu@google.com>

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.

This patch registers a shutdown callback used to cancel the debugfs log
worker thread.

Signed-off-by: Daniel Hung-yu Wu <hywu@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
---
 drivers/platform/chrome/cros_ec_dev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
index 2571f5e..225d8e9 100644
--- a/drivers/platform/chrome/cros_ec_dev.c
+++ b/drivers/platform/chrome/cros_ec_dev.c
@@ -460,6 +460,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 const struct platform_device_id cros_ec_id[] = {
 	{ "cros-ec-ctl", 0 },
 	{ /* sentinel */ },
@@ -502,6 +510,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.7.4

[toc] | [next] | [standalone]


#1709230 — Re: [PATCH 4/8] platform/chrome: cros_ec: register shutdown function for debugfs

FromBenson Leung <bleung@google.com>
Date2017-08-11 06:10 +0200
SubjectRe: [PATCH 4/8] platform/chrome: cros_ec: register shutdown function for debugfs
Message-ID<ud9qN-74Q-1@gated-at.bofh.it>
In reply to#1709071

[Multipart message — attachments visible in raw view] — view raw

Hi Thierry,

On Fri, Aug 11, 2017 at 12:16:46AM +0200, Thierry Escande wrote:
> From: Daniel Hung-yu Wu <hywu@google.com>
> 
> 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.
> 
> This patch registers a shutdown callback used to cancel the debugfs log
> worker thread.
> 
> Signed-off-by: Daniel Hung-yu Wu <hywu@chromium.org>
> Signed-off-by: Thierry Escande <thierry.escande@collabora.com>

Applied. Thanks.

Benson
-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web