From patchwork Wed May 4 14:14:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Anand X-Patchwork-Id: 9014451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9281B9F1C1 for ; Wed, 4 May 2016 14:16:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C986E203A0 for ; Wed, 4 May 2016 14:16:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EFA9420272 for ; Wed, 4 May 2016 14:16:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1axxaT-0000CY-R4; Wed, 04 May 2016 14:15:37 +0000 Received: from mail-pa0-f41.google.com ([209.85.220.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1axxa6-0006hi-MH for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2016 14:15:16 +0000 Received: by mail-pa0-f41.google.com with SMTP id bt5so24452004pac.3 for ; Wed, 04 May 2016 07:14:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AJ6Wne1+3gwjrZlwnTda7pZjFyA9t/Njqts9sLj+7HA=; b=hOlqucxO+RzyVZZyHK5gn59vLvlB4HmafLZA7Re68P8SjG2CPaiG6sHrBN5TkTwX8N hvD6ZATa4RavzHFb+TIJ5ghyEnvZXNOIBiMQtd7VCLj7VvDW9PKj/0R4luA6qeTyntkT GDOCXnEWKqgfvfd9oV/48viTr+zHWqc3mq20OEx5NJN3OuAyf3sPBC0t/Yp3+R97LLjT wGml8mcmv9fS4TxMWACIBH/nPJGmUGZcJtURu9fSHg/oIgKhYpv8bxNNrSaM+887sK1h Pq9rBoqUly6FuIJfuFDK5GFmodEszMh4acwLonatm8VplrLdun2wl0Asv6GWi5UjYOqy 9h+w== X-Gm-Message-State: AOPr4FWfNJ15IApO6DTqCnsIVX1jma2VPAwFFML8OHh7tXgcOFnZXQ1inpAwXW/vHYZscVuZ X-Received: by 10.66.63.98 with SMTP id f2mr12387067pas.123.1462371292533; Wed, 04 May 2016 07:14:52 -0700 (PDT) Received: from localhost ([122.177.184.150]) by smtp.gmail.com with ESMTPSA id zn12sm6626424pab.14.2016.05.04.07.14.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 May 2016 07:14:51 -0700 (PDT) Date: Wed, 4 May 2016 19:44:49 +0530 From: Pratyush Anand To: Guenter Roeck Subject: Re: [PATCH RFC] Watchdog: sbsa_gwdt: Enhance timeout range Message-ID: <20160504141449.GG13045@dhcppc6.redhat.com> References: <20da73bb9bdf27993514c1da80fead13dc92932d.1462262900.git.panand@redhat.com> <5728A7C3.4010001@roeck-us.net> <20160503143856.GE13045@dhcppc6.redhat.com> <5728BEC4.6050603@codeaurora.org> <20160503155141.GF13045@dhcppc6.redhat.com> <20160503171602.GA2518@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160503171602.GA2518@roeck-us.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160504_071514_932115_2A11E7B7 X-CRM114-Status: GOOD ( 23.10 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-watchdog@vger.kernel.org, Timur Tabi , open list , wim@iguana.be, fu.wei@linaro.org, Suravee.Suthikulpanit@amd.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Guenter, On 03/05/2016:10:16:02 AM, Guenter Roeck wrote: > On Tue, May 03, 2016 at 09:21:41PM +0530, Pratyush Anand wrote: > > On 03/05/2016:10:07:48 AM, Timur Tabi wrote: > > > Pratyush Anand wrote: > > > >In fact after supporting max_hw_heartbeat_ms, there should be no change for > > > >action=0 functionally. However, we would still need some changes for action=1. > > > > > > IMHO, action=1 is more of a debugging option, and not something that would > > > be used normally. I would need to see some evidence that real users want to > > > have action=1 and a longer timeout. > > > > > If action=1 need to be used effectively, then we should have something which > > would help to increase timeout values. > > > > Currently you have only 10 second to execute secondary kernel, which might not > > be sufficient. > > > Previously the argument was that the 10 seconds (assuming the clock runs at > maximum speed) would not be sufficient to load the watchdog application. Now it May be you meant "would be sufficient". OK..let me clarify on it. Currently it takes 7-8 second from the point 1st kernel panics to the point second kernel boots. (Given, we have D-cache enabled in kexec-tools, for which community is not yet agreed), anyway..so, it is safe for me as of now. But, there is only 2-3 second margin. So, I am not sure if all sort of secondary kernel will be able to make it in that time. Following minimal code will be able to extend timeout for secondary kernel, and I do not see anything wrong in it. We are anyway, panicking in ISR, so what could be disadvantage if we write a wdt register just before panicking? ~Pratyush --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -221,6 +221,13 @@ static int sbsa_gwdt_stop(struct watchdog_device *wdd) static irqreturn_t sbsa_gwdt_interrupt(int irq, void *dev_id) { + struct sbsa_gwdt *gwdt = (struct sbsa_gwdt *)dev_id; + struct watchdog_device *wdd = &gwdt->wdd; + u64 timeout = (u64)gwdt->clk * wdd->timeout; + + writeq(timeout + arch_counter_get_cntvct(), + gwdt->control_base + SBSA_GWDT_WCV); + panic(WATCHDOG_NAME " timeout"); return IRQ_HANDLED;