X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Fbrcm2708%2Fpatches-4.19%2F950-0140-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch;fp=target%2Flinux%2Fbrcm2708%2Fpatches-4.19%2F950-0140-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch;h=0000000000000000000000000000000000000000;hb=c2308a7e4adbb2acc8ff149f91d1ca46801c135e;hp=ea9846d099b0f92a54c6e925ef96bf6a62d83917;hpb=67dcc43f3a22dc3a7ac07a7065971b426feeb043;p=openwrt%2Fstaging%2Fchunkeey.git diff --git a/target/linux/brcm2708/patches-4.19/950-0140-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch b/target/linux/brcm2708/patches-4.19/950-0140-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch deleted file mode 100644 index ea9846d099..0000000000 --- a/target/linux/brcm2708/patches-4.19/950-0140-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch +++ /dev/null @@ -1,75 +0,0 @@ -From e7056be388c7bbc6f0211f587643ff795ce30814 Mon Sep 17 00:00:00 2001 -From: Stefan Wahren -Date: Sat, 6 Oct 2018 16:46:18 +0200 -Subject: [PATCH] hwmon: raspberrypi: Prevent voltage low warnings from - filling log - -Although the correct fix for low voltage warnings is to -improve the power supply, the current implementation -of the detection can fill the log if the warning -happens freqently. This replaces the logging with -slightly custom ratelimited logging. - -Signed-off-by: James Hughes -Signed-off-by: Stefan Wahren ---- - drivers/hwmon/raspberrypi-hwmon.c | 41 ++++++++++++++++++++++++++++--- - 1 file changed, 37 insertions(+), 4 deletions(-) - ---- a/drivers/hwmon/raspberrypi-hwmon.c -+++ b/drivers/hwmon/raspberrypi-hwmon.c -@@ -15,6 +15,36 @@ - #include - #include - -+/* -+ * This section defines some rate limited logging that prevent -+ * repeated messages at much lower Hz than the default kernel settings. -+ * It's usually 5s, this is 5 minutes. -+ * Burst 3 means you may get three messages 'quickly', before -+ * the ratelimiting kicks in. -+ */ -+#define LOCAL_RATELIMIT_INTERVAL (5 * 60 * HZ) -+#define LOCAL_RATELIMIT_BURST 3 -+ -+#ifdef CONFIG_PRINTK -+#define printk_ratelimited_local(fmt, ...) \ -+({ \ -+ static DEFINE_RATELIMIT_STATE(_rs, \ -+ LOCAL_RATELIMIT_INTERVAL, \ -+ LOCAL_RATELIMIT_BURST); \ -+ \ -+ if (__ratelimit(&_rs)) \ -+ printk(fmt, ##__VA_ARGS__); \ -+}) -+#else -+#define printk_ratelimited_local(fmt, ...) \ -+ no_printk(fmt, ##__VA_ARGS__) -+#endif -+ -+#define pr_crit_ratelimited_local(fmt, ...) \ -+ printk_ratelimited_local(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) -+#define pr_info_ratelimited_local(fmt, ...) \ -+printk_ratelimited_local(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) -+ - #define UNDERVOLTAGE_STICKY_BIT BIT(16) - - struct rpi_hwmon_data { -@@ -47,10 +77,13 @@ static void rpi_firmware_get_throttled(s - if (new_uv == old_uv) - return; - -- if (new_uv) -- dev_crit(data->hwmon_dev, "Undervoltage detected!\n"); -- else -- dev_info(data->hwmon_dev, "Voltage normalised\n"); -+ if (new_uv) { -+ pr_crit_ratelimited_local("Under-voltage detected! (0x%08x)\n", -+ value); -+ } else { -+ pr_info_ratelimited_local("Voltage normalised (0x%08x)\n", -+ value); -+ } - - sysfs_notify(&data->hwmon_dev->kobj, NULL, "in0_lcrit_alarm"); - }