From patchwork Thu Nov 3 19:52:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 15146 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp737807wru; Thu, 3 Nov 2022 12:56:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4IrdpZPbr59XjNxa7/3l0u29M8919QH55i9BpIiKbuDCHmRWy1q1v7Pgjz1xxo60A434Kr X-Received: by 2002:a05:6402:386:b0:463:c43f:6628 with SMTP id o6-20020a056402038600b00463c43f6628mr14761708edv.53.1667505402049; Thu, 03 Nov 2022 12:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667505402; cv=none; d=google.com; s=arc-20160816; b=jT6V4hV70vNcCdLIXe+UU1eYy86LetCg97+YC4mWqQgeq1vZPn/fpsFEEtSVX2qrLI Ez/SoeWK3oLfQKReTAJa3azH4yMTJT5VAG622l/P59DFCh1FBUwZhF3hUtIAJ0izwH8b CCAp/BXnivHAyBXJXWEK+oQoiV0RLTaqlQPVEo9Yj2/kIBp4nBVb9dZfsWMQ5ut6TjBb 43s6IIidGEJB9O/59kKQ4VgTYnqYQYe2Enos/7bR/ARm7afhpa9kx4i6orWzgkt9WBNc hCrgF63lbwuUM4TsgKgje1nbJbsmisOFwZMOXa56igvBpKGh5v9+ubxqD2xbg2Otm1KC vA4Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=S5ZciLOIw53Dnbdfukxfk8D8sxPmWsYbGpOHR271uiI=; b=KB8mwmcEkoShxuIHuaDJFc0aQ7r7l3jhomtNTQYnOgIr8wG38WEV67Lztk/78a59nK aQSzCEnzNdvteQOQBEjFGyxKBH3cHnBjK/yp+Zf+vJ4gJNZnWDgKKQ6612aJOWGgwADs n+YmuuSRfrF+xiEokzh12XL4DVhYAr/U086hIJAfREa5XNsPFxiMB1NqGMjX/v09lhF7 JeLCtkP5M/F47v/7mgo/544EME1XTK0as8rqXjgWpdV62T0etENLHvx1de2Ad8i5I/Va TjxnOLMezLF6MJjjWeVHDqPrcjMqy8hUCCnmYVBYeg4FYhMfw2r9jLmXqSyhLvzHSji4 rUrA== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a50c2d1000000b004571c47b13csi1756633edf.418.2022.11.03.12.56.15; Thu, 03 Nov 2022 12:56:42 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231401AbiKCTy0 (ORCPT + 99 others); Thu, 3 Nov 2022 15:54:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231304AbiKCTxS (ORCPT ); Thu, 3 Nov 2022 15:53:18 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D2ED20187 for ; Thu, 3 Nov 2022 12:53:17 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F2B412FC; Thu, 3 Nov 2022 12:53:23 -0700 (PDT) Received: from e120937-lin.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0D9663F534; Thu, 3 Nov 2022 12:53:14 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, wleavitt@marvell.com, peter.hilber@opensynergy.com, nicola.mazzucato@arm.com, tarek.el-sherbiny@arm.com, quic_kshivnan@quicinc.com, cristian.marussi@arm.com Subject: [PATCH v5 12/14] firmware: arm_scmi: Create Raw debugfs root dentry Date: Thu, 3 Nov 2022 19:52:23 +0000 Message-Id: <20221103195225.1028864-13-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221103195225.1028864-1-cristian.marussi@arm.com> References: <20221103195225.1028864-1-cristian.marussi@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748506144325497048?= X-GMAIL-MSGID: =?utf-8?q?1748506144325497048?= Create common root debugfs dentry at driver initialization time. Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/driver.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index c5bc67a9c103..bbb43b65cbfd 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -14,8 +14,11 @@ * Copyright (C) 2018-2021 ARM Ltd. */ +#define pr_fmt(fmt) "SCMI - " fmt + #include #include +#include #include #include #include @@ -154,6 +157,8 @@ struct scmi_info { int users; }; +static struct dentry *scmi_raw_top_dentry; + #define handle_to_scmi_info(h) container_of(h, struct scmi_info, handle) void scmi_notification_instance_data_set(const struct scmi_handle *handle, @@ -2839,6 +2844,14 @@ static int __init scmi_driver_init(void) if (WARN_ON(!IS_ENABLED(CONFIG_ARM_SCMI_HAVE_TRANSPORT))) return -EINVAL; + if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) { + scmi_raw_top_dentry = debugfs_create_dir("scmi_raw", NULL); + if (IS_ERR(scmi_raw_top_dentry)) { + pr_err("Could NOT create RAW top dentry.\n"); + scmi_raw_top_dentry = NULL; + } + } + scmi_bus_init(); /* Initialize any compiled-in transport which provided an init/exit */ @@ -2863,6 +2876,9 @@ subsys_initcall(scmi_driver_init); static void __exit scmi_driver_exit(void) { + if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) + debugfs_remove_recursive(scmi_raw_top_dentry); + scmi_base_unregister(); scmi_clock_unregister();