All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Radu Rendec <rrendec@arista.com>
Cc: Wim Van Sebroeck <wim@iguana.be>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Lowering the log level in watchdog_dev_register when err==-EBUSY
Date: Wed, 11 Oct 2017 11:46:03 -0700	[thread overview]
Message-ID: <20171011184603.GB8756@roeck-us.net> (raw)
In-Reply-To: <1507743991.3486.5.camel@arista.com>

On Wed, Oct 11, 2017 at 06:46:31PM +0100, Radu Rendec wrote:
> Hello,
> 
> In a project I'm working on we have a valid use case where we activate
> both the i6300esb and softdog watchdogs. We always activate i6300esb
> first (which uses the "legacy" watchdog API) and then softdog. This
> gets us two "error" level messages (coming from watchdog_cdev_register)
> although softdog falls back to the "new" API and registers its char
> device just fine.
> 
> Since watchdog_cdev_register/watchdog_dev_register seem to be used only
> by watchdog_register_device and the latter always falls back to the
> "new" API, I'm thinking about lowering the log level of these messages
> when err is -EBUSY. Something along the lines of:
> 
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -928,11 +928,14 @@ static int watchdog_cdev_register(struct watchdog_device *wdd, dev_t devno)
>                 watchdog_miscdev.parent = wdd->parent;
>                 err = misc_register(&watchdog_miscdev);
>                 if (err != 0) {
> -                       pr_err("%s: cannot register miscdev on minor=%d (err=%d).\n",
> -                               wdd->info->identity, WATCHDOG_MINOR, err);
> -                       if (err == -EBUSY)
> -                               pr_err("%s: a legacy watchdog module is probably present.\n",
> -                                       wdd->info->identity);
> +                       if (err == -EBUSY) {
> +                               pr_info("%s: cannot register miscdev on minor=%d (err=%d).\n",
> +                                               wdd->info->identity, WATCHDOG_MINOR, err);
> +                               pr_info("%s: a legacy watchdog module is probably present.\n",
> +                                               wdd->info->identity);
> +                       } else
> +                               pr_err("%s: cannot register miscdev on minor=%d (err=%d).\n",
> +                                       wdd->info->identity, WATCHDOG_MINOR, err);
>                         old_wd_data = NULL;
>                         kfree(wd_data);
>                         return err;
> 
> Does this look like a good approach? If not, what would you recommend?
> In any case, I want to upstream the change, so better ask first :)
> 

I would suggest to convert the offending driver to use the watchdog subsystem
(and along the line remove the restriction of only supporting a single
instance). You have the hardware, so that should be a straightforward change.

Thanks,
Guenter

  reply	other threads:[~2017-10-11 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 17:46 Lowering the log level in watchdog_dev_register when err==-EBUSY Radu Rendec
2017-10-11 18:46 ` Guenter Roeck [this message]
2017-10-12 18:15   ` Radu Rendec
2017-10-12 19:54     ` Guenter Roeck
2017-10-13 10:46       ` Radu Rendec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171011184603.GB8756@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=rrendec@arista.com \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.