chrome-platform.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Rob Barnes <robbarnes@google.com>
To: chrome-platform@lists.linux.dev
Cc: tzungbi@kernel.org, gwendal@chromium.org, groweck@chromium.org,
	 Rob Barnes <robbarnes@google.com>
Subject: [PATCH] drivers/cros_ec: Make log polling period a parameter
Date: Tue,  7 May 2024 15:58:09 +0000	[thread overview]
Message-ID: <20240507155809.525701-1-robbarnes@google.com> (raw)

Make EC log polling period a module parameter. This allows the polling
period to be set via the kernel command line. Keeping the default at
the current 10 second period. The optimal polling period will differ by
board.

Signed-off-by: Rob Barnes <robbarnes@google.com>
---
 drivers/platform/chrome/cros_ec_debugfs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c
index 6bf6f0e7b597..95101b0d5227 100644
--- a/drivers/platform/chrome/cros_ec_debugfs.c
+++ b/drivers/platform/chrome/cros_ec_debugfs.c
@@ -25,6 +25,10 @@
 
 #define CIRC_ADD(idx, size, value)	(((idx) + (value)) & ((size) - 1))
 
+static unsigned int log_poll_period_ms = LOG_POLL_SEC * MSEC_PER_SEC;
+module_param(log_poll_period_ms, uint, 0644);
+MODULE_PARM_DESC(log_poll_period_ms, "EC log polling period(ms)");
+
 /* waitqueue for log readers */
 static DECLARE_WAIT_QUEUE_HEAD(cros_ec_debugfs_log_wq);
 
@@ -56,7 +60,7 @@ struct cros_ec_debugfs {
 
 /*
  * We need to make sure that the EC log buffer on the UART is large enough,
- * so that it is unlikely enough to overlow within LOG_POLL_SEC.
+ * so that it is unlikely enough to overlow within log_poll_period_ms.
  */
 static void cros_ec_console_log_work(struct work_struct *__work)
 {
@@ -118,7 +122,7 @@ static void cros_ec_console_log_work(struct work_struct *__work)
 
 resched:
 	schedule_delayed_work(&debug_info->log_poll_work,
-			      msecs_to_jiffies(LOG_POLL_SEC * 1000));
+			      msecs_to_jiffies(log_poll_period_ms));
 }
 
 static int cros_ec_console_log_open(struct inode *inode, struct file *file)
-- 
2.45.0.rc1.225.g2a3ae87e7f-goog


             reply	other threads:[~2024-05-07 15:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 15:58 Rob Barnes [this message]
2024-05-23  1:30 ` [PATCH] drivers/cros_ec: Make log polling period a parameter Tzung-Bi Shih
2024-05-29  0:08   ` Rob Barnes
2024-05-29  5:20 ` patchwork-bot+chrome-platform
2024-05-29  5:20 ` patchwork-bot+chrome-platform

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=20240507155809.525701-1-robbarnes@google.com \
    --to=robbarnes@google.com \
    --cc=chrome-platform@lists.linux.dev \
    --cc=groweck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=tzungbi@kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).