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] [day] [month] [year] [list]
Message-ID: <20171027103752.vomjgxkax725zb77@salmiak>
Date:   Fri, 27 Oct 2017 11:37:52 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Lorenzo Pieralisi <lorenzo.pieralisi@....com>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Jeetesh Burman <jburman@...dia.com>, keescook@...omium.org,
        linux-kernel@...r.kernel.org, bbasu@...dia.com,
        Andrew Morton <akpm@...ux-foundation.org>, robh+dt@...nel.org,
        frowand.list@...il.com, devicetree@...r.kernel.org
Subject: Re: [PATCH V2] panic: add support to update panic_timeout via DT

On Fri, Oct 27, 2017 at 01:00:06PM +0100, Lorenzo Pieralisi wrote:
> [+devicetree, Rob, Frank]
> 
> On Fri, Oct 27, 2017 at 06:53:14PM +0900, Sergey Senozhatsky wrote:
> > Cc-ing Andrew on this
> > 
> > 
> > v1: lkml.kernel.org/r/1509076662-22253-1-git-send-email-jburman@...dia.com
> >     lkml.kernel.org/r/20171027080006.GA609@...erII.localdomain
> > 
> > v2: lkml.kernel.org/r/1509097165-15695-1-git-send-email-jburman@...dia.com
> > 
> > 	-ss
> > 
> > On (10/27/17 15:09), Jeetesh Burman wrote:
> > > Add support to set 'panic_timeout' value via dtb to have
> > > control from device tree. This makes sense when you have
> > > multiple platforms support from same defconfig and
> > > differentiated only through device tree blob.
> > > The patch will check for panic time out value coming
> > > from dtb if it exists, otherwise continues with
> > > defconfig provided option.
> 
> I will let Rob and Frank chime in - as far as I am concerned
> you are (ab)using DT to configure a Linux kernel specific internal
> variable and that's certainly not what DT is there for.

Indeed. NAK to this patch.

Regardless, this can easily be configured in /chosen/bootargs (i.e. the kernel
command line) today.

Thanks,
Mark.

> 
> Lorenzo
>  
> > > Signed-off-by: Jeetesh Burman <jburman@...dia.com>
> > > ---
> > >  kernel/panic.c | 11 +++++++++--
> > >  1 file changed, 9 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/kernel/panic.c b/kernel/panic.c
> > > index bdd18af..b487331 100644
> > > --- a/kernel/panic.c
> > > +++ b/kernel/panic.c
> > > @@ -27,6 +27,7 @@
> > >  #include <linux/console.h>
> > >  #include <linux/bug.h>
> > >  #include <linux/ratelimit.h>
> > > +#include <linux/of.h>
> > >  
> > >  #define PANIC_TIMER_STEP 100
> > >  #define PANIC_BLINK_SPD 18
> > > @@ -482,9 +483,15 @@ static u64 oops_id;
> > >  
> > >  static int init_oops_id(void)
> > >  {
> > > -	if (!oops_id)
> > > +	struct device_node *np;
> > > +
> > > +	if (!oops_id) {
> > > +		np = of_find_node_by_name(NULL, "panic_timeout");
> > > +		if (np)
> > > +			of_property_read_u32(np, "panic-timeout-value",
> > > +							&panic_timeout);
> > >  		get_random_bytes(&oops_id, sizeof(oops_id));
> > > -	else
> > > +	} else
> > >  		oops_id++;
> > >  
> > >  	return 0;
> > > -- 
> > > 2.1.4
> > > 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ