From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752139AbdJ0IAK (ORCPT ); Fri, 27 Oct 2017 04:00:10 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:48003 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751719AbdJ0IAI (ORCPT ); Fri, 27 Oct 2017 04:00:08 -0400 X-Google-Smtp-Source: ABhQp+SQVogQksykNfBVTfGQasrAFbn4MwY7UJYac4CgOICyawaqFUgfq8NERk6o2HwfvXcOW5D0cA== Date: Fri, 27 Oct 2017 17:00:06 +0900 From: Sergey Senozhatsky To: Jeetesh Burman Cc: sergey.senozhatsky@gmail.com, keescook@chromium.org, linux-kernel@vger.kernel.org, bbasu@nvidia.com Subject: Re: [PATCH] panic: add support to update panic_timeout via DT Message-ID: <20171027080006.GA609@tigerII.localdomain> References: <1509076662-22253-1-git-send-email-jburman@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1509076662-22253-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 On (10/27/17 09:27), 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. *my personal opinion* - I'm not super happy to see more and more of_find_node_by_name()'s in random places. but that's just IMHO. > static int init_oops_id(void) > { > + struct device_node *np; > + > + np = of_find_node_by_name(NULL, "panic_timeout"); > + if (np) > + of_property_read_u32(np, "panic-timeout-value", &panic_timeout); > + > if (!oops_id) > get_random_bytes(&oops_id, sizeof(oops_id)); > else why init_oops_id()? you are going to re-read it every time you call print_oops_end_marker(), and the system can be configured not to panic on oops. put it to oops_setup()? or, at least, move it to `if (!oops_id)' branch, maybe? -ss