From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wTkpm5hRhzDqcH for ; Fri, 19 May 2017 20:30:40 +1000 (AEST) Message-ID: <1495189806.3092.111.camel@kernel.crashing.org> Subject: Re: [PATCH 4/4] arch/powerpc/44x/fsp2: wdt tcr update instead of whole rewrite From: Benjamin Herrenschmidt To: Ivan Mikhaylov , Alistair Popple , Matt Porter Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Joel Stanley , Paul Mackerras , Michael Ellerman Date: Fri, 19 May 2017 20:30:06 +1000 In-Reply-To: <20170515130754.59363-5-ivan@de.ibm.com> References: <20170515130754.59363-5-ivan@de.ibm.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2017-05-15 at 16:07 +0300, Ivan Mikhaylov wrote: > +#ifdef CONFIG_FSP2 > +       /* > +        * Prevent a kernel panic caused by unintentionally clearing TCR > +        * watchdog bits.  At this point in the kernel boot, the watchdog has > +        * already been enabled by u-boot.  The original code's attempt to > +        * write to the TCR register results in an inadvertent clearing of the > +        * watchdog configuration bits, causing the 440 to reset. > +        */ > +       tcr = mfspr(SPRN_TCR); > +       tcr &= TCR_WP_MASK; /* clear all bits except for TCR[WP] */ > +       tcr |= TCR_DIE; /* enable decrementer */ > +       mtspr(SPRN_TCR, tcr); > +#else This should be a runtime test, not a compile time option. Cheers, Ben.