Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp126981rwb; Wed, 21 Sep 2022 18:50:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64+Bp1uBxS26bQAOI2VW9h1UiDWg8m1mNVm9aX6tOh6QC5ClXzEIp1dg5rtVAT0XQ3iI9+ X-Received: by 2002:a05:6402:124c:b0:454:61b8:dea0 with SMTP id l12-20020a056402124c00b0045461b8dea0mr913007edw.200.1663811427268; Wed, 21 Sep 2022 18:50:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663811427; cv=pass; d=google.com; s=arc-20160816; b=HF/ukIxAWvTfseWgeM3+wkh3Sc377d5PyWBzoyRsaqS38PYvuIYc/iIM6t4a7dVN52 dPahvjN+QdWlbTKJHn33JD2ujy/eUEAkFSpZgNh+89vnn8ERoPPu+C/dMGevg81jDUyF WlacRBD0a8gQF++9DiX3OMfN2HVRTy0gUyhti4XhMek291Wei3LUqTU2A724d/s2aAoB xBKMj9tUb1i3kCaGaPK1JFl/GYuMMJ9F9JhxnHEJtuHj8LAuo6C08aHepZUJEfYlT7hw +jlnduV0KPkE+522EuttwzvUmbtvrnsgUD2sgwtYerCyMpdwuXhGpB/6lURJT/YSpFEP YeFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=jrwnkemrR/YKQaFyjth2zbQCFDwhaaEEZmlUkTgHepo=; b=XRiBfFwV571bWWW8LM1zSlqG6rkbHoMeHG5Ec3wIEit3cIiPwckvode3fM6rGD6o7Q bQ5g/sn6hOTUtNMinoQxZP741tGa20OAZ57UlfRh/8Dy1d0P147bk+qYl0zSZaR01+fp vPoK/GX4bRdRcncU75QIohJ1hk9x21DhFDE0cmMQwk2Um3w+8nHALE7Ups3hm6OyGDk5 CuMwcP+H0xCrWirprNFOMHUb3p9LC9kZ0ExDH+q1txwVGOa9rXbyQyERA5tw8Af4UGQm X+PNBO6Dhcxwk4UfEM97h8U/6C+TwpfDPIRxUZcSNtR5Xv6px9N5v0zZHQ5sfZqk44W2 wptw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=P+1Ev9cN; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a170906348a00b0073ffabc3352si3210303ejb.836.2022.09.21.18.49.19; Wed, 21 Sep 2022 18:50:27 -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=@nxp.com header.s=selector2 header.b=P+1Ev9cN; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbiIVBLx (ORCPT + 99 others); Wed, 21 Sep 2022 21:11:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229986AbiIVBLu (ORCPT ); Wed, 21 Sep 2022 21:11:50 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50049.outbound.protection.outlook.com [40.107.5.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B24594CA0C; Wed, 21 Sep 2022 18:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KpE4V+7Kx6qEwhb/32Y9oZXyNiHQ3SV1kNSjmkSXXle+S7vC3CcCxLOXFH8oTQS4/PQdXhUU3FbEz1pO+QXILDkpw2H0WcL84xtwXLbkJrb+ZJTiu5FxHFEp9Rkpi/CUBj3JDVtRjm4XgLtENJjsOZ4Tsy+mdnObELeEWMNmv4Uf58cCbbks/ZlKuC4aQ6iGWVli+WozRzOqycgak47rW5pbAqi4hwEk8CSUsLkf10JyX7Q/uOGZhSnu+zTiU544efoDQpou/z+AnVEIU3KZ5IF8/blMOXwGPg6JyMTkIEsaH66nu2zT276t4Yuso60z7kiwjNMbnqNLDSs8ED51ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jrwnkemrR/YKQaFyjth2zbQCFDwhaaEEZmlUkTgHepo=; b=FT7hpANcjmiL57w4PW1ueRR8DxLyYqoyTSty9mIeS8fVP8/ywUjj8rG5vCFwGbnt4FNOQ3/6PCSokulTpq87V7oFZAX98P+XGRWULqLmN/4latvf5vb0jhTvNbjHcIt643/kX79iALycLyWtj1nswGCrxaN9/GBMNu4Zkw6osT21kIcZk3GnBYC7DVTQyjWY6+psqIPkHLwop/R8ysZu8nMFgnFfofQuK2yP5FUJ53bXsGINx0DiWVr2PRYDVWaGLDtHs9t8vLLNZJzX7SJ+WorGoi2//y4u4JCcyVuGsUiWPpzqQoNBTEy+5NLeM+AtVCgcUtU+gpHBNbkctCiBTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jrwnkemrR/YKQaFyjth2zbQCFDwhaaEEZmlUkTgHepo=; b=P+1Ev9cNCWGklELMAYB17DdjIrqVMITzVMqSJiEx3uZkvG2lUCp0LhZt79xWug6TMI8t70cB3FGEoOZme4AZ71V1nlv9l2JgPe2b/b/9VU+qyNCSnA9TUbTLb2Cq4DvnyDl3H/pD+2BIHLYnFIMQV9FyEsJcGnsowQnz6JJU5j8= Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by AM9PR04MB8698.eurprd04.prod.outlook.com (2603:10a6:20b:43d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Thu, 22 Sep 2022 01:11:45 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1eb:dcf:8fd7:867]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1eb:dcf:8fd7:867%5]) with mapi id 15.20.5654.018; Thu, 22 Sep 2022 01:11:45 +0000 From: Peng Fan To: Gokul krishna Krishnakumar , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier CC: "linux-arm-msm@vger.kernel.org" , "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Trilok Soni , Satya Durga Srinivasu Prabhala , Rajendra Nayak , Elliot Berman , Guru Das Srinagesh Subject: RE: [PATCH v1 1/1] remoteproc: qcom: Add sysfs entry to detect device shutdown Thread-Topic: [PATCH v1 1/1] remoteproc: qcom: Add sysfs entry to detect device shutdown Thread-Index: AQHYzEehbNqp+4WP5kC4mL0JhZ+SEa3qpRCw Date: Thu, 22 Sep 2022 01:11:44 +0000 Message-ID: References: <42d3ab9227ac3d299abcedbbdd68c86e1dd6acce.1663604826.git.quic_gokukris@quicinc.com> In-Reply-To: <42d3ab9227ac3d299abcedbbdd68c86e1dd6acce.1663604826.git.quic_gokukris@quicinc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU0PR04MB9417:EE_|AM9PR04MB8698:EE_ x-ms-office365-filtering-correlation-id: 879076f6-b645-4fc5-68b6-08da9c376a81 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KUTLYUX4qnIR64HlU4nVcYhBfk9majHo1WgqkT+0aHpif8cZ2ud7HUmHu9n5RIUB1qVy/G6HmWBbIxRVQPWvxoTe96LV1wzusznXVwOe3Fl1EEfKqFSRrzNS3cy9vlFV0GKzsKEOJ09+Jr5zMrjhBvEzW7Mk216pBj3oyFTUefYkqh9wuN15nxugRx4NFCqvAR/NxBqoI1jh0hnuNQWudZhy/qcLMYwVWl5qfrQBvbkn5h4HkpBwWTd23S7JWHjMKpjoUEMBL9jB4h/pBpPCn5JkKI//vX2BOLKl/U5EuA9FnOVRd6DLE8UaB3faP3H2T8i8X70Yr+Bg+BcH+qZtKidLtiCxoinqRbyulq5OzmlX5KjYmJPBnXuSI2Tmfs9oY9UQH1gZbyiGIEDb0AvJwqLT2Wnr+qVfend/ZZHQX+yTnM5uYhdb4dsSgMoWPaTjvaZFYZK4YulVVqi8fBcpcFmlYvPhoYsZLNHjzf6Ff/GAK6WWGdHmmzjqx5vClj7mZ68UiBvhYe6tvOzvulzADg0mUnjcxJZk/+4NNHBsAKFyMFtQuWnw9n6NrL6Q92d+Hrquiy7rqfV+Fd0DRpo2/v5etIOMq8PfW7D5lP9fvwws/ZmZ5zRZ+rdYaC+WFLn0d1VFNjplokqL9K9YukDguwScJ64keoxSwEk6w+e2zsNs9D7nVIwleDSSmXkpegrqcExTeVKdF9WtbrTgG908L9e0gPtdm7MgUAWjSmuNG3H3lMjcDTxCAw//HyyDJ5azmMn1dnhuXmpAuQBqbJamIA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(366004)(39860400002)(396003)(451199015)(8676002)(110136005)(66556008)(55016003)(64756008)(478600001)(5660300002)(66946007)(66476007)(52536014)(8936002)(7416002)(66446008)(316002)(6506007)(54906003)(4326008)(76116006)(9686003)(71200400001)(26005)(2906002)(38070700005)(186003)(83380400001)(7696005)(86362001)(33656002)(41300700001)(44832011)(38100700002)(122000001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7mmgV2hLiF1Qg59d8VO1GLKcWQDf4NtQzURanDhXpBsrdRsI4yaicKhV2stB?= =?us-ascii?Q?NkSxnr0wFzjVhtxfFg7u1+zHW4zGiU4r1kdYhcRxr8eUfCeg/rG0Peu3H/pQ?= =?us-ascii?Q?0O234pE9gvBStlnFsZEfGsCuVgm636/EUahe67gYCAVcbUrYLD/Yw/X+LYnM?= =?us-ascii?Q?j4HMBD+WWGLM4CsI6XFAP/P04CM1NbvfQ1G45ISXEhIO4mcBGR2GLVU++EGM?= =?us-ascii?Q?oUyrADzPM/13frf1nSa5Zvufw1mkpZaQ8Z0TO73jt5sO/pwq2LDJuHqqLum9?= =?us-ascii?Q?6jnmycq0leOzSA4ldYf/Oos/xxoLgHONylbB9vRbvy/Tz+l0LHtGcVLJkynB?= =?us-ascii?Q?IFh2b8PRU73aF61Ok6/r44t4kT2Buo2toIjGoUXwjkYxKTQfap+UNuUpq3Cy?= =?us-ascii?Q?ugmiceD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auy70X8?= =?us-ascii?Q?oXbTF/WvYgYrsoQmJVqB1646ZuqetBlhbaLPGIiNI3FYXqQ1Yt6673aqtPkx?= =?us-ascii?Q?t7PDeneV5Li2PuogUrEeSa3R9AHGZY18LRzDIY+0aZHn5qLtPAUFEyLL0YOG?= =?us-ascii?Q?7sGAwBXh9F05TkpXjX8DKeFtPLkjZ9sA9TlGnaSD61OJwbxXDEtpGvYInu7o?= =?us-ascii?Q?9LNhMGqKA2sh+La2YPh3sExILgNcubMmeRaJyjmwx+Y8tVOq1XkwYDm1J6Mi?= =?us-ascii?Q?GzqgjoIvo/StufQJIk8=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 879076f6-b645-4fc5-68b6-08da9c376a81 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2022 01:11:44.9721 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: R951k6Mb1v47/K7kZRpRSJtaVlfL+Ok9VYZSWLoPbnc86eJeo0YYwMDQ++FGRyZxaW2rc208R3daGBteQ72iew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8698 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_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 Hi Gokul, > Subject: [PATCH v1 1/1] remoteproc: qcom: Add sysfs entry to detect devic= e > shutdown >=20 > This change adds a sysfs entry which indicates whether the device is bein= g > shutdown to the qcom remoteproc drivers. This is going to be used in the > following patches. I have no knowledge of qcom platform, just a few generic comments: I think it would be better if you post a link to give people a full picture= on how this going to work. >=20 > Signed-off-by: Gokul krishna Krishnakumar > --- > drivers/remoteproc/qcom_common.c | 58 > ++++++++++++++++++++++++++++++++++++++++ > drivers/remoteproc/qcom_common.h | 1 + > 2 files changed, 59 insertions(+) >=20 > diff --git a/drivers/remoteproc/qcom_common.c > b/drivers/remoteproc/qcom_common.c > index 020349f..7959e96 100644 > --- a/drivers/remoteproc/qcom_common.c > +++ b/drivers/remoteproc/qcom_common.c > @@ -87,9 +87,32 @@ struct qcom_ssr_subsystem { > struct list_head list; > }; >=20 > +static struct kobject *sysfs_kobject; > +bool qcom_device_shutdown_in_progress; > +EXPORT_SYMBOL(qcom_device_shutdown_in_progress); > + > static LIST_HEAD(qcom_ssr_subsystem_list); > static DEFINE_MUTEX(qcom_ssr_subsys_lock); >=20 > +static const char * const ssr_timeout_msg =3D "srcu notifier chain for > +%s:%s taking too long"; I not see this variable is being used anywhere. > + > +static ssize_t qcom_rproc_shutdown_request_store(struct kobject *kobj, > struct kobj_attribute *attr, > + const char *buf, size_t > count) > +{ > + bool val; > + int ret; > + > + ret =3D kstrtobool(buf, &val); > + if (ret) > + return ret; > + > + qcom_device_shutdown_in_progress =3D val; > + pr_info("qcom rproc: Device shutdown requested: %s\n", val ? > "true" : "false"); This is a sysfs write operation, how does it matter with device shutdown in progress? > + return count; > +} > +static struct kobj_attribute shutdown_requested_attr =3D > __ATTR(shutdown_in_progress, 0220, NULL, How about DEVICE_ATTR_WO, but seems you use 0220, the generic marco use 0200. > + > qcom_rproc_shutdown_request_store); > + > static void qcom_minidump_cleanup(struct rproc *rproc) { > struct rproc_dump_segment *entry, *tmp; @@ -505,5 +528,40 @@ > void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr > *ssr) } EXPORT_SYMBOL_GPL(qcom_remove_ssr_subdev); >=20 > +static int __init qcom_common_init(void) { > + int ret =3D 0; > + > + qcom_device_shutdown_in_progress =3D false; > + > + sysfs_kobject =3D kobject_create_and_add("qcom_rproc", > kernel_kobj); > + if (!sysfs_kobject) { > + pr_err("qcom rproc: failed to create sysfs kobject\n"); > + return -EINVAL; > + } > + > + ret =3D sysfs_create_file(sysfs_kobject, > &shutdown_requested_attr.attr); > + if (ret) { > + pr_err("qcom rproc: failed to create sysfs file\n"); > + goto remove_kobject; > + } > + > + return 0; > + > + sysfs_remove_file(sysfs_kobject, &shutdown_requested_attr.attr); > +remove_kobject: > + kobject_put(sysfs_kobject); > + return ret; > + > +} > +module_init(qcom_common_init); > + > +static void __exit qcom_common_exit(void) { > + sysfs_remove_file(sysfs_kobject, &shutdown_requested_attr.attr); > + kobject_put(sysfs_kobject); > +} > +module_exit(qcom_common_exit); > + > MODULE_DESCRIPTION("Qualcomm Remoteproc helper driver"); > MODULE_LICENSE("GPL v2"); As I recall, checkpatch would report GPL is enough, no need v2. Regards, Peng. diff --git > a/drivers/remoteproc/qcom_common.h > b/drivers/remoteproc/qcom_common.h > index c35adf7..90b79ce 100644 > --- a/drivers/remoteproc/qcom_common.h > +++ b/drivers/remoteproc/qcom_common.h > @@ -34,6 +34,7 @@ struct qcom_rproc_ssr { }; >=20 > void qcom_minidump(struct rproc *rproc, unsigned int minidump_id); > +extern bool qcom_device_shutdown_in_progress; >=20 > void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink > *glink, > const char *ssr_name); > -- > 2.7.4