From: Lorenzo Pieralisi <lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>
To: Sergey Senozhatsky
<sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Jeetesh Burman <jburman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
bbasu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V2] panic: add support to update panic_timeout via DT
Date: Fri, 27 Oct 2017 13:00:06 +0100 [thread overview]
Message-ID: <20171027115957.GA32605@red-moon> (raw)
In-Reply-To: <20171027095314.GA724-doRD9GlggSwB9AHHLWeGtNQXobZC6xk2@public.gmane.org>
[+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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
> lkml.kernel.org/r/20171027080006.GA609-doRD9GlggSwB9AHHLWeGtNQXobZC6xk2@public.gmane.org
>
> v2: lkml.kernel.org/r/1509097165-15695-1-git-send-email-jburman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
>
> -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.
Lorenzo
> > Signed-off-by: Jeetesh Burman <jburman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> > ---
> > 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Jeetesh Burman <jburman@nvidia.com>,
keescook@chromium.org, linux-kernel@vger.kernel.org,
bbasu@nvidia.com, Andrew Morton <akpm@linux-foundation.org>,
robh+dt@kernel.org, frowand.list@gmail.com,
devicetree@vger.kernel.org
Subject: Re: [PATCH V2] panic: add support to update panic_timeout via DT
Date: Fri, 27 Oct 2017 13:00:06 +0100 [thread overview]
Message-ID: <20171027115957.GA32605@red-moon> (raw)
In-Reply-To: <20171027095314.GA724@tigerII.localdomain>
[+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@nvidia.com
> lkml.kernel.org/r/20171027080006.GA609@tigerII.localdomain
>
> v2: lkml.kernel.org/r/1509097165-15695-1-git-send-email-jburman@nvidia.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.
Lorenzo
> > Signed-off-by: Jeetesh Burman <jburman@nvidia.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
> >
next prev parent reply other threads:[~2017-10-27 12:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 9:39 [PATCH V2] panic: add support to update panic_timeout via DT Jeetesh Burman
2017-10-27 9:53 ` Sergey Senozhatsky
[not found] ` <20171027095314.GA724-doRD9GlggSwB9AHHLWeGtNQXobZC6xk2@public.gmane.org>
2017-10-27 12:00 ` Lorenzo Pieralisi [this message]
2017-10-27 12:00 ` Lorenzo Pieralisi
2017-10-27 10:37 ` Mark Rutland
2017-10-27 10:37 ` Mark Rutland
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=20171027115957.GA32605@red-moon \
--to=lorenzo.pieralisi-5wv7dgnigg8@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=bbasu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jburman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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.