Skip to content

Commit 7b44d53

Browse files
rbbrnsTzung-Bi Shih
authored andcommitted
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]>
1 parent 47ef58c commit 7b44d53

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/platform/chrome/cros_ec_debugfs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
#define CIRC_ADD(idx, size, value) (((idx) + (value)) & ((size) - 1))
2828

29+
static unsigned int log_poll_period_ms = LOG_POLL_SEC * MSEC_PER_SEC;
30+
module_param(log_poll_period_ms, uint, 0644);
31+
MODULE_PARM_DESC(log_poll_period_ms, "EC log polling period(ms)");
32+
2933
/* waitqueue for log readers */
3034
static DECLARE_WAIT_QUEUE_HEAD(cros_ec_debugfs_log_wq);
3135

@@ -57,7 +61,7 @@ struct cros_ec_debugfs {
5761

5862
/*
5963
* We need to make sure that the EC log buffer on the UART is large enough,
60-
* so that it is unlikely enough to overlow within LOG_POLL_SEC.
64+
* so that it is unlikely enough to overlow within log_poll_period_ms.
6165
*/
6266
static void cros_ec_console_log_work(struct work_struct *__work)
6367
{
@@ -119,7 +123,7 @@ static void cros_ec_console_log_work(struct work_struct *__work)
119123

120124
resched:
121125
schedule_delayed_work(&debug_info->log_poll_work,
122-
msecs_to_jiffies(LOG_POLL_SEC * 1000));
126+
msecs_to_jiffies(log_poll_period_ms));
123127
}
124128

125129
static int cros_ec_console_log_open(struct inode *inode, struct file *file)

0 commit comments

Comments
 (0)