Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1914705ybk; Thu, 21 May 2020 19:31:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4632GWhvQHc5nGZaXefJFu46eRBh69Pmr56aw+Jm4TQqZt4/y6OC9j8KnqhKtizISCriB X-Received: by 2002:a17:906:8608:: with SMTP id o8mr6003652ejx.274.1590114692868; Thu, 21 May 2020 19:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590114692; cv=none; d=google.com; s=arc-20160816; b=fsHy8gvm8123LXJ5krBoGfiNDkH+yAt5ZbpjrhzhL80SGd1WzNPVEH9lPyY3OEV0OL a9IUSidgubCEbmtmbI1rH5fLraoo5JKtLh12DK5f8z8Mo0C7d+DVCxgdxgLXBCcuLp2P 9QUqXwfmtBs0nb2NZh6A4bWocTXY03Ki9AOAUYnYuzqxlZTK2J/+x3MWhPyhLjReVQd8 yokekecSmg0t4TO/aOeGZaLB1ql/6vLRxBY/ah2GlH/QUAehSF0N9FNcLCEV7hbd4tfU X28N+Azv7DToRr+8aIP5610OdoWERk+oUjzIB4WQ52iLrn7py6b2jROKvcNqaPWtMNYu eg2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=NLkh/ofIKuoU49bdJOwd8fYYP7yK+gD7WAmidkRbEsU=; b=iPEvx9QNmsr2ywJXja2T4kJXzNkyqGOo2AowsW20vLxdXx4LJ8NmbBWZ4bcE24BaMr RtOz4GrqhPi07QLMrLUqDZfCThvi4oKrxGhEea+2AT5U7B+2zXEpAC9BME7hmKAQ517M 6ny1gYaNXhWW7SRHJmMndCFxpaUbh1csM4CYRRtiPVajK8nsSrkInBxcFl2kRPBTzdYh BmSRQ3/HBrAGE1SvCGUtiCWfC83xX0O3nu9aANFQw2FFjCxO/jE4FaQ3CaDl/cao8/mK fc3e5HGoLsEV0HromS7J0Swtlg/NZoWAtIMTJhrX5SlJCx5v+2KgDk+bUMp9zyJkT/NJ +xwQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df27si175476edb.441.2020.05.21.19.31.10; Thu, 21 May 2020 19:31:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727024AbgEVC3s (ORCPT + 99 others); Thu, 21 May 2020 22:29:48 -0400 Received: from inva020.nxp.com ([92.121.34.13]:59230 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbgEVC3s (ORCPT ); Thu, 21 May 2020 22:29:48 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C74BD1A090D; Fri, 22 May 2020 04:29:46 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 662951A08FB; Fri, 22 May 2020 04:29:44 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 0E0CF402AD; Fri, 22 May 2020 10:29:40 +0800 (SGT) From: Anson Huang To: a.zummo@towertech.it, alexandre.belloni@bootlin.com, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH 1/2] rtc: snvs: Make SNVS clock always prepared Date: Fri, 22 May 2020 10:19:55 +0800 Message-Id: <1590113996-31845-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In IRQ handler, ONLY clock enable/disable is called due to clock prepare can NOT be called in interrupt context, but clock enable/disable will return failure if prepare count is 0, to fix this issue, just make SNVS clock always prepared there, the SNVS clock has no prepare function implemented, so it won't impact anything. Signed-off-by: Anson Huang --- drivers/rtc/rtc-snvs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c index 35ee08a..b9371f4 100644 --- a/drivers/rtc/rtc-snvs.c +++ b/drivers/rtc/rtc-snvs.c @@ -362,7 +362,7 @@ static int __maybe_unused snvs_rtc_suspend_noirq(struct device *dev) struct snvs_rtc_data *data = dev_get_drvdata(dev); if (data->clk) - clk_disable_unprepare(data->clk); + clk_disable(data->clk); return 0; } @@ -372,7 +372,7 @@ static int __maybe_unused snvs_rtc_resume_noirq(struct device *dev) struct snvs_rtc_data *data = dev_get_drvdata(dev); if (data->clk) - return clk_prepare_enable(data->clk); + return clk_enable(data->clk); return 0; } -- 2.7.4