Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2086782pxb; Sat, 2 Oct 2021 06:24:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGk70dmLoaHUZKcOW5trc06rQK8m53/saC5h5XWe6WXfhpezF0MZ/gvfWU8S5kj8Meh+8b X-Received: by 2002:a17:902:a50d:b0:13d:8d71:aa91 with SMTP id s13-20020a170902a50d00b0013d8d71aa91mr14476971plq.24.1633181081509; Sat, 02 Oct 2021 06:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633181081; cv=none; d=google.com; s=arc-20160816; b=AlLg5GDgVuOek32K9H3d9VGWFqR9Eds3gpuBz23gkPk8JITIPGz+/cBwU0JlzMtMH/ I/bEuc0Yfny5B3gBFE/4z3BKU3pW1ud5XEjnTJsUlDWycfM1faQkheb7PvOP1h3p4OCm 6x1gM/IEFJ4UpKCeYCdAV3+w4lRQT+QcGOZkMCChJZrIrYCm3MOoTCDWI5zaaP7JweVR G+bkAoSO93SYtS2fpwNBvq0oEf1gS5PguiMIp1TiJvV6zRv8tbRf1CXSFww931S040Zb BDljBEEESkycPpUzHDlSRgLGD5vdSehqoNiInlE588vx9TTwURqUpQNlAVTDFwwHfTjZ 7Zzw== 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=AvliCJIc2kXc9rCZcDMuJsQ1OOymjbvJDawg6aDGvpU=; b=XX8fYIX36fpM1Z9tq4moBH0galOqpUV1H/3XS2QmmsAZFjE8nom3Nx7h3Pw6PLJzNr M4u+2JefTSUnjgRn9cYHRjvtnSBzYBJfVDYRBbD9APTVx80ARnNfZ2kibQyRE/jfhRAo Gwrf4pjmh9WnGid89EMojwWtezYWXwO9GlwEjZpHRDPTVLc80R1B0oCx874JJfA8hslf aU4KEPZX4rOqkh+F/7UoZO7+nwgIsG0tU8Aylx29hIvuaLQgCizjvOPsmSEgJtlxHti1 Q4roa4Vv2BzhNfxaHmCqJzjU3iWAJgHjJAp2YBxPFGXIy7B8o18UEhc1MCc7FW7Ge4qv kzZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ct0PY0BJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si13584197pjt.122.2021.10.02.06.24.27; Sat, 02 Oct 2021 06:24:41 -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=@gmail.com header.s=20210112 header.b=ct0PY0BJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233321AbhJBNWr (ORCPT + 99 others); Sat, 2 Oct 2021 09:22:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233285AbhJBNWo (ORCPT ); Sat, 2 Oct 2021 09:22:44 -0400 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EEFDC0613EC; Sat, 2 Oct 2021 06:20:58 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id s69so15162395oie.13; Sat, 02 Oct 2021 06:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=AvliCJIc2kXc9rCZcDMuJsQ1OOymjbvJDawg6aDGvpU=; b=ct0PY0BJOqq6ibgSoWa6uZPp8iNPbFlIHqHICjo4CJppBNBniLJTKqxLMI3MNdheCY FQ3ARQ9uWe3L9Jn3I3CWc6pf+qDm6FweD9iwEWz7KUf/sa7LXVRrQ+Mn7l9OmvFxZkrg WYc/SUNorKfh4t0CcEprS+t4IJvijUZIsCxHIzC32gvVUuUhJy+x4nQXrZA+DLJ4cW1N dsJbAl4Waanoj5QhjUjGNwexm/3BNvBB3Qp0/0jPQNOVRmRVudKK/SMpJDnMT5B4haGI ZoN2hXxj08UuuC0PZ7BsNiU+TGYNandqZYAn+bOB6gqJb+OZtTIKfCZYMekXzaY7sJxt JzCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=AvliCJIc2kXc9rCZcDMuJsQ1OOymjbvJDawg6aDGvpU=; b=a+aS09hq9emoME623gBLhNrgcNuF+cm0Gd0YSJ2q6LWNq9xFcxQzzhYDlNyZLhfbhG N/UjTEmmfxODYS4jltkTt+rMXTB/Jhi5tLADmoDum9nupFEwB730hF/JzY/9BjCKkozE vzXYKIq3Ez19nVoGVvPmPFdQfY+fhWa+v0PvnidVnZxYcT86BoCs8O1EZ+pAdwsGi5/i ECEwsyutQiWblYOsxmkx1EyKeZXdDBIWFp/jn3c9zz9jQAD4aaWkuLDbiEir2B+0OgKn mPwRfKgfKrzFwUcKVKyuf89ER/toBkI8Rr2usKeYZrQADjKCYkhv29bkBtUIB10xaZxn xpfw== X-Gm-Message-State: AOAM5304obXdzziZdIpHHO2SNTItXV8xVZKLbIE0txSK1fr/YH5/bCzv HFSqJmOcgGMDxYdG6PNdULGMwjb7M6M= X-Received: by 2002:a05:6808:f03:: with SMTP id m3mr7767972oiw.23.1633180858028; Sat, 02 Oct 2021 06:20:58 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h5sm1706619oti.58.2021.10.02.06.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 06:20:57 -0700 (PDT) Sender: Guenter Roeck Date: Sat, 2 Oct 2021 06:20:55 -0700 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: sp5100_tco: Add support for get_timeleft Message-ID: <20211002132055.GA4023280@roeck-us.net> References: <20210928065735.548966-1-linux@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210928065735.548966-1-linux@weissschuh.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 08:57:35AM +0200, Thomas Weißschuh wrote: > Tested on a Gigabyte X570 I AORUS PRO WIFI. > > Signed-off-by: Thomas Weißschuh Reviewed-by: Guenter Roeck > --- > drivers/watchdog/sp5100_tco.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c > index a730ecbf78cd..dd9a744f82f8 100644 > --- a/drivers/watchdog/sp5100_tco.c > +++ b/drivers/watchdog/sp5100_tco.c > @@ -10,6 +10,7 @@ > * https://www.kernelconcepts.de > * > * See AMD Publication 43009 "AMD SB700/710/750 Register Reference Guide", > + * AMD Publication 44413 "AMD SP5100 Register Reference Guide" > * AMD Publication 45482 "AMD SB800-Series Southbridges Register > * Reference Guide" > * AMD Publication 48751 "BIOS and Kernel Developer’s Guide (BKDG) > @@ -144,6 +145,13 @@ static int tco_timer_set_timeout(struct watchdog_device *wdd, > return 0; > } > > +static unsigned int tco_timer_get_timeleft(struct watchdog_device *wdd) > +{ > + struct sp5100_tco *tco = watchdog_get_drvdata(wdd); > + > + return readl(SP5100_WDT_COUNT(tco->tcobase)); > +} > + > static u8 sp5100_tco_read_pm_reg8(u8 index) > { > outb(index, SP5100_IO_PM_INDEX_REG); > @@ -386,6 +394,7 @@ static const struct watchdog_ops sp5100_tco_wdt_ops = { > .stop = tco_timer_stop, > .ping = tco_timer_ping, > .set_timeout = tco_timer_set_timeout, > + .get_timeleft = tco_timer_get_timeleft, > }; > > static int sp5100_tco_probe(struct platform_device *pdev) > > base-commit: 41e73feb1024929e75eaf2f7cd93f35a3feb331b > -- > 2.33.0 >