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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS 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 1DE0FC6778F for ; Mon, 9 Jul 2018 13:21:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6AD820881 for ; Mon, 9 Jul 2018 13:21:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6AD820881 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932798AbeGINVy (ORCPT ); Mon, 9 Jul 2018 09:21:54 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59042 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932686AbeGINVx (ORCPT ); Mon, 9 Jul 2018 09:21:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5A3D7ED1; Mon, 9 Jul 2018 06:21:53 -0700 (PDT) Received: from [10.1.211.34] (e107155-lin.cambridge.arm.com [10.1.211.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9760A3F5AD; Mon, 9 Jul 2018 06:21:51 -0700 (PDT) Cc: Sudeep Holla , Mark Rutland , Will Wong , Lorenzo Pieralisi , linux-kernel@vger.kernel.org, Florian Fainelli Subject: Re: [PATCH v2] firmware/psci: add support for SYSTEM_RESET2 To: Michal Simek , linux-arm-kernel@lists.infradead.org References: <1525186288-536-1-git-send-email-sudeep.holla@arm.com> <1525257003-8608-1-git-send-email-sudeep.holla@arm.com> <34a420e1-9d2a-b838-dce2-71de408043da@xilinx.com> <3e7235c7-d2c2-29f6-6bec-ae21cb841731@arm.com> <0fce3ee6-873e-154f-b61e-546d9da338df@xilinx.com> From: Sudeep Holla Organization: ARM Message-ID: <8b08583c-121f-347a-700a-17b5d7784309@arm.com> Date: Mon, 9 Jul 2018 14:21:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <0fce3ee6-873e-154f-b61e-546d9da338df@xilinx.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/07/18 14:13, Michal Simek wrote: > On 9.7.2018 14:36, Sudeep Holla wrote: >> >> >> On 09/07/18 13:17, Michal Simek wrote: >>> Hi Sudeep, >>> >>> On 2.5.2018 12:30, Sudeep Holla wrote: >>>> PSCI v1.1 introduced SYSTEM_RESET2 to allow both architectural resets >>>> where the semantics are described by the PSCI specification itself as >>>> well as vendor-specific resets. Currently only system warm reset >>>> semantics is defined as part of architectural resets by the specification. >>>> >>>> This patch implements support for SYSTEM_RESET2 by making using of >>>> reboot_mode passed by the reboot infrastructure in the kernel. >>>> >>>> Cc: Mark Rutland >>>> Cc: Lorenzo Pieralisi >>>> Signed-off-by: Sudeep Holla >>>> --- >>>> drivers/firmware/psci.c | 21 +++++++++++++++++++++ >>>> include/uapi/linux/psci.h | 2 ++ >>>> 2 files changed, 23 insertions(+) >>>> >>>> v1->v2: >>>> - Added mising static anotation to psci_system_reset2_supported >>>> - Added missing ')' in the comment >>>> >>>> diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c >>>> index c80ec1d03274..91748725534e 100644 >>>> --- a/drivers/firmware/psci.c >>>> +++ b/drivers/firmware/psci.c >>>> @@ -88,6 +88,7 @@ static u32 psci_function_id[PSCI_FN_MAX]; >>>> PSCI_1_0_EXT_POWER_STATE_TYPE_MASK) >>>> >>>> static u32 psci_cpu_suspend_feature; >>>> +static bool psci_system_reset2_supported; >>>> >>>> static inline bool psci_has_ext_power_state(void) >>>> { >>>> @@ -253,6 +254,15 @@ static int get_set_conduit_method(struct device_node *np) >>>> >>>> static void psci_sys_reset(enum reboot_mode reboot_mode, const char *cmd) >>>> { >>>> + if ((reboot_mode == REBOOT_WARM || reboot_mode == REBOOT_SOFT) && >>> >>> I am curious about this reboot_mode setup. I have grepped the kernel and >>> reboot_mode is setup via kernel parameters at boot time. >>> Shouldn't user decide what reboot type wants to do? >>> >> >> I have almost forgotten how I tested this. IIRC and looking quickly @ >> kernel/reboot.c and __setup(reboot=,...), I recall passing reboot=w >> while testing this. > > I would expect that too. It means static setting at boot time. > >> We can do something like what efi_reboot, but not >> sure if we need that yet if users need too decide after boot. > > > I am checking with colleague about all xilinx use cases but I would be > surprised if static configuration at run time is enough. > > Also not quite sure about mixing reboot_warm and reboot_soft cases > together. They shouldn't be the same. > > Based on psci 1.0 spec there are more options especially for bit[31] > which should be likely setup via DT(no experience with EFI) with names > and codes which should be passed to firmware but still the same issue > remains how to setup reboot type. > I think with efi_reboot, if user execute the command "reboot warm", it will set REBOOT_WARM. I was thinking something similar for psci too. I can drop REBOOT_SOFT if that's not correct. -- Regards, Sudeep