Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp942253rwj; Thu, 22 Dec 2022 17:50:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXuBpEjrHY+hN77keZIdmdCeEAxO2fB48wEAWD5bvqy+8/y+35LVl3DJ0QnHK56yO7o9Er5w X-Received: by 2002:a17:906:7188:b0:7c0:f117:6990 with SMTP id h8-20020a170906718800b007c0f1176990mr6393107ejk.41.1671760203892; Thu, 22 Dec 2022 17:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671760203; cv=none; d=google.com; s=arc-20160816; b=T6+kMdUbqR28ZIJnlPvQuDgvKt6L/wIt9fCILbd7YYHfjP4vTEQc0nI92KSCRqxmtO hYcGEMxBmfNWsFIMWki3JoDTUEi9jKhLn1Msv6GVI9WlwwUWfzPlZ87KNjY7v0IDhnFC UTe/OHpFYj/5eC6e7IDHJjaS91cKLZqdG8H6+uLS2OIiKhQwR3iJSf++qckkkf408nMk qwj7QWHqjOKsuzsCQerzRlfhCgjGrRV7dVm2fJEy31gCvYY43SCOHUBENZISlmu0+v6P eC8c7Npy4MamtM+18FH+jpKaW3wfmOBNRiUjxnq/8uZVlKjSWTDv98yVjA/6rr9LXxE7 3Keg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=jrXYNrQBTvwm5ci+yZvQJOUeh50hcJmA0AcwoEvKjqo=; b=XjHWHKloOeYHSJHXJL51mtBk8grL/MLgl406Z+Oh4AW3/t3HHwKKjlLpjlKPYJHISm KCP6lSjdObjZi6aI7nd1pc/DtVY1kVcI1xAZQducPcRwzVtfJ6ZQqBmxYYO2bmo4g/ge Ytxev33yuA2F9RSzkwSZgVUUMA7p7ELZlrgdAYE/0Hf1PeizhnY7HsbULJ1cM32rwdZr FX3t8FxgQKZOMnDV29QZVjvfenGHfmYOFpg0Kb1IRVhjDXL61y9nEEAiA/x3EpCMuuOb +dPExlUM9F79Aa+ha1gftH32ao85n4QnKPCzXDeuhgMlWndiFm7+7uxaAbyf2pxwrm+E bMwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Dt2/YI7F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz19-20020a1709077d9300b00783e7d72fc0si1729002ejc.272.2022.12.22.17.49.47; Thu, 22 Dec 2022 17:50:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Dt2/YI7F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbiLWAzZ (ORCPT + 69 others); Thu, 22 Dec 2022 19:55:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbiLWAzX (ORCPT ); Thu, 22 Dec 2022 19:55:23 -0500 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D69C21259; Thu, 22 Dec 2022 16:55:18 -0800 (PST) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1443a16b71cso4407245fac.13; Thu, 22 Dec 2022 16:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=jrXYNrQBTvwm5ci+yZvQJOUeh50hcJmA0AcwoEvKjqo=; b=Dt2/YI7FLlGpPodOaERqxcPF5edwtNrT6F3ULIEs+86T6q6lNxHAAQvKf5jcaSghKE sRdFhT8Ys8J7SxK5gdV0xOrp+H4bwbl51PTGloiH9xAubw+ta3ZgD4p0kBtBUV3P+Uqv atYSK9xbh+ebysr/3zlU3GS7yjawYoddJY+hAXiUKwxWEML2JmNeYFgdxFOz7KotQaIT St0qfhsviAMFVjYx46tWfCZf/ab7DvcvtuWT3r9sVsXe7bm1hHrrke0DOXkTBoxRrhbJ AOKjT7+K7fLz3XiXVgziG/6LcsL+h2pV7QYW1f+CbhMVS0bgeiB1IcbM9mmk/ahI0jNM +CvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jrXYNrQBTvwm5ci+yZvQJOUeh50hcJmA0AcwoEvKjqo=; b=wFISvWlc2SQvodUGK4nU9nGYJsUXiExGcPgVTJnixjAh5TyXI9vMiPoVZsVGgm9OWB IMY6foASDlEg7fkgyMYynDIIaSXLzW0Q08/J7l+Dw/Re8CxADX+euR4A29Oa4KwoPUe8 HG6lN2cfrClq7jwhpuvvsndWKgtjj+ZvRo806Qc7uQOV1fiV02gxli3MiwXVBrorzdqQ Lc5A/FzZLDEMq+3c3vXz4XB18wm9qU6ZxbXIYHJZShjH9VxFqU+oA1lft1MYzgkz5vvz nG8uOLsk4sqEMqVyJaX9zWAMbKOA1Y3kQvM062HxCOlHve5HwTls8lfm/sdmXtL3EmEr YpBA== X-Gm-Message-State: AFqh2kpT2QCZbpVgkSnU8huiGiiSbB3Mlaxlol7jn6G6P9RhDOFjjYpP vA0oZh3xn7efsAdBhpUe3k2ht2qc1Po= X-Received: by 2002:a05:6870:9f89:b0:144:ace9:ef83 with SMTP id xm9-20020a0568709f8900b00144ace9ef83mr3752485oab.57.1671756917385; Thu, 22 Dec 2022 16:55:17 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id a15-20020a05687073cf00b00144bb1013e6sm957382oan.4.2022.12.22.16.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 16:55:16 -0800 (PST) Sender: Guenter Roeck Date: Thu, 22 Dec 2022 16:55:14 -0800 From: Guenter Roeck To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] watchdog: wdat_wdt: Avoid unimplemented get_timeleft Message-ID: <20221223005514.GA3188712@roeck-us.net> References: <20221221-wdat_wdt-timeleft-v1-1-8e8a314c36cc@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221221-wdat_wdt-timeleft-v1-1-8e8a314c36cc@weissschuh.net> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 22, 2022 at 11:43:31PM +0000, Thomas Wei?schuh wrote: > As per the specification the action QUERY_COUNTDOWN_PERIOD is optional. > If the action is not implemented by the physical device the driver would > always report "0" from get_timeleft(). > Avoid confusing userspace by only providing get_timeleft() when > implemented by the hardware. > > Signed-off-by: Thomas Wei?schuh Assuming that there can be only one of those watchdogs in the system, Reviewed-by: Guenter Roeck Guenter > --- > drivers/watchdog/wdat_wdt.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c > index ce7a4a9e4b03..0ba99bed59fc 100644 > --- a/drivers/watchdog/wdat_wdt.c > +++ b/drivers/watchdog/wdat_wdt.c > @@ -301,13 +301,12 @@ static const struct watchdog_info wdat_wdt_info = { > .identity = "wdat_wdt", > }; > > -static const struct watchdog_ops wdat_wdt_ops = { > +static struct watchdog_ops wdat_wdt_ops = { > .owner = THIS_MODULE, > .start = wdat_wdt_start, > .stop = wdat_wdt_stop, > .ping = wdat_wdt_ping, > .set_timeout = wdat_wdt_set_timeout, > - .get_timeleft = wdat_wdt_get_timeleft, > }; > > static int wdat_wdt_probe(struct platform_device *pdev) > @@ -436,6 +435,9 @@ static int wdat_wdt_probe(struct platform_device *pdev) > list_add_tail(&instr->node, instructions); > } > > + if (wdat->instructions[ACPI_WDAT_GET_CURRENT_COUNTDOWN]) > + wdat_wdt_ops.get_timeleft = wdat_wdt_get_timeleft; > + > wdat_wdt_boot_status(wdat); > wdat_wdt_set_running(wdat); > > > --- > base-commit: 0a924817d2ed9396401e0557c6134276d2e26382 > change-id: 20221221-wdat_wdt-timeleft-b38d0db39d9f > > Best regards, > -- > Thomas Wei?schuh