lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YjSD8us/T3eHDwB2@kroah.com>
Date:   Fri, 18 Mar 2022 14:06:58 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Christian Vogel <vogelchr@...el.cx>
Cc:     linux-kernel@...r.kernel.org, zbr@...emap.net
Subject: Re: [PATCH 2/2] w1/ds2490: remove dump from ds_recv_status & less
 verbose

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@...el.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@...es.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ