Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2893924ybl; Mon, 20 Jan 2020 11:25:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwQiNZkrXTwrmsf6CACEVf5aT4J+6x4QJCy1iMAnSRFCCHYqqvxjRGWn0KUvgVCBKoc8d6a X-Received: by 2002:a9d:6418:: with SMTP id h24mr776664otl.172.1579548355506; Mon, 20 Jan 2020 11:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579548355; cv=none; d=google.com; s=arc-20160816; b=bFfeZf9nFsfR77pY8qezuY8QGrFMo05mFyyXDxG4fFXGGbrvxftx3GFPOwSfO5uWJ1 GtKSgR9cNC+vK6xUdAvRwbaPUcLp5WOWccUl7Cr5QLGz8jdoy+13MAzELU4xL8Cd49yv 5xik3K0U6TeptttYpPYkScARUl5RptmddM+By8G5OKPnoD/nBwdoay39w0Ukyp014ypT /zOt8tE+rKTwLycIDuSwe7fUHhNaM4Vufbfp+xaVOHx/scCU580RPix5Eyabpv6qPh6b 8ZUDx/ewTE2auD58GcCsSjWFMTPKuG7SXka7XJTIM8g3JsmQQ6H3DG/6yyroC+zD2u5W a82w== 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=4BImEj4H53pDmcZg2F5mDuPA97CrTOZdicbRO7KXC2w=; b=aXYef4Md/3u8NA7eFG1rJaMWMB41kOlmxe1cEm4SUt+wcqG8iTVrlCantoX4VjtJRA 6LyKC8Q0nzx0vBXKC9/lFPXufAKcRsKmBNci6xraCbELvt1Iy5sGr5TJUcjpsTCPd4GG qWotCarWpsoK39Fe6pIRK4Zq+dURkWRzL7YDTGcgeSwajc2wbWRMghuZtQoIBrVimnP5 hZ7nbV8wpwRMNPLePfdXe5/EnL+anaDhm0VUtezlCuRTFH4zznF/rWQhaVO61gSzCzaX EqiPQzZInlv5dV4hBb+YK4MZKJvI6E1ZXKvXvS2BlaMPNiZVW9VjzM2uqXnAUXUROtLl qS+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SJXgIfvy; 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 t82si18858135oif.45.2020.01.20.11.25.42; Mon, 20 Jan 2020 11:25:55 -0800 (PST) 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=SJXgIfvy; 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 S1726951AbgATTYg (ORCPT + 99 others); Mon, 20 Jan 2020 14:24:36 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46788 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbgATTYg (ORCPT ); Mon, 20 Jan 2020 14:24:36 -0500 Received: by mail-pf1-f193.google.com with SMTP id n9so179451pff.13 for ; Mon, 20 Jan 2020 11:24:36 -0800 (PST) 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=4BImEj4H53pDmcZg2F5mDuPA97CrTOZdicbRO7KXC2w=; b=SJXgIfvyWUbFDJRJHMl3vakHhpmRchRQnb/4moM5JQQNLQ8WkBRrzsNXOXT3g1+9f3 Dil/2snqAtHl+dbIl3dIxmRxJlCT/J3ncCcVoBxSHMv+sGcHeJdWM27DorO68WKGUw3q 3IvLHQvLgfHLXf+ZqDOdQ0rDSUMPN1cGv3c0lpq64Bme3saRnIJwJyqVsKxeUKQrVtey 8GRoPXQC8glf9a3CT9Loj91qVEq9F3l62U93f6STPGDmhGPEimnpRhFCh/iTtwclzeqr pL9Ww0Bwu3FOv1vKFLRYJVrZS/eu+XLR7jkBoTKFR5eua4hHnWQtEUWSsTusCmfthx79 gCvQ== 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=4BImEj4H53pDmcZg2F5mDuPA97CrTOZdicbRO7KXC2w=; b=o/5PV5QbJlGD1FYPx8sYLDlW7Fk0pps7PTsdGmjHeK6PVyeOtxkgnDVMpzeZAnUd80 TN9Xu5sIzJ2L15OKoVc/llhMv1F8u+uERQu0yM6drM+jnxeIj9IWVsA6g74zHjI0/SIj KLlkJSq/a2DpduDKxjiC1VSt/PVcJWz7wrwlAylwDqTDMjhT8SkucfGVc4wrsTBikgE+ r2YyIg9HmSaonXj/I7iDcqqFThepLeEdR4vKQYOY23g8Rf9nOh8/zU8oBgpM0qRrp6/X nUWq6FCxU8ESBzuL/tVDhatRaW/p35mgTLGYXoWEoNx6DQ8uhW/ULWLbjVUD4AruOF0o R7Tg== X-Gm-Message-State: APjAAAWFilrN2sRAkQN8gxMKHoXozB5zeB4mRhAbJ6F5s6ioDk8s1yOe HFEL/FFEZSB82HbMD/eytruQ4Q== X-Received: by 2002:a63:1346:: with SMTP id 6mr1251849pgt.111.1579548275691; Mon, 20 Jan 2020 11:24:35 -0800 (PST) Received: from yoga (wsip-184-181-24-67.sd.sd.cox.net. [184.181.24.67]) by smtp.gmail.com with ESMTPSA id u127sm41991223pfc.95.2020.01.20.11.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 11:24:35 -0800 (PST) Date: Mon, 20 Jan 2020 11:24:32 -0800 From: Bjorn Andersson To: Sibi Sankar Cc: evgreen@chromium.org, p.zabel@pengutronix.de, ohad@wizery.com, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, agross@kernel.org Subject: Re: [PATCH 1/4] remoteproc: qcom: q6v5-mss: Use regmap_read_poll_timeout Message-ID: <20200120192432.GJ1511@yoga> References: <20200117135130.3605-1-sibis@codeaurora.org> <20200117135130.3605-2-sibis@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200117135130.3605-2-sibis@codeaurora.org> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 17 Jan 05:51 PST 2020, Sibi Sankar wrote: > Replace the loop for HALT_ACK detection with regmap_read_poll_timeout. > Nice, but we should be able to do the same in q6v5proc_halt_axi_port()? > Signed-off-by: Sibi Sankar > --- > drivers/remoteproc/qcom_q6v5_mss.c | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > > diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c > index 51f451311f5fc..f20b39c6ff0ed 100644 > --- a/drivers/remoteproc/qcom_q6v5_mss.c > +++ b/drivers/remoteproc/qcom_q6v5_mss.c > @@ -73,6 +73,7 @@ > #define NAV_AXI_IDLE_BIT BIT(2) > > #define HALT_ACK_TIMEOUT_MS 100 > +#define NAV_HALT_ACK_TIMEOUT_US 200 > > /* QDSP6SS_RESET */ > #define Q6SS_STOP_CORE BIT(0) > @@ -746,7 +747,6 @@ static void q6v5proc_halt_nav_axi_port(struct q6v5 *qproc, > struct regmap *halt_map, > u32 offset) > { > - unsigned long timeout; > unsigned int val; > int ret; > > @@ -760,15 +760,11 @@ static void q6v5proc_halt_nav_axi_port(struct q6v5 *qproc, > NAV_AXI_HALTREQ_BIT); > > /* Wait for halt ack*/ > - timeout = jiffies + msecs_to_jiffies(HALT_ACK_TIMEOUT_MS); > - for (;;) { > - ret = regmap_read(halt_map, offset, &val); > - if (ret || (val & NAV_AXI_HALTACK_BIT) || > - time_after(jiffies, timeout)) > - break; > - > - udelay(5); > - } > + ret = regmap_read_poll_timeout(halt_map, offset, val, > + (val & NAV_AXI_HALTACK_BIT), > + 5, NAV_HALT_ACK_TIMEOUT_US); > + if (ret) > + dev_err(qproc->dev, "nav halt ack timeout\n"); Is there a case where this new print adds value beyond the printout we already have for the case of IDLE_BIT not going high? Can we simply ignore the return value and skip the print? Regards, Bjorn > > ret = regmap_read(halt_map, offset, &val); > if (ret || !(val & NAV_AXI_IDLE_BIT)) > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project