From patchwork Thu Nov 7 20:38:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sverdlin, Alexander" X-Patchwork-Id: 841693 Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net [185.136.64.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78903215F58 for ; Thu, 7 Nov 2024 20:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.64.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731012012; cv=none; b=umr1749gkNZLGtPmhFy7BhMcq6orSiBrtgGDZFJbhjCIGWXlf2SPgqt7Bs3BksjjAiRvAyK4WY4ZPDkU7jXVtcDEdrbsxY1quuAer3l6ET7pAdAhUYvHeBAIx67tff882uyWd19jrCmAx+/vPj8fno7l5Su8nmu4a8yLkp5RcFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731012012; c=relaxed/simple; bh=XA8ytG5Btrx5ToFaFPbZhHY197rAlWz2s8TtR+S1TQg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Y3lBU96HwEhTU0jgFE+HPVLaTzYnTygGUbKy4/xFuv246TQ9LA+P6+/6MudTteEETmcJJX7dHPqGutL5H5842joz1jZ1KHQBfGMeDJSKsusHr4RrzI9ar68e8dowX7WojwjjJmnElRKZK+JFDMCK/1Vb3g7xkqzRaxAYCM3nXno= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com; dkim=pass (2048-bit key) header.d=siemens.com header.i=alexander.sverdlin@siemens.com header.b=Ju5j/IjL; arc=none smtp.client-ip=185.136.64.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=alexander.sverdlin@siemens.com header.b="Ju5j/IjL" Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 20241107203958a498406dd204576d72 for ; Thu, 07 Nov 2024 21:39:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=alexander.sverdlin@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=fytcx9+5LjgzP3RSEwhtTB02382uHm/r8QYjk2LvJ1I=; b=Ju5j/IjLEaqnq5YEtBL02a26yzFANIXbtqkFdbDhKC34BoJm0r0UIW9aukD3hEx6o6pa3a g+Fx01hWhiAFKDgD+MZaylvOJDAZkYpvhkXbdEsC2vGx8unfips8GfaQkb2ZbFu7BM9hU1dO BJwrIcM430cz1BWYhDoPeVsOs/3sOV1ZkpSy0GAda38PC/xJRSBYKkODGqoOMTl820WjBS+B O3zd5zfcFttUuudfOQ/uBKt9nmoC9NQpH91vLnVVkR8vbZLNmVBgbgbYE6HZjuJsdc30pUIW Hwg/YxBKALGVS5MknW7GHYBexMed71J0GBgPd/nCIRzn+jMCuL2Zd3xw==; From: "A. Sverdlin" To: linux-watchdog@vger.kernel.org Cc: Alexander Sverdlin , Wim Van Sebroeck , Guenter Roeck , Judith Mendez , Vignesh Raghavendra , Tero Kristo , stable@vger.kernel.org Subject: [PATCH] watchdog: rti: of: honor timeout-sec property Date: Thu, 7 Nov 2024 21:38:28 +0100 Message-ID: <20241107203830.1068456-1-alexander.sverdlin@siemens.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-456497:519-21489:flowmailer From: Alexander Sverdlin Currently "timeout-sec" Device Tree property is being silently ignored: even though watchdog_init_timeout() is being used, the driver always passes "heartbeat" == DEFAULT_HEARTBEAT == 60 as argument. Fix this by setting struct watchdog_device::timeout to DEFAULT_HEARTBEAT and passing real module parameter value to watchdog_init_timeout() (which may now be 0 if not specified). Cc: stable@vger.kernel.org Fixes: 2d63908bdbfb ("watchdog: Add K3 RTI watchdog support") Signed-off-by: Alexander Sverdlin Reviewed-by: Guenter Roeck Reviewed-by: Vignesh Raghavendra --- drivers/watchdog/rti_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c index f410b6e39fb6f..58c9445c0f885 100644 --- a/drivers/watchdog/rti_wdt.c +++ b/drivers/watchdog/rti_wdt.c @@ -61,7 +61,7 @@ #define MAX_HW_ERROR 250 -static int heartbeat = DEFAULT_HEARTBEAT; +static int heartbeat; /* * struct to hold data for each WDT device @@ -252,6 +252,7 @@ static int rti_wdt_probe(struct platform_device *pdev) wdd->min_timeout = 1; wdd->max_hw_heartbeat_ms = (WDT_PRELOAD_MAX << WDT_PRELOAD_SHIFT) / wdt->freq * 1000; + wdd->timeout = DEFAULT_HEARTBEAT; wdd->parent = dev; watchdog_set_drvdata(wdd, wdt);