From patchwork Tue Apr 17 19:44:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10346739 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 6C02E601D7 for ; Tue, 17 Apr 2018 19:44:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5547F26CF9 for ; Tue, 17 Apr 2018 19:44:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46A8526CFC; Tue, 17 Apr 2018 19:44:32 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 9FF1A24B44 for ; Tue, 17 Apr 2018 19:44:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbeDQTob (ORCPT ); Tue, 17 Apr 2018 15:44:31 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58654 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeDQToa (ORCPT ); Tue, 17 Apr 2018 15:44:30 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3EBA16071A; Tue, 17 Apr 2018 19:44:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523994270; bh=GkHeE0CEQZX9QgRbGkG/evP0uW1o9flgc7BKciUWj0k=; h=From:To:Cc:Subject:Date:From; b=LWbXXyhIz20gDFViD1HRfZjRAPmSCQkQ9mXwv24Kqw6qHAvZTgFiWNpxy8VOoyYZE B4kG3mU9OX2AtGA6KYBysPNyEMwLmkrXwEN4F2CH2yAcMPtHVYy0CzKt0Z9XsC9Jtc vrQ8pY1h61FERSiw49lBHMXkjslwh26Eal9JURwY= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8E81760600; Tue, 17 Apr 2018 19:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523994269; bh=GkHeE0CEQZX9QgRbGkG/evP0uW1o9flgc7BKciUWj0k=; h=From:To:Cc:Subject:Date:From; b=fzOaPiW0tb7vqHl6QZPCOO7fivLU25eYdj5LOwMd9WVRjmTRTdn7eWoaB0MsbwAtr FqBhmxSsmazkdyQBKEHc5bJu6dRhDa9zL1KAbKGi5dCYKGTSBeILOgLSRuk6kg6eJQ UxenAfdUjxKo4saNS5D471biQQCPzUZ0BBtrveDM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8E81760600 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: Sibi Sankar To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, ohad@wizery.com, linux-arm-msm@vger.kernel.org, Sibi Sankar Subject: [PATCH] remoteproc: Prevent incorrect rproc state on xfer mem ownership failure Date: Wed, 18 Apr 2018 01:14:15 +0530 Message-Id: <20180417194415.5155-1-sibis@codeaurora.org> X-Mailer: git-send-email 2.17.0 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 Any failure in the secure call for transferring mem ownership of mba region to Q6 would result in reporting that the remoteproc device is running. This is because the previous q6v5_clk_enable would have been a success. Prevent this by updating variable 'ret' accordingly. Signed-off-by: Sibi Sankar --- drivers/remoteproc/qcom_q6v5_pil.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 8e70a627e0bb..296eb3f8b551 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -761,13 +761,12 @@ static int q6v5_start(struct rproc *rproc) } /* Assign MBA image access in DDR to q6 */ - xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true, + ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true, qproc->mba_phys, qproc->mba_size); - if (xfermemop_ret) { + if (ret) { dev_err(qproc->dev, - "assigning Q6 access to mba memory failed: %d\n", - xfermemop_ret); + "assigning Q6 access to mba memory failed: %d\n", ret); goto disable_active_clks; }