From patchwork Tue Jul 16 05:03:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 169027 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp332347ilk; Mon, 15 Jul 2019 22:03:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfhnZIhcH+Z2Fiw8pQ0aYIdw3rGk6sltlNuAiLsVOvpNmIB8mT/mzF7Gc8upKN1DsDcjhy X-Received: by 2002:a17:902:b28b:: with SMTP id u11mr31408473plr.11.1563253413826; Mon, 15 Jul 2019 22:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563253413; cv=none; d=google.com; s=arc-20160816; b=ygYrdJOnTe1bUou2JDCVqTA+vxreaa0Xv032npUCm5a73hXw66IeobUTT/TJjOkAqy nOz99ZpwDadvWbYOww3r3Q5ferqYJYngz39tWmqDz6ofHhUNejAo9jTjkGuh4jniwn3b 8OWThIjV+VbXfdLkrW51nSvWh73VtIglsWsyC+SVZzELY9NA3iSXwp0y8qUjdor3mEaW AfypyTUk0Wl3Ib39xM7g6V2BU7W3OT90+Gun/wHTHBNtaBdWy7fTTX+dTEIPejh8PVkh VZQhyqvTBlVXJJNBda9Op8A3n6EmdO9JBLyoCvTxOHXG/D1XV7g1C/TWQjrCyzr+NpCW ujuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=XuPh1ec5nyWI9lzxp+dj0MV4o3EuhJcXc845yk8LJjk=; b=xlpqMDX+EAVO4SZIPFLLfojFU07eOpn6rEbnFMt+WyoHsLuUlkXd9S0UHFvE/K/5ff KR168bq4lT/fRSAHpRRK2CaIfR5RDNVmmuOz+s1Fl4fhjM9/9ZMTUoYvNZT/hIMJA1/P qyzhTq67CGjM3b/tbGUXPANSs9SZTX/GV7nA+dD6YbuTO/Pg6Qfx9uVCsznU4ku9tgUd KpmDoVzyXY/Q3NF7zRj5mNC70kMoQhMSv8j68YiuVDcurytUIkJc0JOyjT1uie9Hn/AM Kn9xp1TbjPLa4XNBML7d7DpXV01kQiBxLaDYxHzLeE9Y/TRzrYWBJH+y6LF7vooYOGQw bq6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fQADIp2Y; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 12si18240505pgn.328.2019.07.15.22.03.33; Mon, 15 Jul 2019 22:03:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=fQADIp2Y; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726408AbfGPFDc (ORCPT + 15 others); Tue, 16 Jul 2019 01:03:32 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36558 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726315AbfGPFDc (ORCPT ); Tue, 16 Jul 2019 01:03:32 -0400 Received: by mail-pg1-f195.google.com with SMTP id l21so8802718pgm.3 for ; Mon, 15 Jul 2019 22:03:32 -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; bh=XuPh1ec5nyWI9lzxp+dj0MV4o3EuhJcXc845yk8LJjk=; b=fQADIp2YgdYHdH1vX7+wb+Xf44XKPz90A4MQaawD9H4et04YyTumC1Vl+ZA5hbQSJz GWhkkNiFU5CD4DeVwbcshRHJ35gDgWgT1I13VRIuvRyRmnS31qL+OnyYS/FGN9YNsCro vDld9SXrbOgd9AxZaqULs6MMDYonX6w3aD4GsgE7Aw9laYfMCvIoHq/u9uEdghNPiDbS hDHY/IVeemd9h3/7ermIDO/1DTGlCIL0PQyWsQd3epqzzK/d7tS0fXdghZcdw6NErEFx kyzYlFF7CqBCFfVtwyKzRFdDml26ZhEUDgwGfNgH9cm0VZVb5Yr8p4t4wVezkcIAgzUN T3rw== 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; bh=XuPh1ec5nyWI9lzxp+dj0MV4o3EuhJcXc845yk8LJjk=; b=ZOwdtsv3+DhPArQEEb8pQ2iSJvqIoXL0qHiS/fkduAzBjf6/pG5HqrtUGIu8tphDqh bU/1bC1JDw/58lgtEIo4zqoeJjorzRPgx4cychfpRL1DiIRTYTVaxpGyQXuSDSBmmdBD wBJkzEhPGprqL18v96Erfyi7R0SsoIXNuDZ26nv7B0sCj+bPPNNpQH2+E9pJyL3FJNmS cWccxJAxKcMMuKXcJTKNbd0h3K03ZtGBWztGtqw5vig7cIvIyuOri1e13BsRe90TwCmT c7uurWuCAKtl8TOAeB26K+gA/qLsbI5Une9Os7w2Xn/nmdy8POUKgQe8zkZnyGTKQU5/ WhDw== X-Gm-Message-State: APjAAAXrobS+Dv8iQi28YfjT/WwsBn0ZH4TMUBYuIcxRJDsXuA4ecySQ 4zf5LpB9IDlqdmbB//tH8NYH2g== X-Received: by 2002:a17:90a:2190:: with SMTP id q16mr32606625pjc.23.1563253411592; Mon, 15 Jul 2019 22:03:31 -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 j20sm18434336pfr.113.2019.07.15.22.03.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 22:03:30 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Sibi Sankar , Arun Kumar Neelakantam , Chris Lew Subject: [PATCH] remoteproc: qcom: Move glink_ssr notification after stop Date: Mon, 15 Jul 2019 22:03:27 -0700 Message-Id: <20190716050327.8866-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org glink_ssr is used to signal a remote processor "A" about the stopping of another remote processor "B", so that in the event that remote processor B is ever booted again the fifos of the glink channel between A and B is in a known state. But if remote processor A receives this notification before B is actually stopped the newly reset fifo indices will be interpreted as there being "data" on the channel and either side of the channel will enter a fatal error handler. Move the glink_ssr notification to the "unprepare" state of the rproc_subdev to avoid this issue. This has the side effect of us not notifying the dying remote processor itself about its fate, which has been seen to block in certain resource constraint scenarios. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/qcom_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.18.0 Reviewed-by: Sibi Sankar Tested-by: Sibi Sankar diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index 6a448429f223..60650bcc8c67 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -200,7 +200,7 @@ void qcom_unregister_ssr_notifier(struct notifier_block *nb) } EXPORT_SYMBOL_GPL(qcom_unregister_ssr_notifier); -static void ssr_notify_stop(struct rproc_subdev *subdev, bool crashed) +static void ssr_notify_unprepare(struct rproc_subdev *subdev) { struct qcom_rproc_ssr *ssr = to_ssr_subdev(subdev); @@ -220,7 +220,7 @@ void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr, const char *ssr_name) { ssr->name = ssr_name; - ssr->subdev.stop = ssr_notify_stop; + ssr->subdev.unprepare = ssr_notify_unprepare; rproc_add_subdev(rproc, &ssr->subdev); }