Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3850233pxv; Mon, 19 Jul 2021 10:13:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyakRoZekVDzSIkfWoPNZ/hY81QcPSbTieKGhspAhipnRqiSp/KRqbEajm/44BStCpc1obZ X-Received: by 2002:a92:a00e:: with SMTP id e14mr17840456ili.126.1626714792074; Mon, 19 Jul 2021 10:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626714792; cv=none; d=google.com; s=arc-20160816; b=X6KmXBxnkCibcGxG9+bjnwkx6FDSNHbhbovwxaPQzRU3jckWZDpA0FypEBbDL95b52 v+1gRcjwrrxW6HRtK/K+WN2k48mObudELaKKLNUTkwvOfuvJi6zAyzEM9+P3fXloskvg kmb2lmeEKNRyfYGYiy2zkpUS7sOXIw22Zd8t6PeNl0QyJYdJWMoeXSRUVfp0r2ClUjmf CcwzZHpMK/N5heaDomZ5bqBJ/H63qWYK2SaIM49RBpkqTvqB+0H1sewB/pkvMftdq7q0 vqLjsD+u5JL444f7gFh9vwnilwM0bQYw1tXf024+2rs5LiYB1K6UpBeFozqlxIOy9tXp rZPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H2Uub+zXqcRpYhBp8fmquyqyHV6cZupuI0Wf/CP6SD4=; b=se0GihMEerCpuTXcCxgXKYJbFaLnOSBpgw6WmxnPBAsV0DNSkQ5qq2GBFgO7zU1mc2 A89CP2YDC5oCwt4aYXL37w8jwQpEsr4Y/dXmaRXy1MomOkHvrS+mBQDWDP5EAcDAf5Ee BD6l/10wPJQemmnERu41ttF85CgMzqF85uguFpqAU/XzaMdMzEt73MMpQQ7TpgeTbA83 S2HA/+X8DOIlMmZAmp8KkbDpBSfN7Ldu6nMrC+xJNSg3Eodnp8rTar83tq7vuiGzywgr epSLoiElYhCWMucTFIx03XaUIkgZLyCn+8Vs8my9WLDeoEnbNnBcVyO96st0DxBWLiAx QcAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="rATNQAP/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si10951386jaf.48.2021.07.19.10.12.59; Mon, 19 Jul 2021 10:13:12 -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=@linuxfoundation.org header.s=korg header.b="rATNQAP/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351138AbhGSQbn (ORCPT + 99 others); Mon, 19 Jul 2021 12:31:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:56908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347437AbhGSPQV (ORCPT ); Mon, 19 Jul 2021 11:16:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D34861248; Mon, 19 Jul 2021 15:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710219; bh=szqNDRpSbTtzUOoilzlCi13S2opHe+4em96fXDSRtdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rATNQAP/DTfXPw7EV+ss6v20si4Ywm56jkh/oOzFO772z0y0WkvvaIuylCldmAnUL Hw0NhXp6i/eIPmo9q20OwKakL1CsEUuz/u2dj0KDteYGE1dzZKKfE2XMvaPr+DYnBJ /tk+heYlcbVO6DcfviX6W8mb4XOrhu08Tc8uLQ/Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Eichenberger , Guenter Roeck , Dong Aisheng , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 5.10 126/243] watchdog: imx_sc_wdt: fix pretimeout Date: Mon, 19 Jul 2021 16:52:35 +0200 Message-Id: <20210719144944.975192847@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Eichenberger [ Upstream commit 854478a381078ee86ae2a7908a934b1ded399130 ] If the WDIOF_PRETIMEOUT flag is not set when registering the device the driver will not show the sysfs entries or register the default governor. By moving the registering after the decision whether pretimeout is supported this gets fixed. Signed-off-by: Stefan Eichenberger Reviewed-by: Guenter Roeck Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/20210519080311.142928-1-eichest@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/imx_sc_wdt.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c index e9ee22a7cb45..8ac021748d16 100644 --- a/drivers/watchdog/imx_sc_wdt.c +++ b/drivers/watchdog/imx_sc_wdt.c @@ -183,16 +183,12 @@ static int imx_sc_wdt_probe(struct platform_device *pdev) watchdog_stop_on_reboot(wdog); watchdog_stop_on_unregister(wdog); - ret = devm_watchdog_register_device(dev, wdog); - if (ret) - return ret; - ret = imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG, SC_IRQ_WDOG, true); if (ret) { dev_warn(dev, "Enable irq failed, pretimeout NOT supported\n"); - return 0; + goto register_device; } imx_sc_wdd->wdt_notifier.notifier_call = imx_sc_wdt_notify; @@ -203,7 +199,7 @@ static int imx_sc_wdt_probe(struct platform_device *pdev) false); dev_warn(dev, "Register irq notifier failed, pretimeout NOT supported\n"); - return 0; + goto register_device; } ret = devm_add_action_or_reset(dev, imx_sc_wdt_action, @@ -213,7 +209,8 @@ static int imx_sc_wdt_probe(struct platform_device *pdev) else dev_warn(dev, "Add action failed, pretimeout NOT supported\n"); - return 0; +register_device: + return devm_watchdog_register_device(dev, wdog); } static int __maybe_unused imx_sc_wdt_suspend(struct device *dev) -- 2.30.2