Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp59505ybg; Mon, 27 Jul 2020 23:24:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzf9x3UwT4/Cf/TDiVNuk2NNeWR/66KGsNYjvkGYkK7yyUZ7vIFELoHU+6dlL4yjeuw2ldb X-Received: by 2002:a17:907:72c8:: with SMTP id du8mr13563538ejc.237.1595917440967; Mon, 27 Jul 2020 23:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595917440; cv=none; d=google.com; s=arc-20160816; b=FO4ABnlUJi7rAmhg3TGIQmIKiie52olR9d7U7RTvIFn0mZ8CFe4irzEKZCMS22rx+p lE41yBXLkB7mjTD2xdPExuVc6sQSCyxvPw3NQ+7kKCwq+8y6HVr8ZHvu+iO/CZD9iDzE z3b+hXgU3qMxHLiL1ZasofwfgBdyO2RkktmBLJioNHrITZ6l2QjYxnkcfAyNlIXz9Y9Y rBMf4cVWfg1HWYMVBTkesl9H/pO/uAIMlfWtemsMRzlJOQgYlbmKmLzysZsZjNY3tX0g 7Y4UEP2KJGgzZlQ8EIHSGR52+uVoUFix/gY+V+npvbCRjhcFtWf4Bh4zSsmRKD9YDheR kZiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CRQ3SY13fKgFuQBuWwIXpmK8jrUTuVHeJrYZMW46Jls=; b=XXbgA2ni9pdClPc2fiDdc9XJ8W51P+Awsn7NHM08noByAZYw+7w0U5bCI+NZgHvJ/1 MMbYzAi10J+0cDJaEA19kLap6UH7xFhmz/2x9BtoSt2uPx3OQgvgq7/i9ypVDJdgoPIX t7DIPhIeL1lE5ZMQIUGxWOlYIXvpX309B0ChotiYyrFv36lGNDBFg5ADYmI9JwmvMxUb yfZkZU8R6H4yPRj6gLkYrJvvsKrx+AFYpxR2cUMjrkWf+hAsGblVTF3qIgBSYewQKSTe DuoJZhM8CCqzpZnVQS+7t5oxipbu0RZ5qYUDuQH8gKP3oSWi+wkLQQMzmjTvqC5F2IOD y3rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OYXjOsSN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id e23si6946247ejk.209.2020.07.27.23.23.38; Mon, 27 Jul 2020 23:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OYXjOsSN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728163AbgG1GWe (ORCPT + 99 others); Tue, 28 Jul 2020 02:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbgG1GWe (ORCPT ); Tue, 28 Jul 2020 02:22:34 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA6CC0619D6 for ; Mon, 27 Jul 2020 23:22:33 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id gc9so10945307pjb.2 for ; Mon, 27 Jul 2020 23:22:33 -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; bh=CRQ3SY13fKgFuQBuWwIXpmK8jrUTuVHeJrYZMW46Jls=; b=OYXjOsSNp9DOGylUrC0LHHlTYi2ODrqorK03mlCeDzJm05uwYAozu9nfFdy+N3ZuS0 wO0B/v5eE+c7SbWXJatUfKYJCir7akBsjC3G/QQ5nHFTvZwBPf4hTHC0VIhJclDE2ryo v+uvCFkHeqmzoAEBB7BSLmBLceZAQGVwFnbyNZwj/x3ld6kN5apGSeTGQjWBaPaZG5t9 l8dNRoFqXyjTRwEVhajOMQrFJEJJZeL6pd6uTEW3Q8UP/q1L7GE+WSOBFJ/5Fava0wPI x3HCveEuHZmr7T/FqCIJpiAKTs3vTQ88FbGIleN+YKowD485T79+haeFMoXWGfqwjcK/ 7WIQ== 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; bh=CRQ3SY13fKgFuQBuWwIXpmK8jrUTuVHeJrYZMW46Jls=; b=fbHhy8j1R84GZ3kCwK7qXeEajueLrpFEBm9b1lQLzuaIx7GycnMSpPvDKid3zuAxW4 SPaFceV7Rrf2YzjqJsHUkoGfqmIzwNBKJegpHwAC5p73DmRMKKvczJU0I4Eq38dHaEVg GHiGwQQU9rRUSiOCYe6KryZS6kZ5DrjvDN0acBuC7O9C9CMWUF0W2lOzQU3ndT81+iiA CbNVH6u0Ov6iz0dXv+Q0Bq/Bh0R1WiL12ylGld7sGIV0SZd4Z3RPuslHnZaXaF9JflQA aNY5TPhuauMkFhEZmf5cCOWquTWd8JDehwwGtU686TGhEGjyQ3QcC5ZgUqhFpX7pKSAI hFcA== X-Gm-Message-State: AOAM533kUAgMHE6j1Ui8wctkgH7xA5cLndGm/U/nDldSSm+O7MQVxC/L aNoQbTpEJOqxKGFSPMj9Nkf6wg== X-Received: by 2002:a17:90a:764c:: with SMTP id s12mr2842004pjl.201.1595917353146; Mon, 27 Jul 2020 23:22:33 -0700 (PDT) Received: from builder.lan (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id 204sm17246447pfx.3.2020.07.27.23.22.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 23:22:32 -0700 (PDT) Date: Mon, 27 Jul 2020 23:19:00 -0700 From: Bjorn Andersson To: Evan Green Cc: Sibi Sankar , Andy Gross , linux-arm-msm , linux-remoteproc@vger.kernel.org, LKML , Ohad Ben Cohen , rohitkr@codeaurora.org, stable@vger.kernel.org, linux-kernel-owner@vger.kernel.org Subject: Re: [PATCH 1/2] remoteproc: qcom: q6v5: Update running state before requesting stop Message-ID: <20200728061900.GD349841@builder.lan> References: <20200602163257.26978-1-sibis@codeaurora.org> <6392c800b0be1cbabb8a241cf518ab4b@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 03 Jun 15:33 PDT 2020, Evan Green wrote: > On Tue, Jun 2, 2020 at 10:29 PM Sibi Sankar wrote: > > > > Evan, > > Thanks for taking time to review > > the series. > > > > On 2020-06-02 23:14, Evan Green wrote: > > > On Tue, Jun 2, 2020 at 9:33 AM Sibi Sankar > > > wrote: > > >> > > >> Sometimes the stop triggers a watchdog rather than a stop-ack. Update > > >> the running state to false on requesting stop to skip the watchdog > > >> instead. > > >> > > >> Error Logs: > > >> $ echo stop > /sys/class/remoteproc/remoteproc0/state > > >> ipa 1e40000.ipa: received modem stopping event > > >> remoteproc-modem: watchdog received: sys_m_smsm_mpss.c:291:APPS force > > >> stop > > >> qcom-q6v5-mss 4080000.remoteproc-modem: port failed halt > > >> ipa 1e40000.ipa: received modem offline event > > >> remoteproc0: stopped remote processor 4080000.remoteproc-modem > > >> > > >> Fixes: 3b415c8fb263 ("remoteproc: q6v5: Extract common resource > > >> handling") > > >> Cc: stable@vger.kernel.org > > >> Signed-off-by: Sibi Sankar > > >> --- > > > > > > Are you sure you want to tolerate this behavior from MSS? This is a > > > graceful shutdown, modem shouldn't have a problem completing the > > > proper handshake. If they do, isn't that a bug on the modem side? > > > > The graceful shutdown is achieved > > though sysmon (enabled using > > CONFIG_QCOM_SYSMON). When sysmon is > > enabled we get a shutdown-ack when we > > try to stop the modem, post which > > request stop is a basically a nop. > > Request stop is done to force stop > > the modem during failure cases (like > > rmtfs is not running and so on) and > > we do want to mask the wdog that we get > > during this scenario ( The locking > > already prevents the servicing of the > > wdog during shutdown, the check just > > prevents the scheduling of crash handler > > and err messages associated with it). > > Also this check was always present and > > was missed during common q6v5 resource > > helper migration, hence the unused > > running state in mss driver. > > So you're saying that the intention of the ->running check already in > q6v5_wdog_interrupt() was to allow either the stop-ack or wdog > interrupt to complete the stop. This patch just fixes a regression > introduced during the refactor. > This patch seems ok to me then. It still sort of seems like a bug that > the modem responds arbitrarily in one of two ways, even to a "harsh" > shutdown request. > I think the patch properly fixes this regression, but I share your concern about the fact that we omit an entire category of shutdown-related crashes from being reported. The problem I presume with the current behavior is that the shutdown will race against the crash handler - which might boot the remoteproc up again while the shutdown is progressing. So I'm okay with this fix for the immediate problem, but think it would be nice if we could report the issue appropriately and then finalize the shutdown. > I wasn't aware of QCOM_SYSMON. Reading it now, It seems like kind of a > lot... do I really need all this? Can I get by with just remoteproc > stops? It used to be that we set one bit in shared memory and sent an interrupt and the modem would set another bit and interrupt us back when it was done shutting down... > Anyway, for this patch: > > Reviewed-by: Evan Green Thanks, Bjorn