From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:37972 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032453AbeGAQoG (ORCPT ); Sun, 1 Jul 2018 12:44:06 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sibi Sankar , Bjorn Andersson Subject: [PATCH 4.17 165/220] remoteproc: Prevent incorrect rproc state on xfer mem ownership failure Date: Sun, 1 Jul 2018 18:23:09 +0200 Message-Id: <20180701160915.163225434@linuxfoundation.org> In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: stable-owner@vger.kernel.org List-ID: 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sibi Sankar commit 2724807f7f70a6a3e67b3f6bf921cc77ed39c8a1 upstream. 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. Cc: stable@vger.kernel.org Signed-off-by: Sibi Sankar Signed-off-by: Bjorn Andersson Signed-off-by: Greg Kroah-Hartman --- drivers/remoteproc/qcom_q6v5_pil.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -761,13 +761,11 @@ static int q6v5_start(struct rproc *rpro } /* Assign MBA image access in DDR to q6 */ - xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true, - qproc->mba_phys, - qproc->mba_size); - if (xfermemop_ret) { + ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true, + qproc->mba_phys, qproc->mba_size); + 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; }