From patchwork Wed Dec 2 11:13:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 335981 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp939890ilb; Wed, 2 Dec 2020 03:14:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9WP5Xulnsgxlmk+k48hlHFcru5DMlHE5eS4Zcsr7j4LBKrBCUnRIrEgu85b5pmNGkPpLi X-Received: by 2002:a17:906:7fcd:: with SMTP id r13mr1838785ejs.242.1606907690740; Wed, 02 Dec 2020 03:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606907690; cv=none; d=google.com; s=arc-20160816; b=1I36HowsY8n/3IXw/PjxizZ6WDOXOvcQMg/k4L/zji2PAiLbE3v3YfER4Cmr/f96ij 90FbLeC4HSlTBt35/kOYfYfdzNb47W0FO0C+TuqrCSnvdkug+JDGeu8c8NKlnFLE8+Eu PYm4imNL9xhEN6NHqX8y07Z+nW/SYuvLl3qDnzidQVUVk94AqIuzz8xx5oYeiiYRt8bt ytsYQoZLEDD8yrAP5e3WyJAYdEs6AVaijXbeb0MYDMgfKBrjn8QLcttzzj4aPkhzUWd0 IIbtcF66roBsSA7fscZefR+Ed/ycGi/3JaL4LBH2WHS8mgHv9ew0HOnFvn8uM61LP0iE tmWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:message-id:date:subject:cc :to:from:dkim-signature:dkim-filter; bh=xmrBZT9PAblDAQ4lFT7oqHGPc2pHJzj/SjrNxGbO85o=; b=y74ZchHFbWkD0YICurN/pt41tjfBNSUgDxpVdJdLnLWN4CHhiHXIWAxj2DbjjZC3aQ 8aKsVR/mzNmpIkStP3IQk3eHmXUSsqfeN0a7LcJv582QxoKWJvlko8vxhlFYLp1AGB8W y/qViKCNur2jRmaJZED92Y1IZopzgVe6dpn1WZSvPaIjbw7Usph63t+Nw+5jKZxW8gnY N1ZAg0F+UAliRodjgIyi72TRjA/NciYZLx7OuDSbwCCelxp2PpUfrm2CuCqlwdgf0lJQ VQloI8hsxKqnVu069RIQok5v7YR+lqornPGXuCCkbeJTJjlkMvSCHGl19uVsv7nJvTAB Ol8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=c78T2JiN; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si676544ejn.255.2020.12.02.03.14.50; Wed, 02 Dec 2020 03:14:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@samsung.com header.s=mail20170921 header.b=c78T2JiN; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729603AbgLBLOW (ORCPT + 4 others); Wed, 2 Dec 2020 06:14:22 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:34356 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbgLBLOV (ORCPT ); Wed, 2 Dec 2020 06:14:21 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201202111329euoutp019338554986b6a2ebb96bfa771cc97195~M4fTyaONs2923429234euoutp01A for ; Wed, 2 Dec 2020 11:13:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201202111329euoutp019338554986b6a2ebb96bfa771cc97195~M4fTyaONs2923429234euoutp01A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1606907609; bh=xmrBZT9PAblDAQ4lFT7oqHGPc2pHJzj/SjrNxGbO85o=; h=From:To:Cc:Subject:Date:References:From; b=c78T2JiNgVXlt/On6oMh/7Vdk7Kd5/2deSUihPynogf4cX5fTmvL9qyv3uM+76NB7 4Al44U5/1mxetbom8NS62fZ3jTB8egcRN4CRPPDNjXr5osXPd7PInWT0EV7H+nT9wW v1wq2alYNWmqAiT6FnJ+5O5JJMrpcAtP46w8fFW8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201202111328eucas1p178dd8a6f2d433b5e7c97923ddc1d232e~M4fTV_Wa40216502165eucas1p1j; Wed, 2 Dec 2020 11:13:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 3D.56.27958.8D677CF5; Wed, 2 Dec 2020 11:13:28 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201202111328eucas1p25b7a68b4fe94addf6088cc3ad4bedcf1~M4fS0nBfc2390323903eucas1p2h; Wed, 2 Dec 2020 11:13:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201202111328eusmtrp28d714f322085be8fb44a35e60d742960~M4fSz3ntr2916129161eusmtrp27; Wed, 2 Dec 2020 11:13:28 +0000 (GMT) X-AuditID: cbfec7f2-efdff70000006d36-20-5fc776d8faf0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 08.8C.16282.7D677CF5; Wed, 2 Dec 2020 11:13:28 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201202111327eusmtip1c96926d5adc1fe6c3e8f721c59434203~M4fSUNQt71371613716eusmtip1T; Wed, 2 Dec 2020 11:13:27 +0000 (GMT) From: Marek Szyprowski To: linux-rtc@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Alexandre Belloni , Alessandro Zummo , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 1/2] rtc: s3c: Disable all enable (RTC, tick) bits in the probe Date: Wed, 2 Dec 2020 12:13:17 +0100 Message-Id: <20201202111318.5353-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0hTYRjmO+d4zlFaHDdjX2YGkmlWWwuNSRYWUkuCrJCkkrXawSSdtTm1 pDINLyPDylvLTLqYTJc11Myi5tKpCbOlecEZXsAi2zTtpq2Vp1P273mfy/e8vHwkyh3GvMl4 RTKtVMgS/HAPrME8a1nXn9ImXV9UFSC+Y31DiHMclYT4YWmtm7ir6wEhNlf34OLSrmeIWN8y RIQTkvKadIlBl4dLLtXpgKSkfBaRzBh8o9wOeITJ6YT4FFop3HLY49hH+0vkRBmR5nw7CzKA 000DSBJSwfCCPlYDPEguVQXg09lKjB0+Azg0UktogPv8MANgZq2cwUzgdZ8NsKZ7AGo7byEL iXbjDGBcOCWCGrsGZ7AXFQ6/OO1/nkUpx3yHvgZjBB61B75ztWLMHhjlDwcH1QzNocLgiMaG sW0rYPUDI8pkIfWTgC+cJpQVIqBttAVhMQ9+aKsjWOwDfz2+ibCBLABHLHqCHS4C2J1ZCljX JmizzOFMM0qthrVNQpbeCie1dsAeZjHst3syNDoPrzSUoCzNgbnZXNa9Cmrb7i/UNr96/Xc1 Ccy99ujv5WLhgF5HFABf7f+uCg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LEnNTk0tSC2C6WPi4JRqYOrP XiJfHacUFLnzVSK76XoHxpMbXVcZsPnOFtdtVFPs3y2xM7fR9HR6Q3J4jrfa+iD3OgaOIq+m vAmfZ7g8nHXv6Z0LZ3lto7asvRAmpKq1YOnU7AORAjM3LVEwsrjqqz3z4SmVY/pFd/ycHXqq 1LtaQvQ22ShePxu6TbF5Y8bynF3rfS50qUZeFYx4b+xUkPctXeCO4CmzJeLvlfK4s6P1InJ2 3nI9xGzxe+q/b/byvNpT21t/fNn1t/FqsOBWj7O1s9bNtF4nlC2tlP/vkGrPxWPiN83/TCo7 y3/AffnL0C6GsmWKqx429CpGVHlmL7PtENnZ83xy5wb2NQuqU8Q+NLxY91Iy0vmZ8+XZSizF GYmGWsxFxYkAstkmaMkCAAA= X-CMS-MailID: 20201202111328eucas1p25b7a68b4fe94addf6088cc3ad4bedcf1 X-Msg-Generator: CA X-RootMTR: 20201202111328eucas1p25b7a68b4fe94addf6088cc3ad4bedcf1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201202111328eucas1p25b7a68b4fe94addf6088cc3ad4bedcf1 References: Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Bootloader might use RTC hardware and leave it in the enabled state. Ensure that the potentially enabled periodic tick interrupts are disabled before enabling the driver, because they might cause lockup if tick interrupt happens after disabling RTC gate clock. Signed-off-by: Marek Szyprowski --- drivers/rtc/rtc-s3c.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 24a41909f049..16a326e95d46 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -503,6 +503,10 @@ static int s3c_rtc_probe(struct platform_device *pdev) goto err_src_clk; } + /* disable RTC enable bits potentially set by the bootloader */ + if (info->data->disable) + info->data->disable(info); + /* check to see if everything is setup correctly */ if (info->data->enable) info->data->enable(info);