Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2178728rwb; Sat, 24 Sep 2022 04:28:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7gKygAPhGKvMK+0JGDx60d4xkRhiFw5K/XZ5LxznwUVSS7zhFxmy9rKWeTdSJ0T/jtXzpX X-Received: by 2002:a17:902:e80c:b0:178:4b57:2d1f with SMTP id u12-20020a170902e80c00b001784b572d1fmr12739611plg.26.1664018897814; Sat, 24 Sep 2022 04:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664018897; cv=none; d=google.com; s=arc-20160816; b=WyTD20t8qiBDrhOdN01TKEDVcrp9gREkR1LfJacUPzwURaY1xIL7p6GtoUvQLqMOwC i0Z2lpXO3jwYN2bNV/R5TOyf4SekcPkpwziFGTOSEo+DNl21M1xgD2tFpehoX58OIVL5 Rb2aIAy0gRBX73ycxDmugD8jolS5I6g+RXGdbdP0Fgv/N04lecDyOdmOZ1fr+6tYIwNG SNXdH7FyoqzTpfDkzigl1B8VDPeZERjPeMK2MgojCw4bQN51nvN9A0PWm2RhMc/T/6UE AFOtqUpwCYEY9UN5Nrhc/hPtIXdgxL0yWvpIFKNp+5HPyCO9Ze8JUSTuAd0e/AEul1qe mVow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YWi9yOkmw6Pg64BaHXzS1gw52SYrbUk96RtvrZkYtWM=; b=WH5A4ZpMnM7tMjVYlwr6ryFh/+rp8XBg7PgKyPSava9uYjtmuregFIFBPpe0l886mz eCz3jlFtk75+TCX81cwZJPf90tQfgEZQjPju3L3t3dUH9XTB5Y/Pa2QH+YZ5i4XJaQRe 2ZllcOmh26r7HtpDwPmYK4stRtM7eXbDfd2zaWHtVbkQ3AFpR2EBFiXbLkwR26Ea5nkY 5T3yULfcAmPQKfn5Qxu6SX37RRa/qBUViRnFdm+5CCoQ710j9SJun6tjZDxc58VV0tk2 h82D7+UwNGJFzWjlZIesfhGKLZsipZ6xcgE31JuaOETH3ACggnr4JO3bq+ozc3HAnqGJ l+ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=atP3qtEX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a170902da8500b00172bb36712fsi6922798plx.514.2022.09.24.04.27.59; Sat, 24 Sep 2022 04:28:17 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=atP3qtEX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233363AbiIXKvx (ORCPT + 99 others); Sat, 24 Sep 2022 06:51:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233342AbiIXKvu (ORCPT ); Sat, 24 Sep 2022 06:51:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 880E4248DC; Sat, 24 Sep 2022 03:51:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1D2D260C07; Sat, 24 Sep 2022 10:51:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57490C433C1; Sat, 24 Sep 2022 10:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664016708; bh=fJw46oiVDsrdRUBDbHBnpknkTEoz2vA2Oe6A+Tlnjhk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=atP3qtEXWF7U0jZKg8roHJOnr5mgJ+ewNB562GRr67Wd7dns9IN42+x2ZzETWkozY ZklGsW3HNtp5QuzmXHQiGeTK2iZ0ywknqm7O9ebdIr5K5JI8jn1YWRhmVu133XJwsB Njzkt2oCP27oE/PDsZemtuT18FFhY8Q78njbrbxgB141gVVoGUVt8lJPLzdviwuJ31 BBflbYJ/sy6zJ4Mey/x4CR7uFn3drs3XD5byCtjtdk1ROJKNqVb/YDzAPKFH6auZOJ rZtW1MQKaA/ZgATf98wqD5jIl+wfyQLNN8Z//9QZlH3kX6a+iy25hnyxRM2YDXYQq5 Isa9jSo1kn3IA== Received: by pali.im (Postfix) id EDE888A2; Sat, 24 Sep 2022 12:51:45 +0200 (CEST) Date: Sat, 24 Sep 2022 12:51:45 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Marek =?utf-8?B?QmVow7pu?= , Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] watchdog: armada_37xx_wdt: Fix .set_timeout callback Message-ID: <20220924105145.spzn32xvz6mvyksi@pali> References: <20220726085612.10672-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220726085612.10672-1-pali@kernel.org> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 PING? On Tuesday 26 July 2022 10:56:12 Pali Rohár wrote: > ioctl(WDIOC_SETTIMEOUT) calls .set_timeout and .ping callbacks and it is > expected that it changes current watchdog timeout. > > armada_37xx_wdt's .ping callback just reping counter 0 and does not touch > counter 1 used for timeout. So it is needed to set counter 1 to the new > value in .set_timeout callback to ensure ioctl(WDIOC_SETTIMEOUT) > functionality. Fix it. > > Fixes: 54e3d9b518c8 ("watchdog: Add support for Armada 37xx CPU watchdog") > Signed-off-by: Pali Rohár > --- > drivers/watchdog/armada_37xx_wdt.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/watchdog/armada_37xx_wdt.c b/drivers/watchdog/armada_37xx_wdt.c > index 1635f421ef2c..b84cba94b135 100644 > --- a/drivers/watchdog/armada_37xx_wdt.c > +++ b/drivers/watchdog/armada_37xx_wdt.c > @@ -179,6 +179,8 @@ static int armada_37xx_wdt_set_timeout(struct watchdog_device *wdt, > dev->timeout = (u64)dev->clk_rate * timeout; > do_div(dev->timeout, CNTR_CTRL_PRESCALE_MIN); > > + set_counter_value(dev, CNTR_ID_WDOG, dev->timeout); > + > return 0; > } > > -- > 2.20.1 >