linux-brain/drivers/char/ipmi
Petr Pavlu ec170de13b ipmi/watchdog: Stop watchdog timer when the current action is 'none'
commit 2253042d86f57d90a621ac2513a7a7a13afcf809 upstream.

When an IPMI watchdog timer is being stopped in ipmi_close() or
ipmi_ioctl(WDIOS_DISABLECARD), the current watchdog action is updated to
WDOG_TIMEOUT_NONE and _ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB) is called
to install this action. The latter function ends up invoking
__ipmi_set_timeout() which makes the actual 'Set Watchdog Timer' IPMI
request.

For IPMI 1.0, this operation results in fully stopping the watchdog timer.
For IPMI >= 1.5, function __ipmi_set_timeout() always specifies the "don't
stop" flag in the prepared 'Set Watchdog Timer' IPMI request. This causes
that the watchdog timer has its action correctly updated to 'none' but the
timer continues to run. A problem is that IPMI firmware can then still log
an expiration event when the configured timeout is reached, which is
unexpected because the watchdog timer was requested to be stopped.

The patch fixes this problem by not setting the "don't stop" flag in
__ipmi_set_timeout() when the current action is WDOG_TIMEOUT_NONE which
results in stopping the watchdog timer. This makes the behaviour for
IPMI >= 1.5 consistent with IPMI 1.0. It also matches the logic in
__ipmi_heartbeat() which does not allow to reset the watchdog if the
current action is WDOG_TIMEOUT_NONE as that would start the timer.

Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Message-Id: <10a41bdc-9c99-089c-8d89-fa98ce5ea080@suse.com>
Cc: stable@vger.kernel.org
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-19 08:53:16 +02:00
..
Kconfig Some small fixes for various things, nothing huge, mostly found 2019-07-13 15:07:02 -07:00
Makefile Add support for IPMB driver 2019-06-10 14:47:10 -05:00
bt-bmc.c ipmi:bt-bmc: Fix error handling and status check 2020-10-01 13:18:01 +02:00
ipmb_dev_int.c drivers: ipmi: fix off-by-one bounds check that leads to a out-of-bounds write 2020-02-19 19:53:05 +01:00
ipmi_bt_sm.c ipmi: Convert pr_xxx() to dev_xxx() in the BT code 2018-09-18 16:15:33 -05:00
ipmi_devintf.c ipmi: Remove file from ipmi_file_private 2019-04-17 13:14:25 -05:00
ipmi_dmi.c ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_dmi.h ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_kcs_sm.c ipmi: Convert printk(KERN_<level> to pr_<level>( 2018-09-18 16:15:33 -05:00
ipmi_msghandler.c ipmi: use vzalloc instead of kmalloc for user creation 2020-06-24 17:50:28 +02:00
ipmi_plat_data.c ipmi: Add the i2c-addr property for SSIF interfaces 2019-04-24 09:02:53 -05:00
ipmi_plat_data.h ipmi: Add the i2c-addr property for SSIF interfaces 2019-04-24 09:02:53 -05:00
ipmi_powernv.c ipmi:powernv: Convert ipmi_smi_t to struct ipmi_smi 2018-09-18 16:15:33 -05:00
ipmi_poweroff.c ipmi: Use more common logging styles 2018-09-18 16:15:33 -05:00
ipmi_si.h ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_si_hardcode.c ipmi: Add the i2c-addr property for SSIF interfaces 2019-04-24 09:02:53 -05:00
ipmi_si_hotmod.c ipmi: Add the i2c-addr property for SSIF interfaces 2019-04-24 09:02:53 -05:00
ipmi_si_intf.c ipmi_si: Fix wrong return value in try_smi_init() 2020-10-29 09:57:44 +01:00
ipmi_si_mem_io.c ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_si_parisc.c ipmi_si: Rename addr_type to addr_space to match what it does 2019-02-22 07:12:41 -06:00
ipmi_si_pci.c ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_si_platform.c ipmi_si: Avoid spurious errors for optional IRQs 2020-03-18 07:17:52 +01:00
ipmi_si_port_io.c ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_si_sm.h ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_smic_sm.c ipmi: Convert printk(KERN_<level> to pr_<level>( 2018-09-18 16:15:33 -05:00
ipmi_ssif.c ipmi:ssif: Handle a possible NULL pointer reference 2020-03-05 16:43:35 +01:00
ipmi_watchdog.c ipmi/watchdog: Stop watchdog timer when the current action is 'none' 2021-07-19 08:53:16 +02:00
kcs_bmc.c ipmi: kcs_bmc: handle devm_kasprintf() failure case 2019-02-09 19:48:42 -06:00
kcs_bmc.h ipmi: kcs_bmc: coding-style fixes and use new poll type 2018-02-26 09:49:21 -06:00
kcs_bmc_aspeed.c ipmi: kcs_bmc: coding-style fixes and use new poll type 2018-02-26 09:49:21 -06:00
kcs_bmc_npcm7xx.c ipmi: NPCM7xx KCS BMC: enable interrupt to the host 2018-05-23 08:29:23 -05:00