aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Barnes <[email protected]>2024-05-07 15:58:09 +0000
committerTzung-Bi Shih <[email protected]>2024-05-29 05:09:28 +0000
commit7b44d5381e541de3da3cee2e948456b250f41f25 (patch)
treeaafc6bf94c102b79e6211923e87ee0fbe645d612
parent47ef58cdbd7fae42f1adcb6015fdc05ce2b2471e (diff)
platform/chrome: cros_ec_debugfs: Make log polling period a parameter
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
-rw-r--r--drivers/platform/chrome/cros_ec_debugfs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c
index e1d313246beb..f0e9efb543df 100644
--- a/drivers/platform/chrome/cros_ec_debugfs.c
+++ b/drivers/platform/chrome/cros_ec_debugfs.c
@@ -26,6 +26,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);
@@ -57,7 +61,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)
{
@@ -119,7 +123,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)