Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1241107ybe; Fri, 6 Sep 2019 14:17:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzd0UH7VPFbsG+EmvWPOMEcMH2/fGynnsPIHhCXYcfglp+6Qy33cxFs1r/gQCQDIGzG2ab X-Received: by 2002:a65:5348:: with SMTP id w8mr9709347pgr.176.1567804656617; Fri, 06 Sep 2019 14:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567804656; cv=none; d=google.com; s=arc-20160816; b=Ck8VLLeRy0/KeI1ciZueaVC4wmgCUpaMKURW3dSu9JIC88VA9SZEp4x+R2pzA9oPv2 SFNlMdgx0w774cGM4z4RBlcXY3zIIVJ+pMtUJC57PLydVPtDUf6VD83s/F2fi+sra0kO hfRmxPlfw29w62QadmqZWwFwVlWPuTt1S0pXpucATtHq36FlKZdDzrobeawxQHwrCOxq BMXuEOS8pc3rvIDS7nVR4bc1LX07+ZSv6/p/Wt6bTqezlTj+jrwmfKLGD/oNL8S95H8u E6SnTbQcL6cPcB/UOxOM7Y+gPGt/ZHOQpQv1DrWX6akIyLqp848hcCTpAjP3UWkdSYYE 0CeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=R9GWG5wY/iepwMnyG4oYLLomYTv7fOjvDEM4YE/5Ts8=; b=qW3oNktaF1ceq80rGshEQe5JWykobCWOCcq3S7nPX3Av3emHQ4HS+oAsdxMR63z7gK zsDrzp8GHVeWQzPg+JSfxEbTWxiK+jiHxcdlFdFuiMVsXbDr8nYLABjVGcBQP9kahwh4 h6WhIGvFSM6V5+wu9AO9o9kRGRGg/MI0wMi3aSAknUyDv4rpVlJfMU5AI3Bzf7F8eynP QqbrPiWgrMGpbwhG17PxJYV3Pb/0DwbZ5l97+fj2icFZSlfTmDCZB3OsNisfObFxiIvl ke3QR7halpD11bXj8bsu3dzwU81z7i6P9ZMph+aEH0qYDxaZIs8sqJIM0/YrndJ41xfS H4sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vAvdYJHT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si5777259pjw.27.2019.09.06.14.17.06; Fri, 06 Sep 2019 14:17:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vAvdYJHT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392377AbfIFNZm (ORCPT + 99 others); Fri, 6 Sep 2019 09:25:42 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34036 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391482AbfIFNZl (ORCPT ); Fri, 6 Sep 2019 09:25:41 -0400 Received: by mail-wm1-f66.google.com with SMTP id y135so7422312wmc.1 for ; Fri, 06 Sep 2019 06:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=R9GWG5wY/iepwMnyG4oYLLomYTv7fOjvDEM4YE/5Ts8=; b=vAvdYJHTPWzSQjVkZ8S3mi4tdcxieXnkxnzSfhP2tKQ07aoJyay8oAM3N8LX2DDdeJ DCE06I2ab8RqEeOVeVnDhMauiM4gh8gt96w/YnGxXJ/+BsNY98G6gi4zwXPUN1g4RTsd ZcpO1KjQv8z7bSlreJmtFPibmMF6H18mfnpf6IgdAYFCXSD5ehLFyAlVQYfnmAxGU8yM z5Ydjp1+KIS+UiUTA/TrSheKcR+XabuXOyFvBSTqA3UBd0mgX2D4x/zlqX1cyumY4b0t mU0qXqcIgMZTTV2wBHE1h0PyKmMKlKIFIpWAooA+QpCsCNnOEttaB/3zV1132+yy59d9 A9zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=R9GWG5wY/iepwMnyG4oYLLomYTv7fOjvDEM4YE/5Ts8=; b=ngOHzBaSqOx1DNFoESkR76qU6vOqpOO6mHa8vSnS2me1HXLXAWqVRZnJRAYaqkYIxS 9m/YW+13xkZI7LsjF2Sk4i3VRnXCUW9QVFr/thYK23LY3F+xIruLxmJOy6DokN1aEQEJ 8Z9EvTp+q95VqgXq7gbFyWXyYlzCA4PyLh2dR4Kzy4kBSWEST1WLBvnTc6+LFEU/Ds0Q z0jx2CP8z/i57UOnt014ss0Y5hjBCQ+NShnFODD7R5Un+HHD992Hy3FASvE8gYouvUUc Zdesc5wS1UgElm7MhTpgHSJQXnuTrYn1wHpQ1Q7aRfN3IiL10Un96LVYRwtNbIvekg/v YGoQ== X-Gm-Message-State: APjAAAXbt6fI2nIVsyzyWgF8p591Mmi4IypmHhS+XPfZxly88g7neCLZ lc/wRFMJXk8N/v0Hx4oaIyksraNvORs= X-Received: by 2002:a1c:7f4f:: with SMTP id a76mr1096553wmd.117.1567776339388; Fri, 06 Sep 2019 06:25:39 -0700 (PDT) Received: from [192.168.1.6] (124.red-83-36-179.dynamicip.rima-tde.net. [83.36.179.124]) by smtp.gmail.com with ESMTPSA id d9sm2480551wrf.62.2019.09.06.06.25.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2019 06:25:38 -0700 (PDT) Subject: Re: [PATCH v4] watchdog: qcom: support pre-timeout when the bark irq is available To: Guenter Roeck Cc: agross@kernel.org, wim@linux-watchdog.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190905210035.9985-1-jorge.ramirez-ortiz@linaro.org> <20190905211913.GA31094@roeck-us.net> <68ca07e6-efa2-d5bd-111b-faaa86808192@linaro.org> <20190906125937.GA7255@roeck-us.net> From: Jorge Ramirez Message-ID: <3721c11b-6a18-9459-ef37-dccb0ffad198@linaro.org> Date: Fri, 6 Sep 2019 15:25:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190906125937.GA7255@roeck-us.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> >>>> static const u32 reg_offset_data_apcs_tmr[] = { >>>> [WDT_RST] = 0x38, >>>> [WDT_EN] = 0x40, >>>> @@ -54,15 +58,38 @@ struct qcom_wdt *to_qcom_wdt(struct watchdog_device *wdd) >>>> return container_of(wdd, struct qcom_wdt, wdd); >>>> } >>>> >>>> +static inline int qcom_get_enable(struct watchdog_device *wdd) >>>> +{ >>>> + int enable = QCOM_WDT_ENABLE; >>>> + >>>> + if (wdd->info->options & WDIOF_PRETIMEOUT) >>>> + enable |= QCOM_WDT_ENABLE_IRQ; >>>> + >>> >>> Again, the condition needs to be that pretimeout != 0, >>> not that it is supported. >> >> no I dont think so. doing that would propagate a possible error in some >> pretimeout setup code which would end up enabling an interrupt when it >> shouldnt. so I dont think that doing that would be correct. >> > If the pretimeout setup code is buggy, it needs to be fixed. the condition whether to enable the HW interrupts (IMO) should be controlled by the DTS as part of the static configuration. > >> The interrupt should only be enabled if WDIOF_PRETIMEOUT is configured >> (independently of the pretimeout value); as a matter of fact, if >> pretimeout is 0, the interrupt will trigger at the same time than bark >> (which is what the original code used to do). >> > The original code did not set bit 1 of the WDT_EN register, sure, this is true > and it did not set the bark time. actually no, unless we are looking at different files, the original code did set the bark time even though PRETIMEOUT was not enabled... so yes bark was being set to bite. Maybe I am misunderstanding your point. > >> so I'd rather keep this condition unless you strongly oppose to it. >> > > Please feel free to petition to Wim. I'll change to your recomendation and repost v5 - I thought WDIOF_PRETIMEOUT was formally correct but functionally there is little difference (if the hardware works as expected) thanks for all your comments Guenter.