Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1520731ybx; Thu, 31 Oct 2019 11:49:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsiI0qZwXjbHgbir24PHoicnn7VbPH/YOg5EbPVZbMYvMi+L9ppyz35Zij1EmoQSiIRxCK X-Received: by 2002:a17:906:4b16:: with SMTP id y22mr5869284eju.56.1572547752957; Thu, 31 Oct 2019 11:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572547752; cv=none; d=google.com; s=arc-20160816; b=E8lDwqFjCvOstQt7t97+yuvK69gaHw2RRC+JKwXB38ZJ/KWsoJ6UGPwN902/dj/9qy Xr7T3N0vPDfQ8kdMICKpYgUIQOD1PPXCDwW6XU6jtgRyw9/oZFalwXqN9d0/qKFjRjo4 sQzym8U7PSPEB5jY7c552VMRhZuUPHqyWxCk+E1xW/S63lYfOXsGyhoqF/bkiRVOwwVt qutTWKR6z8L4iXb/0OjRqvtf6w17+YZ5InQU4mPPof62m2jcQAheVdZcfk34QXjZKXAh IDjcPy3bsKXQUN90/03Bfw+QcPmcOZ8+OZYqPPZAi42KPmlskyhrosI6iWSsIOBplqWx xHGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WuFs+AMjdDKhamzQV8PIhDJ9khhpt9bix4gVbxAEv5k=; b=XaWU6V/EeUcXONqTGcoishdnkFUgCfZOJ9u+MHEfzBMpc0xAWwGrA3nSvMe4t5rhww wI+LtKy1DVOI/+Vnx+APw2nqPQs00TjSTCJwIoOYiUUUBo70cdgkbd6tIKdyDMcC0lov XmsOiIrqxnUWbs93mCtfehgDkHoTWYZUfvCOc/EYjoxFgKM+LTYYOfpB5K8EvnCZ34sl mmTdv0cnrlOW6py/ZdspY+FQuipxAPwBDdSSj/DY1Waxt5KysW3+4Rxvz0LobYn1lp9J m3j2XGAseudJ7RbR8x7iruaXJ+sKM/VbUWfgxk/L+arhM86VJUUk8hA8bVFkMXhr1D0k sq4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xb5T9zfH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si4070865eja.146.2019.10.31.11.48.49; Thu, 31 Oct 2019 11:49:12 -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; dkim=pass header.i=@linaro.org header.s=google header.b=xb5T9zfH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729413AbfJaSqj (ORCPT + 99 others); Thu, 31 Oct 2019 14:46:39 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:36323 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729379AbfJaSqi (ORCPT ); Thu, 31 Oct 2019 14:46:38 -0400 Received: by mail-pl1-f194.google.com with SMTP id g9so3086293plp.3 for ; Thu, 31 Oct 2019 11:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WuFs+AMjdDKhamzQV8PIhDJ9khhpt9bix4gVbxAEv5k=; b=xb5T9zfHZejq85gO7jFd2zwpcyRjEnFCa9jXw/a1BGYBwqiwPHqwXTp9crC//hhHBa P5W8qYXn5P38liorEw8r1uSL0xAUNDvmDxyV+IVzflal+6BpyC+0RAJnGsV9zkXPiSV3 NX3O2JYP5+8nsz4MK9QAd6yQZBiDXV1dsxyAWjiOPlDrwyipQhs4yUn3P8XJnLyou9Le oaQvShGAI9coypED6Vks17iWdIGWBU2/ZB9RbsWxUc0skHGl4Q3zuT6JWaQBQBh7/W3g hVni+YYwokAHkK52tCBKlRATf5xhM3BGYzJ1whHDf8BZuN4gW5CxqdtN5W01iF31EAgG Th0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WuFs+AMjdDKhamzQV8PIhDJ9khhpt9bix4gVbxAEv5k=; b=lgFNXmfXceVfJTVjxFKY8QiFkjgDC+LCtcbhyCoOtUHOkfyVJjB4r5qqmG1m7Kn9fk 2YhWlh+hMMWCvHzCQR8b0fB6C8LPcl56MBVS8Mcm1ajBporcLMFZbuyGpORmOuNcVyhG Ppu6+4KPpdqvx3DaCOHw4TdOVwawJI4iuMpH77QPWasxs8jjlnNG6FAEi2HG4wbkXNat UOIcz0tSwroUyYT2aM99wg6g8WigNK/76g7BhIrqvzt2tRWYJjGr/vqzLJIpI/gG5wur pskP2eL4Rt4JhjHnRjXf6fGDUWH0iMaj8AbGH1l6yeKqmMhnUhgD6a0dRv2L6lSsONQU NaLA== X-Gm-Message-State: APjAAAV8qg4Hi3PFtxXSBAZyfFGSVGjCb91XwHy4LLZSu7BRAl0zEaoi nGjgBWWOw0RJ8EPTC/1yCt9fug== X-Received: by 2002:a17:902:b612:: with SMTP id b18mr7933212pls.309.1572547597107; Thu, 31 Oct 2019 11:46:37 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id b82sm3950874pfb.33.2019.10.31.11.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 11:46:36 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Avaneesh Kumar Dwivedi , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Jeffrey Hugo , Sibi Sankar , stable@vger.kernel.org Subject: [PATCH 1/2] remoteproc: qcom_q6v5_mss: Don't reassign mpss region on shutdown Date: Thu, 31 Oct 2019 11:46:31 -0700 Message-Id: <20191031184632.2938295-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191031184632.2938295-1-bjorn.andersson@linaro.org> References: <20191031184632.2938295-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Trying to reclaim mpss memory while the mba is not running causes the system to crash on devices with security fuses blown, so leave it assigned to the remote on shutdown and recover it on a subsequent boot. Fixes: 6c5a9dc2481b ("remoteproc: qcom: Make secure world call for mem ownership switch") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson --- drivers/remoteproc/qcom_q6v5_mss.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index de919f2e8b94..f4a02105d539 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -875,11 +875,6 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc) writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); } - ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, - false, qproc->mpss_phys, - qproc->mpss_size); - WARN_ON(ret); - q6v5_reset_assert(qproc); q6v5_clk_disable(qproc->dev, qproc->reset_clks, @@ -969,6 +964,10 @@ static int q6v5_mpss_load(struct q6v5 *qproc) max_addr = ALIGN(phdr->p_paddr + phdr->p_memsz, SZ_4K); } + /* Try to reset ownership back to Linux */ + q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, false, + qproc->mpss_phys, qproc->mpss_size); + mpss_reloc = relocate ? min_addr : qproc->mpss_phys; qproc->mpss_reloc = mpss_reloc; /* Load firmware segments */ @@ -1111,10 +1110,6 @@ static int q6v5_start(struct rproc *rproc) return 0; reclaim_mpss: - xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, - false, qproc->mpss_phys, - qproc->mpss_size); - WARN_ON(xfermemop_ret); q6v5_mba_reclaim(qproc); return ret; -- 2.23.0