From: Thierry Escande <thierry.escande@collabora.com>
To: Benson Leung <bleung@chromium.org>,
Lee Jones <lee.jones@linaro.org>,
Jonathan Cameron <jic23@kernel.org>
Cc: Joseph Lo <josephl@nvidia.com>,
Gwendal Grignou <gwendal@chromium.org>,
Douglas Anderson <dianders@chromium.org>,
Daniel Hung-yu Wu <hywu@google.com>,
Vincent Palatin <vpalatin@chromium.org>,
Wei-Ning Huang <wnhuang@google.com>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org
Subject: [PATCH v2 3/8] mfd: cros_ec: Stop the debugfs work when suspended
Date: Fri, 11 Aug 2017 16:23:00 +0200 [thread overview]
Message-ID: <1502461385-27564-4-git-send-email-thierry.escande@collabora.com> (raw)
In-Reply-To: <1502461385-27564-1-git-send-email-thierry.escande@collabora.com>
From: Douglas Anderson <dianders@chromium.org>
This patch stops the debugfs worker thread when the device is suspended.
This change avoids messages like:
cros-ec-spi spi5.0: spi transfer failed: -108
cros-ec-spi spi5.0: cs-deassert spi transfer failed: -108
cros-ec-ctl cros-ec-ctl.0.auto: EC communication failed
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
---
drivers/platform/chrome/cros_ec_debugfs.c | 18 ++++++++++++++++++
drivers/platform/chrome/cros_ec_debugfs.h | 2 ++
drivers/platform/chrome/cros_ec_dev.c | 4 ++++
3 files changed, 24 insertions(+)
diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c
index 4cc66f4..515f411 100644
--- a/drivers/platform/chrome/cros_ec_debugfs.c
+++ b/drivers/platform/chrome/cros_ec_debugfs.c
@@ -399,3 +399,21 @@ void cros_ec_debugfs_remove(struct cros_ec_dev *ec)
debugfs_remove_recursive(ec->debug_info->dir);
cros_ec_cleanup_console_log(ec->debug_info);
}
+
+void cros_ec_debugfs_suspend(struct cros_ec_dev *ec)
+{
+ /*
+ * cros_ec_debugfs_init() failures are non-fatal; it's also possible
+ * that we initted things but decided that console log wasn't supported.
+ * We'll use the same set of checks that cros_ec_debugfs_remove() +
+ * cros_ec_cleanup_console_log() end up using to handle those cases.
+ */
+ if (ec->debug_info && ec->debug_info->log_buffer.buf)
+ cancel_delayed_work_sync(&ec->debug_info->log_poll_work);
+}
+
+void cros_ec_debugfs_resume(struct cros_ec_dev *ec)
+{
+ if (ec->debug_info && ec->debug_info->log_buffer.buf)
+ schedule_delayed_work(&ec->debug_info->log_poll_work, 0);
+}
diff --git a/drivers/platform/chrome/cros_ec_debugfs.h b/drivers/platform/chrome/cros_ec_debugfs.h
index 1ff3a50..d29e410 100644
--- a/drivers/platform/chrome/cros_ec_debugfs.h
+++ b/drivers/platform/chrome/cros_ec_debugfs.h
@@ -23,5 +23,7 @@
/* debugfs stuff */
int cros_ec_debugfs_init(struct cros_ec_dev *ec);
void cros_ec_debugfs_remove(struct cros_ec_dev *ec);
+void cros_ec_debugfs_suspend(struct cros_ec_dev *ec);
+void cros_ec_debugfs_resume(struct cros_ec_dev *ec);
#endif /* _DRV_CROS_EC_DEBUGFS_H_ */
diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
index cf6c4f0..2571f5e 100644
--- a/drivers/platform/chrome/cros_ec_dev.c
+++ b/drivers/platform/chrome/cros_ec_dev.c
@@ -470,6 +470,8 @@ static __maybe_unused int ec_device_suspend(struct device *dev)
{
struct cros_ec_dev *ec = dev_get_drvdata(dev);
+ cros_ec_debugfs_suspend(ec);
+
lb_suspend(ec);
return 0;
@@ -481,6 +483,8 @@ static __maybe_unused int ec_device_resume(struct device *dev)
lb_resume(ec);
+ cros_ec_debugfs_resume(ec);
+
return 0;
}
--
2.7.4
next prev parent reply other threads:[~2017-08-11 14:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 14:22 [PATCH v2 0/8] platform/chrome: cros_ec: Fixes and improvements Thierry Escande
2017-08-11 14:22 ` [PATCH v2 1/8] iio: cros_ec: Relax sampling frequency before suspending Thierry Escande
2017-08-12 12:42 ` Jonathan Cameron
2017-08-11 14:22 ` [PATCH v2 2/8] mfd: cros_ec_i2c: move the system sleep pm ops to late Thierry Escande
2017-08-11 14:23 ` Thierry Escande [this message]
2017-08-15 6:31 ` [PATCH v2 3/8] mfd: cros_ec: Stop the debugfs work when suspended Benson Leung
2017-08-11 14:23 ` [PATCH v2 4/8] platform/chrome: cros_ec: register shutdown function for debugfs Thierry Escande
2017-08-15 6:35 ` Benson Leung
2017-08-11 14:23 ` [PATCH v2 5/8] mfd: cros_ec: fail early if we cannot identify the EC Thierry Escande
2017-08-11 14:23 ` [PATCH v2 6/8] mfd: cros_ec_i2c: add ACPI module device table Thierry Escande
2017-08-11 14:23 ` [PATCH v2 7/8] platform/chrome: cros_ec: Add sysfs entry to set keyboard wake lid angle Thierry Escande
2017-09-11 19:39 ` Benson Leung
2017-08-11 14:23 ` [PATCH v2 8/8] platform/chrome: cros_ec: sysfs: Modify error handling Thierry Escande
2017-09-11 19:42 ` Benson Leung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1502461385-27564-4-git-send-email-thierry.escande@collabora.com \
--to=thierry.escande@collabora.com \
--cc=bleung@chromium.org \
--cc=dianders@chromium.org \
--cc=gwendal@chromium.org \
--cc=hywu@google.com \
--cc=jic23@kernel.org \
--cc=josephl@nvidia.com \
--cc=lee.jones@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vpalatin@chromium.org \
--cc=wnhuang@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®