Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2998289imm; Sun, 1 Jul 2018 10:01:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIPpfX+pvZU2z7H65fh8WoSB43dPeJ/66K7wacIPGjE65bUDv9ysHjEompI4uX473Fx9U65 X-Received: by 2002:a65:4a42:: with SMTP id a2-v6mr19160862pgu.367.1530464461753; Sun, 01 Jul 2018 10:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530464461; cv=none; d=google.com; s=arc-20160816; b=BDpjNemJWbG6m2YyjSu5URitxBcSU4Y1k/Q5BtZWnolCXgJ5/cLNNhqg6caKfGQ7rj H1vC1FchwSUABosl1mjX+wBPe0UQHlGW0cIFkyukreYV46/jJ8ogshH1qHWoipsmRHai aQr1EUCpZ25XNdtyHkDebRcLt3Kg8TKXgy+VGnNcof/BrHKTItI3P/nbbHpK9355SxjQ gL8975QUFAWH0ency+6ZI4wuQ6ag17bD7JgOaXrfr79Rg/6m9DpTh64Cm+5aIAXFICzt rvvrEGfERm0qGMATUV8Ofz3VHZ17UkMFu//G5tpNZyZxnX2EmkJkZ7r2+hZRW8BMYD9j NA+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=xnBLSn8in83AHZB9WNM8GXIqeBALEywhZztVx+WcfEs=; b=ivqH6XKrsPKnGTL6JH3EVQEFGtOHbIgCLLsGlG9Bde6ZWTEPuG5qTugT3DK1kXLJpN PkdSKk2L386VlsYBAHPW2caafgahCt776uGdY72sLhIqzInV7p5TRimcdgniRdrRJTQ4 d3mhC2KRpDKb7VRkrfMUW5LCgREOlTa33VsGJqHc4uWtOweqEqF+RKKjHLyQIsEtlRru PEcSOgWB9jKo42E5rICyhNmCvS2cLSVUb6s8bxneDizbf1WymdeUOt0TOkJHS4dlpaED aicSRdWFCsZxXF/ttlRNwuwy4oMZm1Xa81LlBq17KZE8+zySOzAaS2rwg2yqQAXj00MQ Ufzw== 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 i20-v6si8047656pgb.547.2018.07.01.10.00.47; Sun, 01 Jul 2018 10:01:01 -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 S933955AbeGAQ7E (ORCPT + 99 others); Sun, 1 Jul 2018 12:59:04 -0400 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 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7314CA73; Sun, 1 Jul 2018 16:44:05 +0000 (UTC) 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> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; }