Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1087906ybb; Fri, 3 Apr 2020 18:09:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJGm73egMYU1Sj1uH2LxQ1AKh0+/AfHWBZHFW1GCSaUTu/bVsvkcBEdtT23Urt5CxBxvmuS X-Received: by 2002:aca:bc56:: with SMTP id m83mr5023927oif.11.1585962581394; Fri, 03 Apr 2020 18:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585962581; cv=none; d=google.com; s=arc-20160816; b=mYa4gbwC65Mc3SOoBEAangqif9OG2oX8Vd3c21lKAGftONrDJAh7Ul4i0s1QqQ+rGK ZyoMQkOcYZV3bf1mORO6Pb+69RCDx+8wLwIlm/IKJVj0x1WDoM1G+prmhcklpR6eq3vn Qo8t/phZf2L3br7Jex+2soxtIygzUieUYEBbls3KOdKGmThWE2dgJE9f6kvcy8u22wgr pLxUj5aayhIZ9rb0pSH6pLrmdz/SY+s/xuz7qXPDHET18GQOCBo+UZCeY3pTBXxb1mAG UZ1vjDjcldHh8sph9hYnF3IIjahCl448w0SVrpTFEjEfnWxSCC+DqqZjf+D61t1j/mZs 3Q4Q== 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=O6b2gnL33BXhVFyfbJth5+UU7eciSHYX3oxtDKEDuDA=; b=sdmTlpaT4IN7sKm0ocYd7bSDVNgCe1eHTUub6ui9ucDZMwN/9nEwvZqCgbF8GR+6+Q pQA7y+J/Sdw5aJOLj8IuutUwF8BMM8f0e5b+JC4HoFGd4j4em7GpQCDQwOTX5QXu3kF1 8/2Lckv0inqP/sqkZXygrLmxrMJqEe9LV013n48nzBdVg3Rxs5BqpxNIodWaJJuZt3Yc mVue8m1yL3VE39CqB5m/A5hxlzpbicybJqI19VyqAfDASRdhmVzuxpiO4/R6RIRQhHM0 usB4k0joNbbo1KNO8X7PaecycQdzfmtLPDq52lS3beMtKEqBLaBmBtCHVpSN4gsXK8t1 MWyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=alUJeSWD; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k137si4399295oih.226.2020.04.03.18.09.25; Fri, 03 Apr 2020 18:09:41 -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=@chromium.org header.s=google header.b=alUJeSWD; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726283AbgDDBHq (ORCPT + 99 others); Fri, 3 Apr 2020 21:07:46 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39670 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726186AbgDDBHq (ORCPT ); Fri, 3 Apr 2020 21:07:46 -0400 Received: by mail-pl1-f194.google.com with SMTP id k18so3491830pll.6 for ; Fri, 03 Apr 2020 18:07:45 -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=O6b2gnL33BXhVFyfbJth5+UU7eciSHYX3oxtDKEDuDA=; b=alUJeSWDQbazGmCHaD3vGtuEij3VFxX3HTi56q8fbqaiBp7/Y6J7p4a0acMrl7kInW X0JbVTtUVvSwa+p2769ApqQW7OcZsWyXCQkuQCxepnyx8UF3+h0nm3E2wSbAjzoh6pmH YX5cL9Gly/HX3522R8CBtJKjQTggV2WVU4SLc= 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=O6b2gnL33BXhVFyfbJth5+UU7eciSHYX3oxtDKEDuDA=; b=YLgrMMHSc7KXRy8nDcaOuDuLDsWNN309nU8N1cw2ve97heuxdhuhiKTI1339RqIqx4 DB09pIKzwzJ98FwIP89H/huihupWzbYvy+bPqA1T8qR3pRD8G4rcO7iL4Dy6BWLy2z5h /VpzYA9a9GaGTAJY5cbU5uAGzg9rsBIMGnudjpOvVZYvfF9SouyIaR9QS7Y+YsesDzXr jLhTgAt0CC0fY49N8eAzVYHA/+aXoZF366kHP4ClY+19O+LX+AlHvNK0L7liTFFsgxcC 06Xzp200XxeAynpcm8dDUVnykKM8VxHjlg558gOWVLbQO0pj6SoOETAOj1zAFadIPWzO ffzQ== X-Gm-Message-State: AGi0PuYlZigSO7eCrkXxC5t9PsD/hnFvxEp8hmnbz4UN3ISlXqyvXGhd FsFB8kU7t9M/C/EeWyrm4qh/4kI9lJvRtQ== X-Received: by 2002:a17:90b:2397:: with SMTP id mr23mr12731256pjb.88.1585962464936; Fri, 03 Apr 2020 18:07:44 -0700 (PDT) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com. [209.85.210.174]) by smtp.gmail.com with ESMTPSA id y123sm6530404pfb.13.2020.04.03.18.07.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Apr 2020 18:07:44 -0700 (PDT) Received: by mail-pf1-f174.google.com with SMTP id a24so4468667pfc.8 for ; Fri, 03 Apr 2020 18:07:44 -0700 (PDT) X-Received: by 2002:a1f:e546:: with SMTP id c67mr8715562vkh.38.1585962045690; Fri, 03 Apr 2020 18:00:45 -0700 (PDT) MIME-Version: 1.0 References: <20200403052900.258855-1-evanbenn@chromium.org> <20200403162742.v2.2.Ia92bb4d4ce84bcefeba1d00aaa1c1e919b6164ef@changeid> In-Reply-To: From: Evan Benn Date: Sat, 4 Apr 2020 12:00:18 +1100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] watchdog: Add new arm_smd_wdt watchdog driver To: Julius Werner Cc: LKML , Xingyu Chen , Andy Shevchenko , Anson Huang , Bjorn Andersson , Catalin Marinas , "David S. Miller" , Greg Kroah-Hartman , Guenter Roeck , Jonathan Cameron , Leonard Crestez , Manivannan Sadhasivam , Marcin Juszkiewicz , Matthias Brugger , Mauro Carvalho Chehab , Olof Johansson , Rob Herring , Shawn Guo , Valentin Schneider , Vinod Koul , Will Deacon , Wim Van Sebroeck , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , LINUX-WATCHDOG 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 On Sat, Apr 4, 2020 at 9:56 AM Julius Werner wrote: > > > + wdd->info = &smcwd_info; > > + /* get_timeleft is optional */ > > + if (smcwd_call(SMCWD_GET_TIMELEFT, 0, NULL)) > > How is this supposed to work? A firmware that implements this call > would return the time left here which may not be 0 (maybe the watchdog > was already primed by the bootloader or whatever), so smcwd_call() > would interpret it as an error. > > I think the cleanest solution would be to stick to the same return > codes in a0 and use a1 to report the time left when a0 is > PSCI_SUCCESS. This is more consistent with SMCWD_INIT too. Yes you are right, I have the wrong return code in the get_timeleft implementation. It should use ->a1 for the actual timeleft, a0 is for the error code. Here smcwd_call returns the error code, which is NOT_IMPLEMENTED if the firmware does not implement timeleft. The timeleft itself cannot return error codes else we would just return that there I guess.