Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7391572ybp; Wed, 16 Oct 2019 08:02:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzs3/sV/iYPnW3uSPsteTXgHI6L+GIPTXOKJ/BbMXnHQBw8RRMMD3+ixXXmScWJmH0uIhjK X-Received: by 2002:a05:6402:2025:: with SMTP id ay5mr39925387edb.93.1571238120156; Wed, 16 Oct 2019 08:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571238120; cv=none; d=google.com; s=arc-20160816; b=cGUWQVLWdVgXms319l9wUjoFcRc30r6Sx07Edqm5GXvDFT3b+4bySw+CRQi+fbEd2Y LYdo5wv8UnkULc5pr6MunPipmAYYhujpbQzcD3BB+tfdMgDKgCDbJqzd5T4vMqoiWeXn 9SCIfSD6GXLZSIXhn3+W7Db/dxhec1zZuZ3BbVbvPfr8JifOyz/uskzfcJ7FhTgEUQ/A r1TRfRuyAAz4sN4t6L7/2ugW2pxtrdh0hCh1RQbpkEJOyWZw57YES6SVzqLcsoHfKOfA Y+53Qiz3KPDHbYxGQoY83mKknN83VWTixUjckDHFkJLTE+1zTpq7vOJMeL42gb91h7BX btYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=d5EQOtzuUYkFCWr6rz+/WO6CHlKa1jSIAow555uxKYo=; b=v5pZze0ijAkk5BxlMSgchdvNbWOYGfVkPadGSpptXHsXTsWAsTag2Ebq+/8jx8HlyP zS+KqghjK61x5YQEs9LJ7tZ7DgEHU6NZhe3/TmTANt4pHleyG31MyPZ1ypCX17IPDJ+Q q8MF8JjLRaFaU+Se1I1nOXUjKioiEOvE0WMceTAQ2L/0zYL2Y+oAX5aJOAMiJ4T95zE2 Xx5TBoAG/anN7/xXwrxGgX4TLa+/cIWY+F/WPF3p42pf3n7C+ESfcXe5RO7BA/rMnhP/ FOdFmJknhcPlw1OAmnFPu/e9s313sMF3/pErn7kVdZSXkd0vO2QWIfdU4nE7oXcnKoDy X7Mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d32si18926738eda.266.2019.10.16.08.01.36; Wed, 16 Oct 2019 08:01:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403850AbfJPLXd (ORCPT + 99 others); Wed, 16 Oct 2019 07:23:33 -0400 Received: from mx1.unisoc.com ([222.66.158.135]:23338 "EHLO SHSQR01.unisoc.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403823AbfJPLXd (ORCPT ); Wed, 16 Oct 2019 07:23:33 -0400 X-Greylist: delayed 2254 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Oct 2019 07:23:30 EDT Received: from SHSQR01.spreadtrum.com (localhost [127.0.0.2] (may be forged)) by SHSQR01.unisoc.com with ESMTP id x9GAjkpG035605; Wed, 16 Oct 2019 18:45:46 +0800 (CST) (envelope-from Chunyan.Zhang@unisoc.com) Received: from ig2.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by SHSQR01.spreadtrum.com with ESMTPS id x9GAi8PG033493 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Wed, 16 Oct 2019 18:44:09 +0800 (CST) (envelope-from Chunyan.Zhang@unisoc.com) Received: from localhost (10.0.93.106) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Wed, 16 Oct 2019 18:44:17 +0800 From: Chunyan Zhang To: Stephen Boyd CC: , , Orson Zhai , Baolin Wang , Xiaolong Zhang , Chunyan Zhang Subject: [PATCH] clk: sprd: change to implement .prepare instead of .enable Date: Wed, 16 Oct 2019 18:44:14 +0800 Message-ID: <1571222654-12315-1-git-send-email-chunyan.zhang@unisoc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.93.106] X-ClientProxiedBy: shcas04.spreadtrum.com (10.29.35.89) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com x9GAi8PG033493 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiaolong Zhang Some pll_sc_gate clocks need to wait a certain long time for being stable after enabled, for this reason enabling this kind of clocks shouldn't be done in clk_ops.enable() which would be called at interrupt context. So we move the operation to .prepare(), and also hooks to .unprepare() with disabling pll_sc_gate clocks. Signed-off-by: Xiaolong Zhang Signed-off-by: Chunyan Zhang --- drivers/clk/sprd/gate.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/clk/sprd/gate.c b/drivers/clk/sprd/gate.c index 1491c00575fa..d8b480f852f3 100644 --- a/drivers/clk/sprd/gate.c +++ b/drivers/clk/sprd/gate.c @@ -80,7 +80,7 @@ static int sprd_sc_gate_enable(struct clk_hw *hw) return 0; } -static int sprd_pll_sc_gate_enable(struct clk_hw *hw) +static int sprd_pll_sc_gate_prepare(struct clk_hw *hw) { struct sprd_gate *sg = hw_to_sprd_gate(hw); @@ -120,9 +120,11 @@ const struct clk_ops sprd_sc_gate_ops = { }; EXPORT_SYMBOL_GPL(sprd_sc_gate_ops); +#define sprd_pll_sc_gate_unprepare sprd_sc_gate_disable + const struct clk_ops sprd_pll_sc_gate_ops = { - .disable = sprd_sc_gate_disable, - .enable = sprd_pll_sc_gate_enable, + .unprepare = sprd_pll_sc_gate_unprepare, + .prepare = sprd_pll_sc_gate_prepare, .is_enabled = sprd_gate_is_enabled, }; EXPORT_SYMBOL_GPL(sprd_pll_sc_gate_ops); -- 2.20.1