Message ID | 20230724223057.1208122-1-quic_eberman@quicinc.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2118897vqg; Mon, 24 Jul 2023 16:36:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlEXYNtnUmCOq6K6bTY2hJh7I0GOtlooGSzNhvFKXEzkEo0J2SSmYJq793Q6IyA+mAdQ3Dqd X-Received: by 2002:aca:1c1a:0:b0:3a3:e593:5ac1 with SMTP id c26-20020aca1c1a000000b003a3e5935ac1mr11974511oic.21.1690241770223; Mon, 24 Jul 2023 16:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690241770; cv=none; d=google.com; s=arc-20160816; b=mo7CHN0u9ZEFQ1S4/nv5TQayN3+R06yOgpDLrW+NtFHNu4tAfGlut6DfsPTPxYFJn5 rT1G60qtdw80+yGacBoca2oKEVw/zYg8gnayPeHQMmotP1hxldmQMBFwZM/cub4wNoJn VxpRifMaFxjoLjZKdFFjqwBUGOt0A+QdDAmQGnkpepiGcR1RjotZt+82yhQsy2f143Hi GAg5TBY7JN7iyAVutkoQxPCGCqkcuytMrRJjVI0+pZPKgMVSt+8HH5CBVCXoXkcsTI/O 4tyjdFXCVinUe7VErGd4dl76Wl0FnqD7BUvecNZLVswCHQ1J0UUfovt7IF2LD+Er56+u p7HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tgztBj0/mJz03MJdJCZ9JHhqYfeG+XgYMvyAdd3/QYQ=; fh=esKqhhqT9kv/WnJQoh5OP9uyzs69uMFfrxulQS9k9KQ=; b=kynRxL4YQApFzQOkunzy4NqMPBDJGrR9v4ugHvFc9ybjvP2AOgNdBhivJKRJVPI/xU +fjwYe1VcRHTFTyicOEbKTpuWWnWb/PTVPrze37XhcjQ3Qn3FimniBozjP8jnhJTR5xA T8U+AFSURR3OrZ9spDVy58u8WJml6lO9K9sWndSzpjfaYT/7arv15K9vFi+hsmGbyti4 4oAhQDKdVeM82MiPIMfYfk8WPOOQ+vpTOTXpJCB6+Zp84ZQAaTCQtkJV29Uiq2/ppC8f saRYOXzGoWcBYQBb+6EvOro6rsZFPgdhv99TUi2MwcqcjaSORiXNsfn00tP04HsshmR/ jK6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="Jolm/4Pt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m29-20020a63581d000000b00543a6cc74bfsi10026668pgb.634.2023.07.24.16.35.57; Mon, 24 Jul 2023 16:36:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="Jolm/4Pt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbjGXWba (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Mon, 24 Jul 2023 18:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230251AbjGXWb2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Jul 2023 18:31:28 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 335BD10E3; Mon, 24 Jul 2023 15:31:26 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36OMIQEw029962; Mon, 24 Jul 2023 22:31:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=tgztBj0/mJz03MJdJCZ9JHhqYfeG+XgYMvyAdd3/QYQ=; b=Jolm/4Pto6H89NYXkiAY7sBP8McF6X5D9RAED5RaPWKCwo+tYb5IKqLr+XFMNtMTImxU v3qJM0Wh54TbYkdZE8XdI0IFNy7zGmbi2xxz0Fkih90YqWfSTBD66xncYYTU/9W88nWU 3EjL7oCmuaX9XvuP2ie1MBnWiKm75Z38e+jerYhu4f9+1COlGo6bVR9x+HpZheZVX8yb Pp9ERQ2abZHJ99Vg6l3lXEt2k/tcekPjt//TXmDv/t72w1TcXj2pRGlT6V7O3tCMqDVG IhMecU7/iAWvixQcBzOgqDMjom+vBHQXPtE7JAnQuaj1IrU+ZnUsJnfWTuyYS0yzgCaq mQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s1v6u8w4c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Jul 2023 22:31:16 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36OMVE3b005283 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Jul 2023 22:31:14 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Mon, 24 Jul 2023 15:31:14 -0700 From: Elliot Berman <quic_eberman@quicinc.com> To: Mark Rutland <mark.rutland@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Sebastian Reichel <sre@kernel.org> CC: Elliot Berman <quic_eberman@quicinc.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, "Rob Herring" <robh+dt@kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-pm@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <kernel@quicinc.com>, Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>, Melody Olvera <quic_molvera@quicinc.com>, "Prasad Sodagudi" <quic_psodagud@quicinc.com> Subject: [RFC PATCH 0/4] Implement a PSCI SYSTEM_RESET2 reboot-mode driver Date: Mon, 24 Jul 2023 15:30:50 -0700 Message-ID: <20230724223057.1208122-1-quic_eberman@quicinc.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: AJZTyLSqDAycFmRx5BX6rUgsWlnPQb9X X-Proofpoint-GUID: AJZTyLSqDAycFmRx5BX6rUgsWlnPQb9X X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-24_16,2023-07-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 suspectscore=0 priorityscore=1501 mlxlogscore=844 lowpriorityscore=0 impostorscore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307240196 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772346954366348466 X-GMAIL-MSGID: 1772346954366348466 |
Series |
Implement a PSCI SYSTEM_RESET2 reboot-mode driver
|
|
Message
Elliot Berman
July 24, 2023, 10:30 p.m. UTC
PSCI implements a restart notifier for architectural defined resets. The SYSTEM_RESET2 call allows vendor firmware to define additional reset types which could be mapped to the reboot reason. Implement a driver to wire the reboot-mode framework to make vendor SYSTEM_RESET2 calls on reboot. This is a continuation from https://lore.kernel.org/all/4a679542-b48d-7e11-f33a-63535a5c68cb@quicinc.com/ Elliot Berman (4): power: reset: reboot-mode: Allow magic to be 0 power: reset: reboot-mode: Wire reboot_mode enum to magic dt-bindings: power: reset: Document arm,psci-vendor-reset power: reset: Implement a PSCI SYSTEM_RESET2 reboot-mode driver .../power/reset/arm,psci-vendor-reset.yaml | 35 +++++++++++++ MAINTAINERS | 2 + drivers/firmware/psci/psci.c | 9 ++++ drivers/power/reset/Kconfig | 9 ++++ drivers/power/reset/Makefile | 1 + drivers/power/reset/psci-vendor-reset.c | 49 +++++++++++++++++++ drivers/power/reset/reboot-mode.c | 44 ++++++++++++----- include/linux/psci.h | 2 + 8 files changed, 139 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml create mode 100644 drivers/power/reset/psci-vendor-reset.c base-commit: 6eaae198076080886b9e7d57f4ae06fa782f90ef
Comments
On Mon, Jul 24, 2023 at 03:30:53PM -0700, Elliot Berman wrote: > Add devicetree bindings for using PSCI SYSTEM_RESET2 with vendor reset types. > > Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> > --- > .../power/reset/arm,psci-vendor-reset.yaml | 35 +++++++++++++++++++ > MAINTAINERS | 1 + > 2 files changed, 36 insertions(+) > create mode 100644 Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml > > diff --git a/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml > new file mode 100644 > index 000000000000..18b0b8c167a1 > --- /dev/null > +++ b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml > @@ -0,0 +1,35 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +# Copyright 2023 Qualcomm Innovation Center, Inc. All Rights Reserved. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/power/reset/arm,psci-vendor-reset.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: PSCI SYSTEM_RESET2 Vendor Resets > + > +maintainers: > + - Elliot Berman <quic_eberman@quicinc.com> > + > +description: | > + PSCI SYSTEM_RESET2 supports vendor-defined reset types. This describes > + the conversion of reboot modes to the reset types. > + > +properties: > + compatible: > + const: arm,psci-vendor-reset > + > +allOf: > + - $ref: reboot-mode.yaml# > + > +additionalProperties: false > + > +examples: > + - | > + firmware { > + psci-vendor-resets { > + compatible = "arm,psci-vendor-reset"; We already have a node for PSCI, we don't need a second one. You can have a separate driver without a separate node. > + reboot-normal = <0x100>; Wouldn't 'normal' be the normal PSCI reset? > + reboot-bootloader = <0x101>; > + reboot-fastboot = <0x102>; > + }; > + }; > diff --git a/MAINTAINERS b/MAINTAINERS > index d516295978a4..2da4c5f1917b 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -16982,6 +16982,7 @@ M: Mark Rutland <mark.rutland@arm.com> > M: Lorenzo Pieralisi <lpieralisi@kernel.org> > L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) > S: Maintained > +F: Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml > F: drivers/firmware/psci/ > F: include/linux/psci.h > F: include/uapi/linux/psci.h > -- > 2.41.0 >
Hello, On 7/24/23 15:30, Elliot Berman wrote: > PSCI implements a restart notifier for architectural defined resets. > The SYSTEM_RESET2 call allows vendor firmware to define additional reset > types which could be mapped to the reboot reason. > > Implement a driver to wire the reboot-mode framework to make vendor > SYSTEM_RESET2 calls on reboot. > > This is a continuation from https://lore.kernel.org/all/4a679542-b48d-7e11-f33a-63535a5c68cb@quicinc.com/ Would appreciate being CC'd on a the non-RFC postings of this patch. FWIW, my use case is better described with this earlier submission: https://lore.kernel.org/lkml/20220122035421.4086618-1-f.fainelli@gmail.com/T/#m74e4243c1af3a8d896e19b573b58f562fa09961d It would be neat if I could leverage your driver in order to implement this custom "reboot powercycle" implementation. Towards that goal, we would likely need to specify the desired reboot "sub" operation alongside its PSCI SYSTEM_RESET2 reboot type argument? Thanks!
On 7/25/2023 12:12 PM, Florian Fainelli wrote: > Hello, > > On 7/24/23 15:30, Elliot Berman wrote: >> PSCI implements a restart notifier for architectural defined resets. >> The SYSTEM_RESET2 call allows vendor firmware to define additional reset >> types which could be mapped to the reboot reason. >> >> Implement a driver to wire the reboot-mode framework to make vendor >> SYSTEM_RESET2 calls on reboot. >> >> This is a continuation from >> https://lore.kernel.org/all/4a679542-b48d-7e11-f33a-63535a5c68cb@quicinc.com/ > > Would appreciate being CC'd on a the non-RFC postings of this patch. > FWIW, my use case is better described with this earlier submission: > > https://lore.kernel.org/lkml/20220122035421.4086618-1-f.fainelli@gmail.com/T/#m74e4243c1af3a8d896e19b573b58f562fa09961d > > It would be neat if I could leverage your driver in order to implement > this custom "reboot powercycle" implementation. Towards that goal, we > would likely need to specify the desired reboot "sub" operation > alongside its PSCI SYSTEM_RESET2 reboot type argument? > > Thanks! I think you you want to describe the PSCI vendor reset under a warm reboot with command "powercycle"? In other words, my series only lets DT describe either reboot_mode (warm) or cmd (powercycle) but not both simultaneously? Please correct me if I got it wrong! Otherwise, I can incorporate way to describe vendor reset type matching both reboot_mode and cmd in the DT. - Elliot
On 7/25/23 13:27, Elliot Berman wrote: > > > On 7/25/2023 12:12 PM, Florian Fainelli wrote: >> Hello, >> >> On 7/24/23 15:30, Elliot Berman wrote: >>> PSCI implements a restart notifier for architectural defined resets. >>> The SYSTEM_RESET2 call allows vendor firmware to define additional reset >>> types which could be mapped to the reboot reason. >>> >>> Implement a driver to wire the reboot-mode framework to make vendor >>> SYSTEM_RESET2 calls on reboot. >>> >>> This is a continuation from >>> https://lore.kernel.org/all/4a679542-b48d-7e11-f33a-63535a5c68cb@quicinc.com/ >> >> Would appreciate being CC'd on a the non-RFC postings of this patch. >> FWIW, my use case is better described with this earlier submission: >> >> https://lore.kernel.org/lkml/20220122035421.4086618-1-f.fainelli@gmail.com/T/#m74e4243c1af3a8d896e19b573b58f562fa09961d >> >> It would be neat if I could leverage your driver in order to implement >> this custom "reboot powercycle" implementation. Towards that goal, we >> would likely need to specify the desired reboot "sub" operation >> alongside its PSCI SYSTEM_RESET2 reboot type argument? >> >> Thanks! > > I think you you want to describe the PSCI vendor reset under a warm > reboot with command "powercycle"? In other words, my series only lets DT > describe either reboot_mode (warm) or cmd (powercycle) but not both > simultaneously? I did not give a lot of thoughts into the different types of reboot (warm, soft, cold) and just went with an extension of whichever reboot type we have to be supplemented by the "powercycle" command. It seems like we should support both the reboot type and command, it would be fine with me if I had to specify reboot_mode + cmd for each reboot_mode.