lkml.org 
[lkml]   [2018]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] watchdog: add module parameter "force_no_reboot" for iTCO
From
Date
On 07/02/2018 12:30 AM, Tian, Baofeng wrote:
> From: "Tian, Baofeng" <baofeng.tian@intel.com <mailto:baofeng.tian@intel.com>>
> Subject: [PATCH] watchdog: add module parameter "force_no_reboot" for iTCO
>
> Setting "force_no_reboot" parameter to true (y/Y/1) will have
> the effect to prevent to reset the NO_REBOOT flag thus
> preventing the iTCO to reboot the platform, if not set
> or set to false, then system will reboot after about 30s.
>
> Signed-off-by: Tian, Baofeng <baofeng.tian@intel.com <mailto:baofeng.tian@intel.com>>

Your e-mail address is messed up.

> ---
>  drivers/watchdog/iTCO_wdt.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
> index 347f038..255318b 100644
> --- a/drivers/watchdog/iTCO_wdt.c
> +++ b/drivers/watchdog/iTCO_wdt.c
> @@ -131,6 +131,11 @@ module_param(turn_SMI_watchdog_clear_off, int, 0);
>  MODULE_PARM_DESC(turn_SMI_watchdog_clear_off,
>       "Turn off SMI clearing watchdog (depends on TCO-version)(default=1)");
>
> +static bool force_no_reboot;
> +module_param(force_no_reboot, bool, 0);
> +MODULE_PARM_DESC(force_no_reboot,
> +           "Prevents the watchdog rebooting the platform (default=0)");
> +
>  /*
>   * Some TCO specific functions
>   */
> @@ -243,6 +248,10 @@ static int iTCO_wdt_start(struct watchdog_device *wd_dev)
>       struct iTCO_wdt_private *p = watchdog_get_drvdata(wd_dev);
>       unsigned int val;
>
> +     /* force_no_reboot will prevent to unset NO_REBOOT bit */
> +     if (force_no_reboot)
> +           return -EIO;
> +
It seems to me that this flag prevents the watchdog from being started,
and on top it would return an unreasonable error (-EIO).

I don't see the point of this patch, sorry.

Guenter

>       spin_lock(&p->io_lock);
>
>       iTCO_vendor_pre_start(p->smi_res, wd_dev->timeout);
> @@ -250,7 +259,7 @@ static int iTCO_wdt_start(struct watchdog_device *wd_dev)
>       /* disable chipset's NO_REBOOT bit */
>       if (p->update_no_reboot_bit(p->no_reboot_priv, false)) {
>             spin_unlock(&p->io_lock);
> -           pr_err("failed to reset NO_REBOOT flag, reboot disabled by hardware/BIOS\n");
> +           pr_err("failed to reset NO_REBOOT flag, reboot disabled by hardware/BIOS/rc_cmd\n");
>             return -EIO;
>       }
>
> --
> 2.7.4
>

\
 
 \ /
  Last update: 2018-07-02 15:21    [W:0.064 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site