From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3B26C4360F for ; Wed, 3 Apr 2019 18:12:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B4E7320700 for ; Wed, 3 Apr 2019 18:12:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YvKcWs1P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4E7320700 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=iki.fi Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QwnYcI3UlvRoaOZV24TACZPzxO/Q3ivs3Q68B1JzdOw=; b=YvKcWs1PC9vdRS URrkC1ppHB9HiyH1WGskWPJm0piZGosBoGzyDexuLE+xz6DjUPgbz9RBh8xChjCtk7GY8K2zbq/Zz GZ6q9mEyplAo3EY7b4l0FEtq3sjbtaCclAEJm/9glVwEsTCjBUgLjP7d9Q6dHNcIY6HYf8mlkxAl8 GcQKQcoBtOdNu02Ihjq0TgtQmkEP7MEvOR3hAzTDumKJaWa/JRhfi4qUzTpCE8srmx6yf8EmiwgNZ ZRvuwsWz+ELs9UFqqi7Z5OpShMvczprAkkSBdx5yLADGY+nLsdcxbnnqQKQW/ORP5qEEFVs8lXLrH 1RYgeAmC93CkbG8ket8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBkMy-0006hm-1X; Wed, 03 Apr 2019 18:12:16 +0000 Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBkMu-0006gn-Ip for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2019 18:12:14 +0000 Received: from darkstar.musicnaut.iki.fi (85-76-9-223-nat.elisa-mobile.fi [85.76.9.223]) by emh02.mail.saunalahti.fi (Postfix) with ESMTP id 27CF7200BD; Wed, 3 Apr 2019 21:12:07 +0300 (EEST) Date: Wed, 3 Apr 2019 21:12:06 +0300 From: Aaro Koskinen To: Mark Rutland Subject: Re: [PATCH] drivers: firmware: psci: add support for warm reset Message-ID: <20190403181206.GA17115@darkstar.musicnaut.iki.fi> References: <20190401181443.6459-1-aaro.koskinen@iki.fi> <20190403033314.k2wqxkm5c7imhtu5@blommer> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190403033314.k2wqxkm5c7imhtu5@blommer> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_111212_788583_4AC9ACBC X-CRM114-Status: GOOD ( 15.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aaro Koskinen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Wed, Apr 03, 2019 at 04:33:15AM +0100, Mark Rutland wrote: > On Mon, Apr 01, 2019 at 09:14:43PM +0300, Aaro Koskinen wrote: > > From: Aaro Koskinen > > > > Add support for warm reset using SYSTEM_RESET2 introduced in PSCI > > 1.1 specification. > > For reference, how do you intend to use this? The reboot mode is set using the kernel command line. One use case for warm reset is pstore/ramoops. > > @@ -256,6 +257,14 @@ static void psci_sys_reset(enum reboot_mode reboot_mode, const char *cmd) > > invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); > > } > > > > +static void psci_sys_reset2(enum reboot_mode reboot_mode, const char *cmd) > > +{ > > + if (reboot_mode == REBOOT_WARM) > > + invoke_psci_fn(psci_function_id[PSCI_FN_SYSTEM_RESET2], 0, 0, 0); > > + else > > + psci_sys_reset(reboot_mode, cmd); > > +} > > What happens when RESET2 isn't available, but the user requests s REBOOT_WARM > reset? It looks like we'd invoke a bogus SMC. This function is only called through arm_pm_restart. If the feature is not available, then arm_pm_restart points to the default psci_sys_reset. > Could we please add a preprocessor definition for SYSTEM_RESET_WARM so that > it's clear that we're passing a parameter here? OK, will add. > > /* > > * Probe function for PSCI firmware versions >= 0.2 > > */ > > @@ -588,6 +611,8 @@ static int __init psci_probe(void) > > psci_init_smccc(); > > psci_init_cpu_suspend(); > > psci_init_system_suspend(); > > + if (PSCI_VERSION_MINOR(ver) >= 1) > > + psci_1_1_set_functions(); > > } > > If we're going to add more things to this chain, can we please refactor this as: > > if (ver < PSCI_VERSION(1, 0)) > return; > > /* PSCI 1.0 setup here */ > > if (ver < PSCI_VERSION(1,1)) > return; > > /* PSCI 1.1 setup here */ > > ... as that saves on indentation and is easier to extend in future. OK, makes sense, I will do that. Thanks, A. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel