Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755925AbcCXQSL (ORCPT ); Thu, 24 Mar 2016 12:18:11 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:35850 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303AbcCXQR5 (ORCPT ); Thu, 24 Mar 2016 12:17:57 -0400 Date: Thu, 24 Mar 2016 09:17:54 -0700 From: Guenter Roeck To: Matthew McClintock Cc: Stephen Boyd , andy.gross@linaro.org, linux-arm-msm@vger.kernel.org, qca-upstream.external@qca.qualcomm.com, Wim Van Sebroeck , "open list:WATCHDOG DEVICE DRIVERS" , open list Subject: Re: [PATCH 08/17] watchdog: qcom: configure BARK time in addition to BITE time Message-ID: <20160324161754.GA6515@roeck-us.net> References: <1458770712-10880-1-git-send-email-mmcclint@codeaurora.org> <1458770712-10880-9-git-send-email-mmcclint@codeaurora.org> <20160323224226.GD18567@codeaurora.org> <19DAEEE1-1019-49FB-A921-4311F592A7EC@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <19DAEEE1-1019-49FB-A921-4311F592A7EC@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1249 Lines: 21 On Thu, Mar 24, 2016 at 10:46:42AM -0500, Matthew McClintock wrote: > On Mar 23, 2016, at 5:42 PM, Stephen Boyd wrote: > > > > On 03/23, Matthew McClintock wrote: > >> For certain parts and some versions of TZ, TZ will reset the chip > >> when a BARK is triggered even though it was not configured here. So > >> by default let's configure this BARK time as well. > >> > > > > Why isn't TZ configuring the bark time to what it wants? I'm lost > > why we have to do this for them. > > So it was done like this to ensure we had a valid upgrade. The bootloader is using the watchdog to ensure the system is bootable and if not it will revert back to the working images. > > Bottom line is, for some versions of TZ out there, if we enable watchdog coming out of boot the bark time is already configured by the boot loader and TZ is configured to intercept this interrupt and do some register saving (for crashdump) and we end up getting a watchdog reset during boot. > > It’s even a little more complex, because in order for the TZ to save the registers you need to pad the BITE time a bit higher than the BARK time, but I was leaving that for another day. > Sounds like an op[timal target for using pretimeout ? Guenter