Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp616852rwb; Tue, 25 Jul 2023 23:16:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlHKXLX1Iodkq+MLYwT56rjIhRb285vR699HZc87nJVBJ1RwoQa6zmAoV+D4xWSrVN33ykVA X-Received: by 2002:a17:906:9bea:b0:99b:c985:cf7e with SMTP id de42-20020a1709069bea00b0099bc985cf7emr390907ejc.54.1690352196014; Tue, 25 Jul 2023 23:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690352196; cv=none; d=google.com; s=arc-20160816; b=Mg9MM6XuzVW1s3SyIugS12taWAd5FhNsdNxGOwbuMmZfp5x/eKsj/i7WWEdjybIDDY pt62ufk2lhptHEcwkLKpBZxTVuImPSbMUXCWoadpGdt6D5g2MjIrSAXL5CvQ2LIw8f3x 8jaeWLSzPkRt7bq42KUM0+PIFD25abZBkHz92nbK7Mk284gbZpXDvBa1rEJ0g+iK2NMr g+/mFx9/MjtiBK8dyP8ismys8Zkksw0H8C5r1khDhoy+zlDCPGIZ3ZGd8Yc2xJyvSv2j HB3KSc/i7cuDCbQyYri6QOfwP8qNWvC987wlEuWo6PnZsVgO9nZCi/ifbgwfT8LJk+zs FcQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ykITIp4s0lCi1UIGjfiPGkvre4fdRjy5qd4zJo1PJ1c=; fh=MjTULAwrjq6Yc8Ngv2nTGT7VrCpD3JwPsJ+twNXh908=; b=0woFjchAC8KRsbAjAg5dpgUySVUuoyvu561MnCopLPQVIctBXzmdNvs9z4A0rmcc/z 6Q/JLp+o9c1u8cg07xH9j/Ztlh7SYx+KHrBwRIjS0bK7/GRDThx3y9qRW068GgtDjwVn 6ZRBsl3+K9pdYQbJedACHSsBFHBSR3q6GDCgHy0JqC920JykCAXVRtuUNDXdFfwWyLhw 8S8shQJmN+PjMgDc9xcWXr92Uih7RiGeoluWcnThQJuFvrLYsmGj9Lrg76LH+1KoHiTK EaoXX8hjEbtN2uW6+YkX/tH1hS8iAEZwpfJvD5xwn6nMlvORf9vrzWZwXBCLFbkZREMG 10CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bKqCy6wE; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id se5-20020a170906ce4500b0099bcb5694b5si106087ejb.209.2023.07.25.23.16.12; Tue, 25 Jul 2023 23:16:35 -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=bKqCy6wE; 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 S230391AbjGZFK5 (ORCPT + 99 others); Wed, 26 Jul 2023 01:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbjGZFKz (ORCPT ); Wed, 26 Jul 2023 01:10:55 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B852D1FD5; Tue, 25 Jul 2023 22:10:54 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36Q54QPl026955; Wed, 26 Jul 2023 05:10:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=qcppdkim1; bh=ykITIp4s0lCi1UIGjfiPGkvre4fdRjy5qd4zJo1PJ1c=; b=bKqCy6wEnne8Xu3F/Z51Rmv+GB4yOTj+ZHWNmAfGURylVyvwM9gKCD3Sn2kYeX4wbGnO cNtxjvrlEbZ8q2g8MQOnk6ZsfTgCvwUy2elk1RZI3j6gvEl7A9ZcF94tPp3EmYM5fpN/ 9af7PfmS0fp2y9mi0AtCrUOuab/G27nhIt6tU8wJ/6SNA1Ls/YS+7BbiZzkayVXLLfuR smJ/ZfUkU4cqlIqccwBOrLpNFtTSAK502wahEdZAvcNNQkIM3rZpUFAGaaB9FQt8CSRW aroOmoXiWcvp3wSlCyCYO5R3PHcNZmuS/VE4NArDr4XNFnfFflde3/MiWYq1WtdhOxp+ 1w== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s2fms1rj9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 05:10:46 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36Q5Ajeo010962 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 05:10:45 GMT Received: from hu-pkondeti-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Tue, 25 Jul 2023 22:10:40 -0700 Date: Wed, 26 Jul 2023 10:40:36 +0530 From: Pavan Kondeti To: Elliot Berman CC: Mukesh Ojha , Mark Rutland , Lorenzo Pieralisi , Sebastian Reichel , Krzysztof Kozlowski , Conor Dooley , Rob Herring , , , , , , , "Satya Durga Srinivasu Prabhala" , Melody Olvera , Prasad Sodagudi Subject: Re: [RFC PATCH 2/4] power: reset: reboot-mode: Wire reboot_mode enum to magic Message-ID: References: <20230724223057.1208122-1-quic_eberman@quicinc.com> <20230724223057.1208122-3-quic_eberman@quicinc.com> <27d9bd35-b69c-5596-8e1a-c42ec2b01f75@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: EjL6WBDZzb5QTKF8NxwqVX90bcXTldzQ X-Proofpoint-ORIG-GUID: EjL6WBDZzb5QTKF8NxwqVX90bcXTldzQ 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-25_14,2023-07-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 suspectscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307260044 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,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 25, 2023 at 02:04:28PM -0700, Elliot Berman wrote: > > > On 7/25/2023 3:03 AM, Mukesh Ojha wrote: > > > > > > On 7/25/2023 4:00 AM, Elliot Berman wrote: > > > Allow the reboot mode type to be wired to magic. > > > > > > Signed-off-by: Elliot Berman > > > --- > > > ? drivers/power/reset/reboot-mode.c | 30 ++++++++++++++++++++++++++---- > > > ? 1 file changed, 26 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/power/reset/reboot-mode.c > > > b/drivers/power/reset/reboot-mode.c > > > index a646aefa041b..4ea97ccbaf51 100644 > > > --- a/drivers/power/reset/reboot-mode.c > > > +++ b/drivers/power/reset/reboot-mode.c > > > @@ -22,12 +22,8 @@ struct mode_info { > > > ? static bool get_reboot_mode_magic(struct reboot_mode_driver *reboot, > > > ??????????????????????? const char *cmd, unsigned int *magic) > > > ? { > > > -??? const char *normal = "normal"; > > > ????? struct mode_info *info; > > > -??? if (!cmd) > > > -??????? cmd = normal; > > > - > > > ????? list_for_each_entry(info, &reboot->head, list) { > > > ????????? if (!strcmp(info->mode, cmd)) { > > > ????????????? *magic = info->magic; > > > @@ -45,6 +41,32 @@ static int reboot_mode_notify(struct > > > notifier_block *this, > > > ????? unsigned int magic; > > > ????? reboot = container_of(this, struct reboot_mode_driver, > > > reboot_notifier); > > > + > > > +??? if (!cmd) { > > > +??????? switch (mode) { > > > > IIUC, mode will be filled up with reboot_mode during restart > > notifier and not reboot notifiers ? > > > I went through the patch in isolation and came to the same conclusion on why you are using mode directly here. Now that it is clarified, why not use reboot_mode directly instead of introducing restart notifiers here? Also you might want to clarify that we are using reboot_mode as fallback to wire the magic. Thanks, Pavan