From patchwork Wed Dec 13 22:41:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10111025 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 864AA60352 for ; Wed, 13 Dec 2017 22:42:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79DFA28AAC for ; Wed, 13 Dec 2017 22:42:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ED8F28F75; Wed, 13 Dec 2017 22:42:33 +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=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 2B69628AAC for ; Wed, 13 Dec 2017 22:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690AbdLMWmH (ORCPT ); Wed, 13 Dec 2017 17:42:07 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:42841 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752932AbdLMWlZ (ORCPT ); Wed, 13 Dec 2017 17:41:25 -0500 Received: by mail-pg0-f68.google.com with SMTP id e14so2052791pgr.9 for ; Wed, 13 Dec 2017 14:41:25 -0800 (PST) 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; bh=lyeeivph6fo9yKXJxQ+ouvVRR51z7KpFpnIT45BPY4M=; b=VmqLxrVPRO+SstG6Sd+ICy8p/+XMUEoAIrsNjf67hObtasfTswhrFvvONKSjhRR1YC sbdmcqf1982/sBi3qHffuwoki7oWYhzbZJRLakxi9ZXVlgCyFCtLXKBx87arRh5IcuQB 7AopeFmzZx67QxyidvT2UYd1pzoguAI4VJNtc= 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; bh=lyeeivph6fo9yKXJxQ+ouvVRR51z7KpFpnIT45BPY4M=; b=JBDQ9XMpN1EQ6I85GMbQILCC/51kJG3bnGMU472xKSdCFwlOaEPvaT111JSFS0fxVP p1zfL/CKSFslykd+13wLXLsalxAJGJqD9zTA1guOhyf0+51PxihQ+QNvD1P4gc/Ef3cu XvLfjiFjrdnwqy3Gf3UPphs4UWTI/10ru+mTqeGatvIq1Yfa819mXT3VSck6rMFOk3pg ao1Uab9QENKXzhCqNDmHV3XWmmdePfcka7A66uiTNB1gpiXV2I6TH5OMCT4no5iXBZu8 QM+hKgc5ICc4fEJWQSBmdwWM7z7Hijy3dChhYwWVqEY7/GehOYHeBzfVFlSfQaUYdkNK K9Zg== X-Gm-Message-State: AKGB3mJ3eoSGRyO1Ik5CLP33ZJntQ3X3ip4tyV3/Y1OGZEx1JuWgpA89 RS/oGv3nNSArCxN3p1ZfdxSiBNo+idE= X-Google-Smtp-Source: ACJfBotxv/54lwwWNfwedE/2stgwg0IYEUtfQjDgm+m7SX/jZ4bCCKNhZGAoSz5SDWUzObFZsP55jw== X-Received: by 10.159.218.12 with SMTP id v12mr7505850plp.224.1513204885091; Wed, 13 Dec 2017 14:41:25 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id x15sm4464205pfh.27.2017.12.13.14.41.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2017 14:41:24 -0800 (PST) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] remoteproc: Reset table_ptr on stop Date: Wed, 13 Dec 2017 14:41:11 -0800 Message-Id: <20171213224111.17864-9-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171213224111.17864-1-bjorn.andersson@linaro.org> References: <20171213224111.17864-1-bjorn.andersson@linaro.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 The installed resource table is no longer accessible after stopping the remote, so update table_ptr to point to the local copy. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/remoteproc_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index cbd12382b219..98c088d80b3d 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1000,6 +1000,9 @@ static int rproc_stop(struct rproc *rproc, bool graceful) /* remove any subdevices for the remote processor */ rproc_remove_subdevices(rproc, graceful); + /* the installed resource table is no longer accessible */ + rproc->table_ptr = rproc->cached_table; + /* power off the remote processor */ ret = rproc->ops->stop(rproc); if (ret) {