linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Christian Vogel <vogelchr@vogel.cx>
Cc: linux-kernel@vger.kernel.org, zbr@ioremap.net
Subject: Re: [PATCH 2/2] w1/ds2490: remove dump from ds_recv_status & less verbose
Date: Fri, 18 Mar 2022 14:06:58 +0100	[thread overview]
Message-ID: <YjSD8us/T3eHDwB2@kroah.com> (raw)
In-Reply-To: <20220311192833.1792-3-vogelchr@vogel.cx>

On Fri, Mar 11, 2022 at 08:28:33PM +0100, Christian Vogel wrote:
> The ds_recv_status function has a "dump" parameter that is used only
> once, and mixes in extremely verbose debugging to the kernel log with
> fetching the status registers.
> 
> Removing the logging from ds_recv_status(), making logging explitic at
> the one place where it was used. Also decoding of the status register
> is turned off by default, and a module parameter added to re-enable.
> 
> Signed-off-by: Christian Vogel <vogelchr@vogel.cx>
> ---
>  Documentation/w1/masters/ds2490.rst |  7 +++++++
>  drivers/w1/masters/ds2490.c         | 28 +++++++++++++++++++---------
>  2 files changed, 26 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/w1/masters/ds2490.rst b/Documentation/w1/masters/ds2490.rst
> index 7e5b50f9c0f5..8aa455627aad 100644
> --- a/Documentation/w1/masters/ds2490.rst
> +++ b/Documentation/w1/masters/ds2490.rst
> @@ -70,3 +70,10 @@ Notes and limitations.
>    or the host OS and more likely the host OS.
>  
>  03-06-2008 David Fries <David@Fries.net>
> +
> +Kernel Parameter
> +----------------
> +
> +A kernel parameter verbose_dump=1 can be added to make the module
> +decode the status register on errors in a very verbose way. By default
> +this verbose decode is turned off.
> diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
> index f6664fc9596a..354a35726967 100644
> --- a/drivers/w1/masters/ds2490.c
> +++ b/drivers/w1/masters/ds2490.c
> @@ -120,6 +120,10 @@
>  #define EP_DATA_OUT			2
>  #define EP_DATA_IN			3
>  
> +static int verbose_dump;
> +module_param(verbose_dump, int, 0644);
> +MODULE_PARM_DESC(verbose_dump, "Generate a very verbose dump of the status registers on errors.");
> +
>  struct ds_device {
>  	struct list_head	ds_entry;
>  
> @@ -222,6 +226,9 @@ static void ds_dump_status(struct ds_device *dev, unsigned char *buf, int count)
>  	dev_info(&dev->udev->dev, "ep_status=0x%x, count=%d, status=%*phC",
>  		dev->ep[EP_STATUS], count, count, buf);
>  
> +	if (!verbose_dump)
> +		return;
> +

Please just turn all of these dev_info() lines into dev_dbg() and then
the kernel-wide dynamic debugging logic will be used instead of a custom
module parameter.

thanks,

greg k-h

  reply	other threads:[~2022-03-18 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11 19:28 w1/ds2490: fix excessive logging Christian Vogel
2022-03-11 19:28 ` [PATCH 1/2] w1/ds2490: remove spurious newlines within hexdump Christian Vogel
2022-03-11 19:28 ` [PATCH 2/2] w1/ds2490: remove dump from ds_recv_status & less verbose Christian Vogel
2022-03-18 13:06   ` Greg KH [this message]
2022-03-24 19:32     ` w1/ds2490: fix excessive logging Christian Vogel
2022-03-24 19:32       ` [PATCH 2/2] w1/ds2490: remove dump from ds_recv_status, pr_ to dev_XXX logging Christian Vogel

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=YjSD8us/T3eHDwB2@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vogelchr@vogel.cx \
    --cc=zbr@ioremap.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).