Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp182967yba; Wed, 8 May 2019 18:41:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMpux0NKjLIzpNmLJ8Wcf/nocZ/tufYM7KsVT+oKEIRSb1ZsF4nZaVAdkzT1cHFuDwCQ8T X-Received: by 2002:a17:902:9a03:: with SMTP id v3mr1520892plp.27.1557366095492; Wed, 08 May 2019 18:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557366095; cv=none; d=google.com; s=arc-20160816; b=kAb2lEJcFO/zKDaT1w5gy9+KnFEhcW4+8RURz7Hha4kDbENemqaTVpbWPQoBJtl7gt lPejQRJX1djoJymHk3nkLRJvh3vePIyomjTCPJo612QIKTUktyvvMc5wRjE5vtNyQIzC q9yw2HlObGp1v95KDGZoXtGS+KEkwvm55Rnmj3fI4pZaxrXkEY4+LS6YohFVq6Z8Z51t 7diWinGDFYyuQ+PZj+h19p+Wo2Lb1NKC9QXcpequiO9pxGWuOjLU0ZllKnvOA0ZS9mXv Iny90IR8wPaya8jVwge54CrY2PeFA9AMgYJV2X9FkKeFmk4Yzkgis0fiAnJ3j66hJZUw jl5Q== 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=6STgGs12dyLqe1j+MxzXXB9go6IvbHM4/rHRRFhUtOA=; b=do8gFuvvlpqi1+KNVtYMO9AXF5+mFWonzVRmBXrLRETgHih/pQpCinoRrC7ZRm1XeT XEyoQFcUm/N1fztKpCHCxa+UevDydBEpsYEmZh/sNyroXvx0+NBqIFeWiDJy07agIoTa SiqXFsXglZhvxd6m/Oi6DHj1zAYMsB+LlCrIR8TdG/Ayk2+IgMHal3kZo/puZV0h6iK0 gKUB+7ar/mw27R03YZzIuttADkAh8xxivqisaK+csxWJ3cOaV1CPTaHFeL1zk3P95tDT EyUn5GqgMfsojONRA6AkXPsQUyGNuSmvRFvjh3A+neoBUx28Htx55Noe7AK9zE2zeol7 ox7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=D6AcNdPb; dkim=pass header.i=@codeaurora.org header.s=default header.b="NX8//c4n"; 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 39si755015pla.437.2019.05.08.18.41.19; Wed, 08 May 2019 18:41:35 -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=@codeaurora.org header.s=default header.b=D6AcNdPb; dkim=pass header.i=@codeaurora.org header.s=default header.b="NX8//c4n"; 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 S1726674AbfEIBim (ORCPT + 99 others); Wed, 8 May 2019 21:38:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54528 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbfEIBil (ORCPT ); Wed, 8 May 2019 21:38:41 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 868ED60A05; Thu, 9 May 2019 01:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557365920; bh=4Ht87dHBqAzcwQ0kRXGlxzlr4w5kuIJqcWk5Du00ZJA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=D6AcNdPbUOkqgiT9cjhJb2kQCS3mko0gIkXla4MQ7lubKIW0trHoM3efJ8gl2O7Xn jhMsRXvITvfdjiAZLGoeCR/Ld6z7nUVsM+VYsRneCoJd/WhcviwtBdBWnoE0J6ZqD8 CRvxJPYumVEq1bgxcoHf6bXrOGpNLNsQIMZxqJEM= 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 C09AB6016D; Thu, 9 May 2019 01:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557365919; bh=4Ht87dHBqAzcwQ0kRXGlxzlr4w5kuIJqcWk5Du00ZJA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NX8//c4nlLdgspVnETddzTr74XRcwdiyl+1hK275wEEhZaxhsEvvfXOAaBsOdn2HW 7K/dQC755WzACbOmYOk1etkJIfhVzuFUp16BTLVMv1qAyaFX/POOhhzvUP9gVGeH2R Q0AdWDEgtaF2uaKl8YfQ+6h52ZKw6shRznisoIVo= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 08 May 2019 18:38:39 -0700 From: Sodagudi Prasad To: Sudeep Holla Cc: julien.thierry@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: PSCI version 1.1 and SYSTEM_RESET2 In-Reply-To: <20190502090507.GC12498@e107155-lin> References: <24970f7101952f347bd4046c9a980473@codeaurora.org> <20190501094953.GA21851@e107155-lin> <3ceb06c36ecb745e2befaeaefe49be19@codeaurora.org> <20190502090507.GC12498@e107155-lin> Message-ID: X-Sender: psodagud@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 On 2019-05-02 02:05, Sudeep Holla wrote: > On Wed, May 01, 2019 at 11:43:00AM -0700, Sodagudi Prasad wrote: >> On 2019-05-01 02:49, Sudeep Holla wrote: >> > On Tue, Apr 30, 2019 at 05:07:31PM -0700, Sodagudi Prasad wrote: >> > > On 2019-04-30 14:44, Sodagudi Prasad wrote: > > [...] > >> > > >> > > It would nice if there is a config option to reboot the device >> > > either in >> > > warm or cold in the case of kernel panic. >> > >> > I presume you prefer to do warm boot in case of panic to get a dump of >> > the memory to inspect ? If so, is kexec/kdump not the mechanism to >> > achieve that ? >> >> Hi Sudeep, >> >> Thanks for your response and sharing details about your patch. >> >> > If so, is kexec/kdump not the mechanism to achieve that? >> > >> Qualcomm is having vendor specific solution to capture ram contents >> and for >> offline analysis. >> > > Ah OK. > >> > >> > I am just trying to understand the use case. Xilinx asked for the same >> > but never got to understand their use case. >> >> Here is the background - >> Usually, power off drivers are overriding arm_pm_restart and >> pm_power_off >> callbacks and registering with reboot notifier with some priority for >> the >> reboot operations. Here is the Qualcomm poweroff driver for >> reference. >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/power/reset/msm-poweroff.c >> >> Before vendor chip set specific power off driver is probed, >> arm_pm_restart >> functions pointer holds the psci_sys_reset function. Once vendor power >> off >> driver is probed, vendor drivers can override the arm_pm_restart >> function >> pointer. >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/psci.c#n562 >> >> Once vendor driver is probed, drivers can take care of devices warm or >> hard >> reset configuration part properly. But there is a window from >> start_kernel() to vendor specific driver probed, devices are getting >> cold >> resets even if kernel crashed. This is due to arm_pm_restart points >> to >> psci_sys_reset function by default. Is this problem clear now? >> > > Too specific use case IMO and I am not sure if we need a generic > solution > to deal with this. Anyways, I don't see any check in arch/psci specific > code for what you want, just ensure reboot_mode is set appropriately. > Post a patch and see what people have to say. Hi Sudeep, Yes. With your system_reset2 command support addition, just configuring the reboot_mode is good enough. -Thanks, Prasad > >> Qualcomm downstream kernel has a lot of use cases with respect device >> reset >> sequence and the downstream driver is much different from upstream >> drivers. >> I think, the above-mentioned problem is common for all the chipset >> vendors >> and it is not specific Qualcomm use cases. I have one downstream >> solution >> to this problem but thought to bring up this problem to the upstream >> community for a common solution, so that all the vendors can use it. >> > > May be or may be not, post the patch and let's see. > >> I have modified below flow to avoid cold restart in the case of early >> kernel >> panic. >> panic() --> emergency_restart() --> machine_emergency_restart() --> >> machine_restart(NULL); >> >> -Thanks, Prasad >> >> > >> > -- >> > Regards, >> > Sudeep >> >> -- >> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora >> Forum, >> Linux Foundation Collaborative Project -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project