Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp758217ybz; Wed, 15 Apr 2020 18:18:31 -0700 (PDT) X-Google-Smtp-Source: APiQypIstdAdWqT30F6M/cT9SQ9lotQKFEiO0ZV+vFzpQtu7otayH2voVRZkvUFw8MDtBCQ2C45L X-Received: by 2002:a17:906:70f:: with SMTP id y15mr7661895ejb.276.1586999911839; Wed, 15 Apr 2020 18:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999911; cv=none; d=google.com; s=arc-20160816; b=EWIwxtwaAu0tSqmC2jDwQE92RVILG98q75chhAv3K5Dpv3ge8p+TYbjwufmZuyQJqI qRhNAFdG5EEF/DqZ8U7dMQbGb5D+cAdVIct+x1A+5unZ1a2XOF+8HVdRKFprMzcopG2C PzcWUgb4KzD2zp9ZENVtmaOHIuInqqpLVVXvTQt6UNoqf8FLLAK3Eg0ZJ46QKW5YH2EM M6DTIKtFwB68+9B3RZ3nnpKvYTCanBZ8mZDo07M1M1bWgxTI3Qby72p9C9pm+oQwRjpL czkXsLa494Ibz7EBNwDoz48Nw50NMFQtVf7CQChp3+kLVKf8M/D4894Qcjh1rYgXlU6d Dhqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oymDymDSGwWgVl7PdrWgMeH1mdt9MH+svEJHIh9ofYo=; b=Auy3przOm3qwHPV88B9q7lrWzfAqRlk2nsiXF90AdFH04etygfqqFAXMoYAOm1sgNX Os/L2V3gqJvFhv74KYmlVb9woLIlqBB1/1O8IHjfCSdqttog8JDOkKCWqpwbjS9Uw6/k xOpKFbGDMtb5Bns9lENf2+hXSrBmxhQERUo+M+y1pbOFIDAvjOIs/0ksQWGMsok6J0TF A8knFz0naczaavaaCqs0BPzdJqvQD46SnTElWXYIk7aOxYbHjImu6hozeqdqjq4yjQL7 lR5KaryZL3AJUBBEmJk0nQRoAXvsMdTqEMXc4pydutqpcQ64yIAkXSzf0Wab55N1fNWF iaHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a2XbOiwl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si13179568edn.229.2020.04.15.18.18.09; Wed, 15 Apr 2020 18:18:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a2XbOiwl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404962AbgDPArR (ORCPT + 99 others); Wed, 15 Apr 2020 20:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2404680AbgDPArK (ORCPT ); Wed, 15 Apr 2020 20:47:10 -0400 Received: from mail-ua1-x943.google.com (mail-ua1-x943.google.com [IPv6:2607:f8b0:4864:20::943]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1753BC061A0C for ; Wed, 15 Apr 2020 17:47:10 -0700 (PDT) Received: by mail-ua1-x943.google.com with SMTP id s5so112757uad.4 for ; Wed, 15 Apr 2020 17:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oymDymDSGwWgVl7PdrWgMeH1mdt9MH+svEJHIh9ofYo=; b=a2XbOiwlAAQzxczt4QF4WPs7900EFsrLVOxWmAfWFDrYlbOxFqFleRRIhOr+uI8M5f M2cwVJ40d4uDtjkefb7KmLLsMXHjL/sGzNwIx0DMzOlXnR5mb/1snHQ+m68Q4OvzwI+F RFsl2ztnRLmbC/I9LzD4UKpcjD3O1jAdNfCXg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oymDymDSGwWgVl7PdrWgMeH1mdt9MH+svEJHIh9ofYo=; b=B8Frqih+BDOvXJ3gLqBYAnUiiLkHX7Q6lUDvpwH3vlpN98Esfo++Z8ct7xfH0zBOmD ZqFcckOD2iYjgLFTBvXQUKM8EHpNZAS8V1TFkv1TtX3PDLrnMWhJfLM1wh+WOTj4Xukh 35CQlQ8htYr+0u8cvyW5BjcCUJ9prwecD5JUv29ev+PeKG1ib5ftiRQQP5qYQdIKPDUc FyjkHIre4h8mt8yY6pzl9rcxG+5RN8N2RuUQwRgGhC98jAlkgx/NM6ST74EI+jsQR83s MohyHMl5LosSxyflsD/+ChbPbuXlSAipabgq8e7hrcSwZ9v7RAv4GqlWWZJzJDkdb/HS KMyw== X-Gm-Message-State: AGi0Pubx276EvYEPzJ5+jQG+d/b3Cfac+vOed3en/ZwZouHUsDwmFXsM Ff7nST6NkfJplDGN8XdW5EeO0u/7CGY= X-Received: by 2002:ab0:2a5:: with SMTP id 34mr7351706uah.74.1586998029049; Wed, 15 Apr 2020 17:47:09 -0700 (PDT) Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com. [209.85.222.54]) by smtp.gmail.com with ESMTPSA id x25sm507726vso.5.2020.04.15.17.47.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Apr 2020 17:47:08 -0700 (PDT) Received: by mail-ua1-f54.google.com with SMTP id c24so1574465uap.13 for ; Wed, 15 Apr 2020 17:47:07 -0700 (PDT) X-Received: by 2002:ab0:592c:: with SMTP id n41mr1543975uad.73.1586998027359; Wed, 15 Apr 2020 17:47:07 -0700 (PDT) MIME-Version: 1.0 References: <20200403052900.258855-1-evanbenn@chromium.org> <890948ef-7276-fdae-d270-eb30eff3eab2@amlogic.com> <243e107c-35c1-2d14-5285-c9e13744963c@amlogic.com> <20200415231215.GA182398@roeck-us.net> In-Reply-To: <20200415231215.GA182398@roeck-us.net> From: Evan Benn Date: Thu, 16 Apr 2020 10:46:39 +1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls. To: Guenter Roeck Cc: Julius Werner , Xingyu Chen , LKML , Andy Shevchenko , Anson Huang , Bjorn Andersson , Catalin Marinas , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , Leonard Crestez , Manivannan Sadhasivam , Marcin Juszkiewicz , Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Olof Johansson , Rob Herring , Rob Herring , Shawn Guo , Valentin Schneider , Vinod Koul , Will Deacon , Wim Van Sebroeck , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , LINUX-WATCHDOG , Jianxin Pan , Yonghui Yu , "open list:ARM/Amlogic Meson..." Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Xingyu, Can anyone provide advice about making SMCWD_FUNC_ID a device tree param directly, vs using the compatible to select from a table. Please note get_timeleft erroneously returns res.a0 instead of res.a1 in this version. Evan On Thu, Apr 16, 2020 at 9:12 AM Guenter Roeck wrote: > > On Wed, Apr 15, 2020 at 03:29:29PM -0700, Julius Werner wrote: > > > In addition, It looks more reasonable to use the "msec" as the unit of > > > timeout parameter for the ATF fw interface with SMCWD_SET_TIMEOUT: > > > > > > - The fw interface will compatible with the uboot generic watchdog > > > interface at [0], and there is no need to convert timeout from msec > > > to sec. > > > > I think we're trying hard to keep this compatible to a Trusted > > Firmware counterpart that we have already shipped, so we would prefer > > to keep it at seconds if possible. That's what the Linux watchdog core > > uses as well after all, so it just seems natural. I don't really see > > how what U-Boot does would have anything to do with this. > > > > > - Some vendor's watchdog may be not support the "wdt_trigger_reset" > > > reset operation, but they can use the method below to reset the system > > > by the watchdog right now. > > > > > > watchdog_set_time(1); //1ms > > > watchdog_enable(); > > > > They can still do that but they should do that on the Trusted Firmware > > side. Emulating a missing reset functionality should be handled by the > > hardware abstraction layer (in this case Trusted Firmware), not at the > > Linux API level. So Linux would still send a PSCI_SYSTEM_RESET SMC, > > but then Trusted Firmware can choose to implement that by setting the > > watchdog to the smallest possible timeout (which it can because it's > > accessing it directly, not through this SMC interface) and letting it > > expire. > > I agree. Using a watchdog to implement reset functionality is always a > means of last resort and should be avoided if possible. > > Guenter