From: Greg Kroah-Hartman Date: Tue, 7 Apr 2020 14:48:32 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v5.4.31~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a22e2978c72f766665a5b7c641342c9a317dc39;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: watchdog-itco_wdt-export-vendorsupport.patch watchdog-itco_wdt-make-ich_res_io_smi-optional.patch --- diff --git a/queue-5.4/series b/queue-5.4/series index 9b956265999..8d6d14b4f9f 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -30,6 +30,8 @@ iwlwifi-dbg-don-t-abort-if-sending-dbgc_suspend_resume-fails.patch rxrpc-fix-sendmsg-msg_waitall-handling.patch ib-hfi1-ensure-pq-is-not-left-on-waitlist.patch tcp-fix-tfo-synack-undo-to-avoid-double-timestamp-undo.patch +watchdog-itco_wdt-export-vendorsupport.patch +watchdog-itco_wdt-make-ich_res_io_smi-optional.patch i2c-i801-do-not-add-ich_res_io_smi-for-the-itco_wdt-device.patch net-fix-tx-hash-bound-checking.patch padata-always-acquire-cpu_hotplug_lock-before-pinst-lock.patch diff --git a/queue-5.4/watchdog-itco_wdt-export-vendorsupport.patch b/queue-5.4/watchdog-itco_wdt-export-vendorsupport.patch new file mode 100644 index 00000000000..ba6f3a9b0c3 --- /dev/null +++ b/queue-5.4/watchdog-itco_wdt-export-vendorsupport.patch @@ -0,0 +1,96 @@ +From 7ca6ee38909109751bfab79e9f6c570d2ed258c6 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Wed, 26 Feb 2020 16:21:20 +0300 +Subject: watchdog: iTCO_wdt: Export vendorsupport + +From: Mika Westerberg + +commit 7ca6ee38909109751bfab79e9f6c570d2ed258c6 upstream. + +In preparation for making ->smi_res optional the iTCO_wdt driver needs +to know whether vendorsupport is being set to non-zero. For this reason +export the variable. + +Signed-off-by: Mika Westerberg +Reviewed-by: Guenter Roeck +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/watchdog/iTCO_vendor.h | 2 ++ + drivers/watchdog/iTCO_vendor_support.c | 16 +++++++++------- + 2 files changed, 11 insertions(+), 7 deletions(-) + +--- a/drivers/watchdog/iTCO_vendor.h ++++ b/drivers/watchdog/iTCO_vendor.h +@@ -1,10 +1,12 @@ + /* SPDX-License-Identifier: GPL-2.0 */ + /* iTCO Vendor Specific Support hooks */ + #ifdef CONFIG_ITCO_VENDOR_SUPPORT ++extern int iTCO_vendorsupport; + extern void iTCO_vendor_pre_start(struct resource *, unsigned int); + extern void iTCO_vendor_pre_stop(struct resource *); + extern int iTCO_vendor_check_noreboot_on(void); + #else ++#define iTCO_vendorsupport 0 + #define iTCO_vendor_pre_start(acpibase, heartbeat) {} + #define iTCO_vendor_pre_stop(acpibase) {} + #define iTCO_vendor_check_noreboot_on() 1 +--- a/drivers/watchdog/iTCO_vendor_support.c ++++ b/drivers/watchdog/iTCO_vendor_support.c +@@ -39,8 +39,10 @@ + /* Broken BIOS */ + #define BROKEN_BIOS 911 + +-static int vendorsupport; +-module_param(vendorsupport, int, 0); ++int iTCO_vendorsupport; ++EXPORT_SYMBOL(iTCO_vendorsupport); ++ ++module_param_named(vendorsupport, iTCO_vendorsupport, int, 0); + MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=" + "0 (none), 1=SuperMicro Pent3, 911=Broken SMI BIOS"); + +@@ -152,7 +154,7 @@ static void broken_bios_stop(struct reso + void iTCO_vendor_pre_start(struct resource *smires, + unsigned int heartbeat) + { +- switch (vendorsupport) { ++ switch (iTCO_vendorsupport) { + case SUPERMICRO_OLD_BOARD: + supermicro_old_pre_start(smires); + break; +@@ -165,7 +167,7 @@ EXPORT_SYMBOL(iTCO_vendor_pre_start); + + void iTCO_vendor_pre_stop(struct resource *smires) + { +- switch (vendorsupport) { ++ switch (iTCO_vendorsupport) { + case SUPERMICRO_OLD_BOARD: + supermicro_old_pre_stop(smires); + break; +@@ -178,7 +180,7 @@ EXPORT_SYMBOL(iTCO_vendor_pre_stop); + + int iTCO_vendor_check_noreboot_on(void) + { +- switch (vendorsupport) { ++ switch (iTCO_vendorsupport) { + case SUPERMICRO_OLD_BOARD: + return 0; + default: +@@ -189,13 +191,13 @@ EXPORT_SYMBOL(iTCO_vendor_check_noreboot + + static int __init iTCO_vendor_init_module(void) + { +- if (vendorsupport == SUPERMICRO_NEW_BOARD) { ++ if (iTCO_vendorsupport == SUPERMICRO_NEW_BOARD) { + pr_warn("Option vendorsupport=%d is no longer supported, " + "please use the w83627hf_wdt driver instead\n", + SUPERMICRO_NEW_BOARD); + return -EINVAL; + } +- pr_info("vendor-support=%d\n", vendorsupport); ++ pr_info("vendor-support=%d\n", iTCO_vendorsupport); + return 0; + } + diff --git a/queue-5.4/watchdog-itco_wdt-make-ich_res_io_smi-optional.patch b/queue-5.4/watchdog-itco_wdt-make-ich_res_io_smi-optional.patch new file mode 100644 index 00000000000..744935cde7e --- /dev/null +++ b/queue-5.4/watchdog-itco_wdt-make-ich_res_io_smi-optional.patch @@ -0,0 +1,70 @@ +From e42b0c24389d5a1602e77db4f6def0d5a19e3e43 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Wed, 26 Feb 2020 16:21:21 +0300 +Subject: watchdog: iTCO_wdt: Make ICH_RES_IO_SMI optional + +From: Mika Westerberg + +commit e42b0c24389d5a1602e77db4f6def0d5a19e3e43 upstream. + +The iTCO_wdt driver only needs ICH_RES_IO_SMI I/O resource when either +turn_SMI_watchdog_clear_off module parameter is set to match ->iTCO_version +(or higher), and when legacy iTCO_vendorsupport is set. Modify the driver +so that ICH_RES_IO_SMI is optional if the two conditions are not met. + +Signed-off-by: Mika Westerberg +Reviewed-by: Guenter Roeck +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/watchdog/iTCO_wdt.c | 28 ++++++++++++++++------------ + 1 file changed, 16 insertions(+), 12 deletions(-) + +--- a/drivers/watchdog/iTCO_wdt.c ++++ b/drivers/watchdog/iTCO_wdt.c +@@ -459,13 +459,25 @@ static int iTCO_wdt_probe(struct platfor + if (!p->tco_res) + return -ENODEV; + +- p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI); +- if (!p->smi_res) +- return -ENODEV; +- + p->iTCO_version = pdata->version; + p->pci_dev = to_pci_dev(dev->parent); + ++ p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI); ++ if (p->smi_res) { ++ /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ ++ if (!devm_request_region(dev, p->smi_res->start, ++ resource_size(p->smi_res), ++ pdev->name)) { ++ pr_err("I/O address 0x%04llx already in use, device disabled\n", ++ (u64)SMI_EN(p)); ++ return -EBUSY; ++ } ++ } else if (iTCO_vendorsupport || ++ turn_SMI_watchdog_clear_off >= p->iTCO_version) { ++ pr_err("SMI I/O resource is missing\n"); ++ return -ENODEV; ++ } ++ + iTCO_wdt_no_reboot_bit_setup(p, pdata); + + /* +@@ -492,14 +504,6 @@ static int iTCO_wdt_probe(struct platfor + /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ + p->update_no_reboot_bit(p->no_reboot_priv, true); + +- /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ +- if (!devm_request_region(dev, p->smi_res->start, +- resource_size(p->smi_res), +- pdev->name)) { +- pr_err("I/O address 0x%04llx already in use, device disabled\n", +- (u64)SMI_EN(p)); +- return -EBUSY; +- } + if (turn_SMI_watchdog_clear_off >= p->iTCO_version) { + /* + * Bit 13: TCO_EN -> 0