Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3875541imu; Fri, 18 Jan 2019 20:22:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7kDMvsqSHeiXKAFzCwokv307QlnO2UyCFr64yZbLLRQkNkHqxE/jMNOrn/3s+SX7r6LLe8 X-Received: by 2002:a63:9e19:: with SMTP id s25mr20377688pgd.203.1547871749547; Fri, 18 Jan 2019 20:22:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547871749; cv=none; d=google.com; s=arc-20160816; b=YwDZE17iej4QnC55CW5bQ5f7gEjOiau2dM240G1+i+hOE02BfDWXBkzG1Ytijeb23p PQ5x9nzV+a6l9c6/fTVPZheEnciwetnJv9uZ2vR3IN/0YtatLbIBFPHkqiuXXdvEvNpc Q8TM8TUGLDDsFpNyURnBKUi7HtM7ZMQG07NBAbRsWrFM5Y7E9Z7fm1y2KHmFz/f7Ak1V vgjgWeYRGzF5qX0z7kHgvI1hG8M33oWF+JXIXPx2H8RiZN6oN8Hac8PUZZ6h7t2pir4I vMwxv2X1pgtkSfD5nBdHxwN1dx+Ll49XwxgkaioG4pcln9S/VZqxElF8zf502fe5XGZl TfsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=nzVm4DNBkoUe42LdrxmgNbWed44h6K+3Jh2FBuGi2Xk=; b=I4F4DTARSODzD5aF0bky7ZKaHLlIRcZS7vnLXTEHzC7Py9+r/qzwAsR2Gke+nedjFQ 1AFd6JA372mryon3Tmc2yuUIt2Z3lu3tgv8Lom5WzhYMsyJCelf1zxaIxxMaR3zpX39m 3mZEhzSxGkLRvEglDlm3Hbi9dIv1nrsgqoh5hAfy8SDGGoWCdof0AgmsVEcF2s9vVLND m36RrFA7UJZkjEso3VjrS5MLS1wn+/gHSztamEuBuCZLB4Vthu2VcmV1RjD+7VFYvAGl xZ/Vg1uoRKptfktZdt/mxEzVS+Wvy11yx8CCOiOlvCVnljqcrcSh+ByeCEWN6mcI2yvm kpgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=buGoHhk5; dkim=pass header.i=@codeaurora.org header.s=default header.b=oYBxOFii; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si6797641pld.249.2019.01.18.20.21.38; Fri, 18 Jan 2019 20:22:29 -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=@codeaurora.org header.s=default header.b=buGoHhk5; dkim=pass header.i=@codeaurora.org header.s=default header.b=oYBxOFii; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727458AbfASERn (ORCPT + 99 others); Fri, 18 Jan 2019 23:17:43 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:38926 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727173AbfASERm (ORCPT ); Fri, 18 Jan 2019 23:17:42 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E5CB5606E1; Sat, 19 Jan 2019 04:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547871460; bh=pMDKfduIAKyI0z2k2KIFpSBwDT1/3et41G3W8hRFqI4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=buGoHhk5jmiErL6U1yi75SrRTd0xLjHva5LCpkapzCyhCGHQeRS7JSoIjzhejJQmK 6mvJIyLaDcAIt6IUmG48wyxYVsOPSgM0cNgeXEFWb/dk8bAx56GUcp6573TIfycSUT mEf6Nm8Mg1Y/ew2M0Gbq0eOlUrbA4oMfwL8e6XCg= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id D715960585; Sat, 19 Jan 2019 04:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547871459; bh=pMDKfduIAKyI0z2k2KIFpSBwDT1/3et41G3W8hRFqI4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oYBxOFiigd4f4E26wxWEcQZqIPdNHoQmjoP0KV2TP7sbNh8aTflEHH+QwoJuRClNV C8uTaKUF7yeXBP0F/ovldMiCkuKL7iY7r82tZQuRwZOdiHXR0BgU2zhoD93Yggl8jD +IrfnLcAfO5rYu4WkxwAv4dSlajE88iiPWDn9l4U= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 19 Jan 2019 09:47:39 +0530 From: Sibi Sankar To: Brian Norris Cc: Bjorn Andersson , Ramon Fried , linux-remoteproc@vger.kernel.org, Linux Kernel , linux-kernel-owner@vger.kernel.org Subject: Re: [PATCH] remoteproc: qcom_q6v5: don't auto boot remote processor In-Reply-To: References: <20180524192141.20323-1-ramon.fried@gmail.com> <20180529042047.GE2259@tuxbook-pro> <31da3e8d35c2b47041536c996efe484c@codeaurora.org> Message-ID: <04e98c14b5d4113a466879ee9cc3d6d6@codeaurora.org> X-Sender: sibis@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Brian, Thanks for the review On 2019-01-19 02:34, Brian Norris wrote: > Hi Sibi, > > On Fri, Jan 18, 2019 at 11:46 AM Sibi Sankar > wrote: >> On 2019-01-19 00:05, Brian Norris wrote: >> > On Thu, Jan 17, 2019 at 11:04 PM Sibi Sankar >> >> After experimenting with in kernel solutions for >> >> three revisions and observing problems on graceful >> >> shutdown usecase, >> > >> > What exactly were the problems again? e.g., what were the deficiencies >> > with having the remoteproc device listen for the REMOTEFS_QMI_SVC_ID >> > service again? Sorry, but I sort of dropped off on reviewing that >> > stuff, and now I see this. I'd mildly prefer something that is >> > actually automatic, but if I'm missing some aspects, I'd like to hear >> > that. (And, I'd like to see them explained in the commit message, if >> > this is ever to be merged.) >> >> bringing down the modem after the RMTFS server >> goes down leaves the modem in limbo (It has a few >> pending rmtfs transactions that cannot go through) >> which results in sysmon graceful shutdown failing. > > Makes sense. Probably should be described in a re-send of this patch, > if we're going with that. > >> And we have to do a modem force-stop to proceed >> which we want to avoid in graceful shutdown cases. > > Shouldn't you do the "force-stop" in the kernel too? e.g., if rmtfs > daemon dies without doing a properly-timed stop, then we should still > force a stop in the kernel, no? Basically, why not do both mechanisms: > REMOTEFS_QMI_SVC-activated start/stop in the kernel, and manual stop > (and start? this likely might still be redundant) in the daemon? yeah we already have that implemented in the kernel i.e first we try graceful shutdown followed by force-stop which will just timeout if graceful shutdown was already completed. We would just call stop from rmtfs without worrying about the underlying details. > >> This is overcome by starting rproc mss from rmtfs >> after REMOTEFS_QMI service is up and stopping >> rproc mss from rmtfs on SIGKILL/SIGINT and other >> program error signals before bringing down the >> RMTFS_QMI service i.e before exiting the rmtfs >> server loop. > > That's still not really a sure-fire way of doing things. For one, you > can't catch SIGKILL. Similarly, you can't really clean up from OOM, > segfault, etc. So it would still be helpful to hook into the QMI > service notifications in the kernel, I think. yes we would want a fail safe in the kernel as well. Sorry I meant SIGTERM instead of SIGKILL earlier > >> >> switching to controlling the >> >> remoteproc mss through rmtfs seems to solve all >> >> the known issues. >> > >> > How so? It explicitly does NOT help at all if RMTFS crashes. >> > Because...who's going to stop the modem in that case? (It works if you >> > automatically respawn a new RMTFS daemon, to toggle the modem. But >> > that's kind of cheating, and you can do that anyway, even without this >> > patch.) On the contrary, your patch *would* resolve that, since the >> > modem would notice when the RMTFS server goes away, and it would stop >> > itself. >> >> yeah we would want to mimic what the kernel >> patch did with the exception of stopping modem >> before bringing down the rmtfs server (not toggle >> rproc state but start on rmtfs service up and stop >> before rmtfs server exit). So in that case we would >> not want the modem to auto-boot. > > See above. You can't really mimic what the kernel patch was doing > completely. You can try (which is probably a good idea), but you > should still have some fallback in the kernel, I expect. yeah > >> >> https://patchwork.kernel.org/patch/10662395/ >> >> >> >> we should probably get this merged in, now that >> >> we are planning to start/stop mss through >> >> rmtfs. >> > >> > Sorry, who's planning to stop mss through rmtfs? Did I miss something? >> >> I have a working patch which I'll soon send >> upstream for review, after it clears the internal >> reviews/processes > > OK. > > Brian -- -- Sibi Sankar -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.