From patchwork Fri Mar 2 09:23:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10253905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C8DBB6037F for ; Fri, 2 Mar 2018 09:25:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C29DD288FD for ; Fri, 2 Mar 2018 09:25:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5AFC28926; Fri, 2 Mar 2018 09:25:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A80B288FD for ; Fri, 2 Mar 2018 09:25:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425405AbeCBJZ1 (ORCPT ); Fri, 2 Mar 2018 04:25:27 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:49718 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425671AbeCBJYn (ORCPT ); Fri, 2 Mar 2018 04:24:43 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BDBE4607E5; Fri, 2 Mar 2018 09:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519982682; bh=5/cXsOp1ybsxzlX/Er92YhpZfQSfwGHIUmqvy+35+hw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o3a1n0/gleQJG4AOi4wOeWqmXYEVSB12PtXRUM/vc8B3rLu0fGZp7G4jmAoA/FyLT Ps6igmvBFGXNjPRKKrF8vsk8xcJhNKqzyinvKFFfpeekXwI3CMzsaBQ51Ewe0Ds20M RmianWt/DCDJ11S49fcVhBGRZ0E4HuGvb7pClR7I= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1EB06607EF; Fri, 2 Mar 2018 09:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519982682; bh=5/cXsOp1ybsxzlX/Er92YhpZfQSfwGHIUmqvy+35+hw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o3a1n0/gleQJG4AOi4wOeWqmXYEVSB12PtXRUM/vc8B3rLu0fGZp7G4jmAoA/FyLT Ps6igmvBFGXNjPRKKrF8vsk8xcJhNKqzyinvKFFfpeekXwI3CMzsaBQ51Ewe0Ds20M RmianWt/DCDJ11S49fcVhBGRZ0E4HuGvb7pClR7I= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1EB06607EF Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: sibis To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, sibis@codeaurora.org, georgi.djakov@linaro.org, jassisinghbrar@gmail.com, p.zabel@pengutronix.de, ohad@wizery.com, mark.rutland@arm.com, robh+dt@kernel.org, kyan@codeaurora.org, sricharan@codeaurora.org, akdwived@codeaurora.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 6/6] remoteproc: qcom: Reorder active clks enable and reset Date: Fri, 2 Mar 2018 14:53:39 +0530 Message-Id: <1519982619-28336-7-git-send-email-sibis@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519982619-28336-1-git-send-email-sibis@codeaurora.org> References: <1519982619-28336-1-git-send-email-sibis@codeaurora.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Active clks need to be enabled before Asserting/Deasserting the reset lines in SDM845 Signed-off-by: sibis --- drivers/remoteproc/qcom_q6v5_pil.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index f4997e0..cf45fe6 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -841,17 +841,18 @@ static int q6v5_start(struct rproc *rproc) dev_err(qproc->dev, "failed to enable supplies\n"); goto disable_proxy_clk; } - ret = qproc->ops->reset_start(qproc); - if (ret) { - dev_err(qproc->dev, "failed to deassert mss restart\n"); - goto disable_vdd; - } ret = q6v5_clk_enable(qproc->dev, qproc->active_clks, qproc->active_clk_count); if (ret) { dev_err(qproc->dev, "failed to enable clocks\n"); - goto assert_reset; + goto disable_vdd; + } + + ret = qproc->ops->reset_start(qproc); + if (ret) { + dev_err(qproc->dev, "failed to deassert mss restart\n"); + goto disable_active_clks; } /* Assign MBA image access in DDR to q6 */ @@ -862,7 +863,7 @@ static int q6v5_start(struct rproc *rproc) dev_err(qproc->dev, "assigning Q6 access to mba memory failed: %d\n", xfermemop_ret); - goto disable_active_clks; + goto assert_reset; } writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG); @@ -931,12 +932,12 @@ static int q6v5_start(struct rproc *rproc) "Failed to reclaim mba buffer, system may become unstable\n"); } +assert_reset: + qproc->ops->reset_stop(qproc); disable_active_clks: q6v5_clk_disable(qproc->dev, qproc->active_clks, qproc->active_clk_count); -assert_reset: - qproc->ops->reset_stop(qproc); disable_vdd: q6v5_regulator_disable(qproc, qproc->active_regs, qproc->active_reg_count);