From patchwork Tue Jun 16 15:33:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224318 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CA58C433E0 for ; Tue, 16 Jun 2020 16:18:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6E5320882 for ; Tue, 16 Jun 2020 16:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592324319; bh=9p4Mo042Rqy4vJYBei02Cv/NT0DA2OR0anc2hVo4VZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Gn+wuJ6zSKLKcfdpEDMsEI25nJa/+5OiwMnEfLG4GikM0F3nlU1MEHQweq2nkqzxB 8IeEol1q4VRI2Z4kq5vBG0KgoofzMDTJqeMQaERDo56nh7A7FW2sCH1i5JnULnWpHX W0cbAS88RXGnRBuFcp/AZvPwy1p9sYOD7ft2CifY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730545AbgFPPiI (ORCPT ); Tue, 16 Jun 2020 11:38:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:50226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730537AbgFPPiG (ORCPT ); Tue, 16 Jun 2020 11:38:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A644220B1F; Tue, 16 Jun 2020 15:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592321886; bh=9p4Mo042Rqy4vJYBei02Cv/NT0DA2OR0anc2hVo4VZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BgFnwfZ3KznDvVT+xcBdLJgrQLmq5EKQ0x1OCqe7rFs1VejGfOEHEdIstYNeG82PE 21imiJIh+Ji5WtyjJrNfLANaYIUnfXr4zDwjunF/m3YQd40KHMVq82uv0K0eKzcwCp fPd5/WlySpAxHmVUo6m2v6Ul5n5SFSrFOgpClK9o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Breno Lima , Fabio Estevam , Guenter Roeck , Wim Van Sebroeck Subject: [PATCH 5.4 054/134] watchdog: imx_sc_wdt: Fix reboot on crash Date: Tue, 16 Jun 2020 17:33:58 +0200 Message-Id: <20200616153103.360499214@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153100.633279950@linuxfoundation.org> References: <20200616153100.633279950@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Fabio Estevam commit e56d48e92b1017b6a8dbe64923a889283733fd96 upstream. Currently when running the samples/watchdog/watchdog-simple.c application and forcing a kernel crash by doing: # ./watchdog-simple & # echo c > /proc/sysrq-trigger The system does not reboot as expected. Fix it by calling imx_sc_wdt_set_timeout() to configure the i.MX8QXP watchdog with a proper timeout. Cc: Fixes: 986857acbc9a ("watchdog: imx_sc: Add i.MX system controller watchdog support") Reported-by: Breno Lima Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck Tested-by: Breno Lima Link: https://lore.kernel.org/r/20200412230122.5601-1-festevam@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/imx_sc_wdt.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/watchdog/imx_sc_wdt.c +++ b/drivers/watchdog/imx_sc_wdt.c @@ -177,6 +177,11 @@ static int imx_sc_wdt_probe(struct platf wdog->timeout = DEFAULT_TIMEOUT; watchdog_init_timeout(wdog, 0, dev); + + ret = imx_sc_wdt_set_timeout(wdog, wdog->timeout); + if (ret) + return ret; + watchdog_stop_on_reboot(wdog); watchdog_stop_on_unregister(wdog);