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=-13.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 C6162C4BA0E for ; Thu, 27 Feb 2020 00:44:18 +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 8BF3A21D7E for ; Thu, 27 Feb 2020 00:44:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MGuCTn9z"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="Wekr7/JL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BF3A21D7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org 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:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DmkwyxGjhJCUASmBxWCCyWhm9s0N24wDAsj2/g4KB6c=; b=MGuCTn9zYphBy9 D6YJEXw33uHLZLnBMKoEwWm9g2qaBx/AMH96rwMpwJFit4gGQO1kKuo/GQXioNG0tAcNzTWoe2RIq eJiN2ErQLqy1x3bdXAs3Ky3ZaO0LykYU55IBPG9zLK7mGvolAp1OWnNO0ZpxUvX7StCCLgtCarwaw 98Fe27AUHQ399mUKT237WpvPi94uapHJB9KDqoaExvGAEmGtPg7/XkduKqa9YlalD3XPt/JXULTW+ iZOg8tI51/z4/re7m8OH1lbO9qWYkDbNLU7+AL3SzwuTrUgzFG3TjVsd6t29swVzcR9nvBf+tD+h+ 1tMqcPTg42JxknfSfR4Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j77Hl-0000vL-W9; Thu, 27 Feb 2020 00:44:18 +0000 Received: from mail27.static.mailgun.info ([104.130.122.27]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j77Hf-0000um-MC for linux-arm-kernel@lists.infradead.org; Thu, 27 Feb 2020 00:44:16 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1582764254; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=JcRs9mZiMthRLxtoA2Yryvm9oBuTfwKq6aDUtbfP5vU=; b=Wekr7/JLIEQYR6DoUoc3wN98SDS/emeOi2sDQWSmRt0ytbMQHKD+dubESGxwdJoOiJeD7FMp M9hb5v/Zv6Wh5H2TlOopHYx9f/VZk52BtMM8OZSzSaWf0ERaFgGdaK3S1hPr2ir03jOWar2v wOnBs5ko6RfLFr6066cCXc4J924= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e5710d2.7f63ed40bc00-smtp-out-n01; Thu, 27 Feb 2020 00:44:02 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A0C5DC4479F; Thu, 27 Feb 2020 00:44:02 +0000 (UTC) Received: from [10.134.65.5] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: eberman) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5982CC43383; Thu, 27 Feb 2020 00:44:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5982CC43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=eberman@codeaurora.org Subject: Re: [PATCH v2 1/3] dt: psci: Add arm,psci-sys-reset2-type property To: Mark Rutland References: <1582577858-12410-1-git-send-email-eberman@codeaurora.org> <1582577858-12410-2-git-send-email-eberman@codeaurora.org> <20200226120918.GA21897@lakrids.cambridge.arm.com> From: Elliot Berman Message-ID: Date: Wed, 26 Feb 2020 16:44:00 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200226120918.GA21897@lakrids.cambridge.arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200226_164414_715215_2A6D1C8C X-CRM114-Status: GOOD ( 23.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Trilok Soni , Lorenzo Pieralisi , David Collins , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Sudeep Holla , Prasad Sodagudi , linux-arm-kernel@lists.infradead.org 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 On 2/26/2020 4:09 AM, Mark Rutland wrote: > On Mon, Feb 24, 2020 at 12:57:36PM -0800, Elliot Berman wrote: >> Some implementors of PSCI may relax the requirements of the PSCI >> architectural warm reset. In order to comply with PSCI specification, a >> different reset_type value must be used. > > This reads as-if you're saying the firmware isn't spec compliant, and > this is a workaround in order to get the expected behaviour. > > Can you please elaborate on what you mean by "relax the requirements" > here? What's your firmware doing or not doing that you want to avoid? > >> The alternate PSCI SYSTEM_RESET2 may be used in all warm/soft reboot >> scenarios, replacing the architectural warm reset. > > I assume you mean SYSTEM_REET2's SYSTEM_WARM_RESET reset? Please call > that out explicitly by name -- it makes this easier to look up, and > if/when more architectural resets are added the commit message won't > become ambiguous. I can reword to: Some implementors of PSCI may wish to generally use a different reset type than SYSTEM_WARM_RESET. For instance, Qualcomm SoCs support an alternate reset_type which may be used in more warm reboot scenarios than SYSTEM_WARM_RESET permits (e.g. to reboot into recovery mode). > >> >> Signed-off-by: Elliot Berman >> --- >> Documentation/devicetree/bindings/arm/psci.yaml | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentation/devicetree/bindings/arm/psci.yaml >> index 8ef8542..469256a2 100644 >> --- a/Documentation/devicetree/bindings/arm/psci.yaml >> +++ b/Documentation/devicetree/bindings/arm/psci.yaml >> @@ -102,6 +102,11 @@ properties: >> [1] Kernel documentation - ARM idle states bindings >> Documentation/devicetree/bindings/arm/idle-states.txt >> >> + arm,psci-sys-reset2-param: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: | >> + reset_param value to use during a warm or soft reboot. > > A "soft" reboot isn't a PSCI concept, so I'm worried this is just > hooking up magic values for Linux internals.> > I'd like to better understand what you're trying to achieve here. In Qualcomm use cases, we do not always want to preserve memory to caller's (i.e. Linux) exception level. For instance, crash recovery mode runs in higher exception level and would not continue booting into Linux except through a hard reset. Also, this early firmware doesn't have the ability to understand device tree or ACPI tables to know what memory to preserve. Per discussion with Sudeep and Charles, this use case violates PSCI specification for SYSTEM_WARM_RESET reset type, but would be appropriate for a vendor-specific reset type. Thus, Qualcomm firmware supports a vendor-specific reset type which does not have the requirement to preserve memory to caller's EL or to describe what memory is to be preserved in DT or ACPI. If this vendor-specific reset type is used, then firmware checks various registers (e.g. download mode [1]) to alter the restart flow (e.g. to enter recovery mode). If no alternate flow is requested, then firmware would boot back into Linux, preserving memory. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/qcom_scm.c?h=v5.6-rc3#n1120 Thanks, Elliot -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel