From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham 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 6EC28C43381 for ; Mon, 25 Mar 2019 22:32:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2110520830 for ; Mon, 25 Mar 2019 22:32:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WC3Y0n5b"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FZMtdq3z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2110520830 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZJ+Qa9JR5a2wigAgPjifc9kxmlWevU52jFcnwyIUXA4=; b=WC3Y0n5bjUWx5n 0vvt9rdbKJpzYDo1TE6eVBMV8TegusoB0P9D3gsZX7KbVtptfx14VC+2UdootdHTQiLwPICA7Czvg C5W+p0tb4sqBUOLer4evwwe2QJBV1xNutN2zqd8ptqNPPw9ruHFuZYlodXU+sU+SCsqhkxgRtM+mL Rn2hQGJKXfU+Xmrrc6poYbMM7ZCYrUdisNuhDTxlJvOLmvVIjmLr+zIHRBv3bsSRenooMc/II1pl9 DiMB8Vbqp2VVW+QlgaYodSlC6m3kC8tTK3u3PfRszN2TqWg/YyoY1wjSpTYPTX8aPSRHGUl4Ts74l uWz+2kRBMrS4HGn042aA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Y8j-0005bq-0A; Mon, 25 Mar 2019 22:32:21 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Y7c-0004Cu-1x for linux-arm-kernel@bombadil.infradead.org; Mon, 25 Mar 2019 22:31:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=g2av8ZSkN0Dh2FKlqsdplMDjCAsorfWjkZgIqBPcZWU=; b=FZMtdq3zB55wPC9GOn7lxTDsvL IOHOjRLq7TPhq8LoAp6ugtasxBUgoY+UQdcWOiPEPw1i8ASRV/lgN0eiWFg5oiXaI6jRZEze3Mrvk zX37cPTll6HDiCRdLdsJkxPDsxPpQDB5gJz8VJ/XH+SPwIBGKfSWWSE8stg7KGi9Cub9YJqcKb5p0 dNVJeE1fbaCm4/If8HL/Pyum2nf7VAtqJTz5I8cFkRr37wGAnANafPiGQNJaMEOXbjQFHK9eNk4K9 SdClOdNqaQ0ZsLdlqjI8653Ot8bojetpOruQLT6FmPb5QLaZM+2R/UxfpzzQAPmUJUsqoF7hEoacz KLUJagMQ==; Received: from muru.com ([72.249.23.125]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Xci-0000G1-0j for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2019 21:59:16 +0000 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 8869880CC; Mon, 25 Mar 2019 21:59:28 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Subject: [PATCH 08/14] bus: ti-sysc: Manage clocks for the interconnect target module in all cases Date: Mon, 25 Mar 2019 14:58:43 -0700 Message-Id: <20190325215849.13182-9-tony@atomide.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190325215849.13182-1-tony@atomide.com> References: <20190325215849.13182-1-tony@atomide.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_175916_214925_89CD3ED7 X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Tero Kristo , Dave Gerlach , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Peter Ujfalusi , Faiz Abbas , Keerthy , linux-arm-kernel@lists.infradead.org, Roger Quadros Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org We are currently not managing interconnect target module clocks in the for legacy platform data based case. This causes a problem for using the platform data based functions when dropping the platform data for the interconnect target module configuration. To avoid a situation where we need to populate the main and optional clocks also for the platform data based functions, let's just manage the clocks directly in ti-sysc driver. This means that until the interconnect target module confugration platform data is dropped our use count for clk_enable() will be 2 instead of 1. Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -783,10 +783,8 @@ static int __maybe_unused sysc_runtime_suspend(struct device *dev) if (ddata->legacy_mode) { error = sysc_runtime_suspend_legacy(dev, ddata); - if (!error) - ddata->enabled = false; - - return error; + if (error) + return error; } sysc_disable_main_clocks(ddata); @@ -809,14 +807,6 @@ static int __maybe_unused sysc_runtime_resume(struct device *dev) if (ddata->enabled) return 0; - if (ddata->legacy_mode) { - error = sysc_runtime_resume_legacy(dev, ddata); - if (!error) - ddata->enabled = true; - - return error; - } - if (sysc_opt_clks_needed(ddata)) { error = sysc_enable_opt_clocks(ddata); if (error) @@ -825,13 +815,21 @@ static int __maybe_unused sysc_runtime_resume(struct device *dev) error = sysc_enable_main_clocks(ddata); if (error) - goto err_main_clocks; + goto err_opt_clocks; + + if (ddata->legacy_mode) { + error = sysc_runtime_resume_legacy(dev, ddata); + if (error) + goto err_main_clocks; + } ddata->enabled = true; return 0; err_main_clocks: + sysc_disable_main_clocks(ddata); +err_opt_clocks: if (sysc_opt_clks_needed(ddata)) sysc_disable_opt_clocks(ddata); -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel