tmp_suning_uos_patched/drivers/char/ipmi
Petr Pavlu ef5066f95c 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 09:44:59 +02:00
..
bt-bmc.c
ipmb_dev_int.c
ipmi_bt_sm.c
ipmi_devintf.c
ipmi_dmi.c
ipmi_dmi.h
ipmi_kcs_sm.c
ipmi_msghandler.c
ipmi_plat_data.c
ipmi_plat_data.h
ipmi_powernv.c
ipmi_poweroff.c
ipmi_si_hardcode.c
ipmi_si_hotmod.c
ipmi_si_intf.c
ipmi_si_mem_io.c
ipmi_si_parisc.c
ipmi_si_pci.c
ipmi_si_platform.c
ipmi_si_port_io.c
ipmi_si_sm.h
ipmi_si.h
ipmi_smic_sm.c
ipmi_ssif.c
ipmi_watchdog.c
Kconfig
kcs_bmc_aspeed.c
kcs_bmc_npcm7xx.c
kcs_bmc.c
kcs_bmc.h
Makefile