From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752213AbdJ0JxU (ORCPT ); Fri, 27 Oct 2017 05:53:20 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:43311 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751076AbdJ0JxR (ORCPT ); Fri, 27 Oct 2017 05:53:17 -0400 X-Google-Smtp-Source: ABhQp+RitsW6TTrlD0bDD4l0ooE5zowx1YXZv2DV8RY1G+wHb2Ykg67pBXxtHmqpJE/4RpsQzptUpA== Date: Fri, 27 Oct 2017 18:53:14 +0900 From: Sergey Senozhatsky To: Jeetesh Burman Cc: sergey.senozhatsky@gmail.com, keescook@chromium.org, linux-kernel@vger.kernel.org, bbasu@nvidia.com, Andrew Morton Subject: Re: [PATCH V2] panic: add support to update panic_timeout via DT Message-ID: <20171027095314.GA724@tigerII.localdomain> References: <1509097165-15695-1-git-send-email-jburman@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1509097165-15695-1-git-send-email-jburman@nvidia.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Signed-off-by: Jeetesh Burman > --- > 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 > #include > #include > +#include > > #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 >