From patchwork Sat Jun 15 14:10:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LongQiang X-Patchwork-Id: 13699286 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFA79B67A for ; Sat, 15 Jun 2024 14:11:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718460705; cv=none; b=sm+MUIls/5VTb21fEOAWGlY20sXlCIWmpuDyzuqrv0WJFBitmfVtg9WZuavBrl/A1Pkdl+47uzl0KynXMYgGh4PnK+1Q5TS4cf26OleMZfuklv70rCxlMGc3acG8bIK21e7UgUaXNW3lNY7PBnu0m1uZmTUFVasCleBvP7ovH6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718460705; c=relaxed/simple; bh=ysppDQEkB6tYTT8MEXmTW3fSf1MCmntTplromX3pjaU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AAxBiNhXFBXq24SHCg85gpamrb8dCOwX/hWtC8sovUAFzYjNn7CgQ+EW/i7XzHBZPRUY3RzlAemnflzsql5xj7b1jKyr5/o6oSaElwbFME0AouNojBUqAnHpKjxhAM91HetAk2qE6GT08v5RKtIoscx0sTaDovZ6BIshApodzBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=qI3n7Y4n; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="qI3n7Y4n" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=ieKug Uq21pkO9EAjGILHNEFhB1VEmDQbP/Q7G3lCUXU=; b=qI3n7Y4ndoVNpgZKX/U5R /OouuP3zPFbxYm8UofZxX7WJSxnchNeKPRqkvMwNL4JTzWXkfFp0pPu4qa2RQSMv A8qZQlm0gIhJt9MMVIE61Y10ikvS7Vn/7p57CczvPSiOiRYXQJVAH2YupA46IiqN uZ+7mIZ1vGuLMveRDHq5EY= Received: from lq-VirtualBox.. (unknown [118.112.88.81]) by gzga-smtp-mta-g1-2 (Coremail) with SMTP id _____wDXP5b0oG1mjrqZHA--.46791S2; Sat, 15 Jun 2024 22:11:00 +0800 (CST) From: LongQiang To: wim@linux-watchdog.org Cc: linux@roeck-us.net, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-watchdog@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, LongQiang Subject: [PATCH] watchdog: imx2_wdg: Save the actual timeout value Date: Sat, 15 Jun 2024 22:10:59 +0800 Message-ID: <20240615141059.345076-1-lqking7735@163.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wDXP5b0oG1mjrqZHA--.46791S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xr4DuFWrXw1rCFyfGFyDJrb_yoW3Grg_Cr 97tw42grs8Gr1IyF45Xw17Ary0gF1UW3WxZa1IgFWfu3srA3y5G3yqg34kZF1Uua18tr98 Ar4kXr4FkF97CjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRNZXo7UUUUU== X-CM-SenderInfo: potnx0zjxxjki6rwjhhfrp/1tbiLBj+QGXAmf4Y7QAAs9 When setting the timeout, the effective timeout value should be saved. Otherwise, the illegal timeout will take effect at 'start'. Signed-off-by: LongQiang --- drivers/watchdog/imx2_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index 42e8ffae18dd..d4a4d4c58c3f 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c @@ -196,7 +196,7 @@ static int imx2_wdt_set_timeout(struct watchdog_device *wdog, actual = min(new_timeout, IMX2_WDT_MAX_TIME); __imx2_wdt_set_timeout(wdog, actual); - wdog->timeout = new_timeout; + wdog->timeout = actual; return 0; }