From: Greg Kroah-Hartman Date: Sun, 15 Jan 2023 14:31:31 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.14.303~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1fcb7e40d9edc3c99a61ebbcf384039a80f1cca5;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: edac-device-fix-period-calculation-in-edac_device_reset_delay_period.patch --- diff --git a/queue-5.4/edac-device-fix-period-calculation-in-edac_device_reset_delay_period.patch b/queue-5.4/edac-device-fix-period-calculation-in-edac_device_reset_delay_period.patch new file mode 100644 index 00000000000..08f7e726d8e --- /dev/null +++ b/queue-5.4/edac-device-fix-period-calculation-in-edac_device_reset_delay_period.patch @@ -0,0 +1,65 @@ +From e84077437902ec99eba0a6b516df772653f142c7 Mon Sep 17 00:00:00 2001 +From: Eliav Farber +Date: Thu, 20 Oct 2022 12:44:58 +0000 +Subject: EDAC/device: Fix period calculation in edac_device_reset_delay_period() + +From: Eliav Farber + +commit e84077437902ec99eba0a6b516df772653f142c7 upstream. + +Fix period calculation in case user sets a value of 1000. The input of +round_jiffies_relative() should be in jiffies and not in milli-seconds. + + [ bp: Use the same code pattern as in edac_device_workq_setup() for + clarity. ] + +Fixes: c4cf3b454eca ("EDAC: Rework workqueue handling") +Signed-off-by: Eliav Farber +Signed-off-by: Borislav Petkov (AMD) +Cc: +Link: https://lore.kernel.org/r/20221020124458.22153-1-farbere@amazon.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/edac/edac_device.c | 17 ++++++++--------- + drivers/edac/edac_module.h | 2 +- + 2 files changed, 9 insertions(+), 10 deletions(-) + +--- a/drivers/edac/edac_device.c ++++ b/drivers/edac/edac_device.c +@@ -424,17 +424,16 @@ static void edac_device_workq_teardown(s + * Then restart the workq on the new delay + */ + void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev, +- unsigned long value) ++ unsigned long msec) + { +- unsigned long jiffs = msecs_to_jiffies(value); ++ edac_dev->poll_msec = msec; ++ edac_dev->delay = msecs_to_jiffies(msec); + +- if (value == 1000) +- jiffs = round_jiffies_relative(value); +- +- edac_dev->poll_msec = value; +- edac_dev->delay = jiffs; +- +- edac_mod_work(&edac_dev->work, jiffs); ++ /* See comment in edac_device_workq_setup() above */ ++ if (edac_dev->poll_msec == 1000) ++ edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); ++ else ++ edac_mod_work(&edac_dev->work, edac_dev->delay); + } + + int edac_device_alloc_index(void) +--- a/drivers/edac/edac_module.h ++++ b/drivers/edac/edac_module.h +@@ -57,7 +57,7 @@ bool edac_stop_work(struct delayed_work + bool edac_mod_work(struct delayed_work *work, unsigned long delay); + + extern void edac_device_reset_delay_period(struct edac_device_ctl_info +- *edac_dev, unsigned long value); ++ *edac_dev, unsigned long msec); + extern void edac_mc_reset_delay_period(unsigned long value); + + extern void *edac_align_ptr(void **p, unsigned size, int n_elems); diff --git a/queue-5.4/series b/queue-5.4/series index 9b089ea1226..6c64550fb13 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -632,3 +632,4 @@ ext4-fix-uninititialized-value-in-ext4_evict_inode.patch netfilter-ipset-fix-overflow-before-widen-in-the-bitmap_ip_create-function.patch powerpc-imc-pmu-fix-use-of-mutex-in-irqs-disabled-section.patch x86-boot-avoid-using-intel-mnemonics-in-at-t-syntax-asm.patch +edac-device-fix-period-calculation-in-edac_device_reset_delay_period.patch