Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4193624ybb; Mon, 23 Mar 2020 15:37:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtCuPqzSoTkPbgUS/arzn9pzEwns2L2ZV/OoKzZwdnVNCo2//fcDUmJh5ZdpX4MM7E+eEMM X-Received: by 2002:a4a:9c86:: with SMTP id z6mr1134953ooj.68.1585003027283; Mon, 23 Mar 2020 15:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585003027; cv=none; d=google.com; s=arc-20160816; b=WfIc6yP7IlcK4iXGxMxTdAk/pvCTjx5VzqjjmINmTjQ4MNxVWvkW1WyXPt9Yx1LT3K 8h2Y8Rk8c//bni+qtTzQu+mrtF+seA9hcCOWLBnxUoEb77RAmZKNYjULcbHl1jH83gQY OOAMuJEoJ/r0XSJX/XoXQ9ZDNtjIaiLalkY+DdrJH2tK9R+8yrdMBmCaaT+NFolWU8M6 SXmk21gR6DB2CGCs7kI0t7Nm72qR7+3pyxsNUvsu1xxlKto9fL78x6cVXuLrQL3AuxtU JS9VFPssydhKF5FyBPbdyoztV4j/gm5hG+agzIFbIRbC3FWGH17HQc84zzdmlN//Clbq Sheg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ACuUasvqtN3uO6yrwsX1eOuus0lzP1y4to8YPIyRRRk=; b=wetEQokXkzmYpM1ODwUGQTNdQ1xiS/emvY+/fIRi1acIyXgt0D1HD/hIP6dpDscyIU cQxb7HIj5SMTKFQtZmaH6IgEgczR/kpFOq5owlWMkXYujb5ktN8AqtaqYwG5a4HjlVog FElBzLSPZo9lOYbR+NaZrqXWYSukP5uLwnxkuHq5V4hZFSMnl6udIQi6SDgdiKum+M3w 5FL73y3lCI1FFX/4HaD3YJ5K9/pMZuDbofzLg/Y86MRGYuPJFxEKHHM6qp0JwYBNaeZk +lAdy5ZzpuhtpXA9ontc0JYUSHjdbI5JOcoDcjVVUSQ7zcMvNAz7rH81Y7G2uitToV2n Ms3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LEc0lIvc; 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 g25si5588275otj.287.2020.03.23.15.36.53; Mon, 23 Mar 2020 15:37:07 -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=LEc0lIvc; 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 S1726991AbgCWWg2 (ORCPT + 99 others); Mon, 23 Mar 2020 18:36:28 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37355 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbgCWWg2 (ORCPT ); Mon, 23 Mar 2020 18:36:28 -0400 Received: by mail-pf1-f195.google.com with SMTP id h72so6039181pfe.4 for ; Mon, 23 Mar 2020 15:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ACuUasvqtN3uO6yrwsX1eOuus0lzP1y4to8YPIyRRRk=; b=LEc0lIvcUiVP04UL4F+kP9+DFW+U6/rZcNdd2Wsub+v9ElcnKjfl00yxZOM9jbckr0 AbOYdFQc/HY3vn1pznkiQpcdUjpBgPOS93HJ7+MdOkkwHiv/ZqWb7NO44QQFFllHrX/Q tg9Iz22QRPfnMkJegjTdoDSrlfqGfWC2T6owvXt1ALP/szEQXRoLUVz1+r3sUOUQg3d7 RCM4GtfKvbLBvNUSlavjfpSqwAGzZS12impU7JTqQAdA+NKlPmCs9d3wtgFgjQbxys+k hcSUOGRvUY/Qj3+FL51CVfVjSS0Hk+SR0hGrtq4RqqD7CQa40QAiZKX6aoG1hP2iC76t ZByA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ACuUasvqtN3uO6yrwsX1eOuus0lzP1y4to8YPIyRRRk=; b=QDSL/dgEjUQsYljd1ThWBf87KT+BFzGtytcPHVVVc0yBcOg1AB7So3+U4CGlZuEc1k yMGf7m6ox+ucLapwJKVpIhTMad88+fE7U5zzAaQo5ceFoTHqmsT3mUTulccwhV1Yj9/c jkz7K7D5aiQrFsHcD/NElv/u+yhkEX8D+cYLZgWsMLSVJujEostH1VmNp/GUXC/5eSq7 JCz/b+uFg0USREhaPjJZxCTvb21AudpR12aAe0N71Zv6om6dumhM5PwEEowsfm1lavLJ oSccR/R3xPsLg/HWIhy4h0KBUge3pGl4LOB0sV7ESMIJFnApO2gWX5zo/NBh9stomDoD 0Leg== X-Gm-Message-State: ANhLgQ0Y7o/atpiuEAYoGPq2SHjnJ2O5gzCepMwL2SaGfPbN+h2VtJou KeYgU0VlMKKHo6ExJ5+pLmxBTg== X-Received: by 2002:a63:ff20:: with SMTP id k32mr23724220pgi.371.1585002987050; Mon, 23 Mar 2020 15:36:27 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r17sm2328604pgl.80.2020.03.23.15.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 15:36:26 -0700 (PDT) Date: Mon, 23 Mar 2020 16:36:24 -0600 From: Mathieu Poirier To: Bjorn Andersson Cc: Andy Gross , Ohad Ben-Cohen , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/4] remoteproc: qcom: q6v5: Add common panic handler Message-ID: <20200323223624.GD30464@xps15> References: <20200310063817.3344712-1-bjorn.andersson@linaro.org> <20200310063817.3344712-4-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200310063817.3344712-4-bjorn.andersson@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 09, 2020 at 11:38:16PM -0700, Bjorn Andersson wrote: > Add a common panic handler that invokes a stop request and sleep enough > to let the remoteproc flush it's caches etc in order to aid post mortem > debugging. For now a hard coded 200ms is returned to the remoteproc > core, this value is taken from the downstream kernel. > > Signed-off-by: Bjorn Andersson > --- > > Change since v3: > - Change return type to unsigned long > > drivers/remoteproc/qcom_q6v5.c | 20 ++++++++++++++++++++ > drivers/remoteproc/qcom_q6v5.h | 1 + > 2 files changed, 21 insertions(+) > > diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c > index cb0f4a0be032..111a442c993c 100644 > --- a/drivers/remoteproc/qcom_q6v5.c > +++ b/drivers/remoteproc/qcom_q6v5.c > @@ -15,6 +15,8 @@ > #include > #include "qcom_q6v5.h" > > +#define Q6V5_PANIC_DELAY_MS 200 > + > /** > * qcom_q6v5_prepare() - reinitialize the qcom_q6v5 context before start > * @q6v5: reference to qcom_q6v5 context to be reinitialized > @@ -162,6 +164,24 @@ int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5) > } > EXPORT_SYMBOL_GPL(qcom_q6v5_request_stop); > > +/** > + * qcom_q6v5_panic() - panic handler to invoke a stop on the remote > + * @q6v5: reference to qcom_q6v5 context > + * > + * Set the stop bit and sleep in order to allow the remote processor to flush > + * its caches etc for post mortem debugging. > + * > + * Return: 200ms > + */ > +unsigned long qcom_q6v5_panic(struct qcom_q6v5 *q6v5) > +{ > + qcom_smem_state_update_bits(q6v5->state, > + BIT(q6v5->stop_bit), BIT(q6v5->stop_bit)); > + > + return Q6V5_PANIC_DELAY_MS; > +} > +EXPORT_SYMBOL_GPL(qcom_q6v5_panic); > + > /** > * qcom_q6v5_init() - initializer of the q6v5 common struct > * @q6v5: handle to be initialized > diff --git a/drivers/remoteproc/qcom_q6v5.h b/drivers/remoteproc/qcom_q6v5.h > index 7ac92c1e0f49..c4ed887c1499 100644 > --- a/drivers/remoteproc/qcom_q6v5.h > +++ b/drivers/remoteproc/qcom_q6v5.h > @@ -42,5 +42,6 @@ int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5); > int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5); > int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5); > int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout); > +unsigned long qcom_q6v5_panic(struct qcom_q6v5 *q6v5); Reviewed-by: Mathieu Poirier > > #endif > -- > 2.24.0 >