From patchwork Mon Apr 17 17:37:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 8313 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2293652vqo; Mon, 17 Apr 2023 10:40:17 -0700 (PDT) X-Google-Smtp-Source: AKy350asjgNdlsiu2w2gShfgoxO/e+FDDINGwZekVk0GSTlJbASGB5+5EqkGTnAUyQcr01oemwHs X-Received: by 2002:a05:6a00:240a:b0:639:435:1373 with SMTP id z10-20020a056a00240a00b0063904351373mr21372875pfh.10.1681753216684; Mon, 17 Apr 2023 10:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681753216; cv=none; d=google.com; s=arc-20160816; b=juvOuNL8vn6fYfq0KDEoj3WKQooCq01A4ctdZm1eujKnbPdrvYyfvAFa8gQtliVxxb EpceF8HzyibNNZ1g+WYYQuheZlYznR8VRf1avT9CTGtildqB4hZ6z1pbbd8k7qA0VlVj MO64RhQrHaLPsDwKYPwFPUzyNSkwL2hZhukYFyLLqEgm4N8Y61ihM0klE+PjRDsaFBis 8UL0WThFj4zngmAwikEx+0pXaqsBgFwNxFjMIX13QSMQ2qFH3wOxUOdrpoRSEeB6g/ux 9ePA9rsfFcUOO2LlpQqgUD885MGmNMun0VTzLR4sKsn5f5UlGy6aRIsNJyaHcnVXjyTk c1Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=Y7j5v37v0cFJe7eIrc+n1ZxsUusKsgN3Q+vl+g9FMbE=; b=voKB+At3Hlk+znz93MnYHsfi0WygGs+5PG3NcEXBjkOWMJNKvoUJVzwJc5LOPQGSDm SiIRtQ5LBnm5rPPvpuqJG/FVeuevlOfcRMse8OHEHQwZlFh3XlVv4cWP726qvfrqxhQ/ 7Bc9Gp7UhHvo+LMi3564JthSj2FVC6THuTD7yurO53zG8Zi6MBBi46BFyQJDdpFQvzKw Yn6E1LNk98CHOrR/BSuKPRtrWLQv61kMnv7k8bdhLrI2x15af3LtzFIHLN5zVqpGIFi4 0GHl5ND46r0XWLGj4HFPx6MiiyA/1DDhIAjt4m5QFspvqa3KxPDTtgupqLRuteq3ECUg uNtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VjVQ822c; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a655083000000b005139191c0a7si12519301pgp.787.2023.04.17.10.40.01; Mon, 17 Apr 2023 10:40:16 -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=@linaro.org header.s=google header.b=VjVQ822c; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbjDQRh7 (ORCPT + 99 others); Mon, 17 Apr 2023 13:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjDQRh5 (ORCPT ); Mon, 17 Apr 2023 13:37:57 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CEA31BD1 for ; Mon, 17 Apr 2023 10:37:55 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id x34so13863086ljq.1 for ; Mon, 17 Apr 2023 10:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681753074; x=1684345074; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=Y7j5v37v0cFJe7eIrc+n1ZxsUusKsgN3Q+vl+g9FMbE=; b=VjVQ822cU597IWSHWdLmAs6ETCwssHLxrmNUrhOndk5vY/7Q/320F7otHSk34LxBuH t3vnLA/5WF88Nvr9NmlKAbiryq+F7PKg6Im8E5Ez7b+uwlCyPG2Jru4ppJN3xr6tTL59 tisKCW2sYQFwwUUx1Wxa1MNwsMYJjo4XZaCCuwTxiedSjsnrlcM8kcPGCgJVFfwBe+vc aVHLTqmRXJ3ZxOHY+bSd4F7BjKyU74tYlEvyH08dmn1DDKeEoENQkzhXtHXuTDi/Cu2I haJj9g1zSqS6KQdtYab7M8qgw35CDxMy5H47c7jdBnxfOP5pw6Ed5dzt1WqARIWtdRGH tjwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681753074; x=1684345074; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Y7j5v37v0cFJe7eIrc+n1ZxsUusKsgN3Q+vl+g9FMbE=; b=CJJutNI2fLy2+bcy070SaujZ7P/YqYDJXkcRK9V/CYGwV0TkrFX+n/esGWrWzWHn83 +BquwW8cZnUPwDMxAC96rue9i1str2AEgfpsvz2fl2ACAAVL+woLOg18AQdLLjDQGouC W/qXsy0gt1ZeOyNzronWG1/WaVtQo4bJZE6CTcZuTbaQZXakCdUgIo7epKNOjTEiP1UO uL9rlUtwoMKFwjUAitkWkQ0xJDyEZUOpT/Eh93RJ/OEdHbvnNsA/Awcnk3O+b1TM7zmb OQ0ZtCHQewTgdDiDq2p3flqAVTBxVOvI21PKoM0Zka3C2HRAFxSwrNB0BmbWAzGx76/Q Q6VQ== X-Gm-Message-State: AAQBX9fZkBKdftHzFO0JNZsl/k7vh0u+66L2jjV7TPb4ybxaGAOY/FjJ zoVVpUXsprZgwsGWxdtnrQlDBQ== X-Received: by 2002:a2e:8896:0:b0:2a8:bdda:87f3 with SMTP id k22-20020a2e8896000000b002a8bdda87f3mr1473807lji.31.1681753073776; Mon, 17 Apr 2023 10:37:53 -0700 (PDT) Received: from [192.168.1.101] (abyk99.neoplus.adsl.tpnet.pl. [83.9.30.99]) by smtp.gmail.com with ESMTPSA id h13-20020a2e900d000000b002987088bda4sm2191329ljg.69.2023.04.17.10.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 10:37:53 -0700 (PDT) From: Konrad Dybcio Subject: [PATCH v4 0/2] Introduce RPM Master stats Date: Mon, 17 Apr 2023 19:37:51 +0200 Message-Id: <20230405-topic-master_stats-v4-0-4217362fcc79@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAO+DPWQC/4XNQQrCMBAF0KtI1kaSSavElfcQkUlM20BNShKLU np3p+5EsMs/zH9/Ytkl7zI7biaW3Oizj4FCtd0w22FoHfc3ygwEKFGJmpc4eMvvmItL11ywZG4 QhESNjVY3RkWD2XGTMNiOquHR93Qckmv887N0vlDufC4xvT7Do1yufzdGyQWXRjYIB6V1rU69D 5jiLqaWLd4I6waQUUtLD86avRQ/hlo3FBlgDRisGhAavox5nt8SjrT0UgEAAA== To: Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Manivannan Sadhasivam X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681753072; l=2265; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=XrAEFoYbGavRPeKk7KK+IVW8Jgm3IU8DzAiHjb+PNRA=; b=p4IjNdeAgFb1YAAcIo122wBfDyx7Rxz88aP5J/w9WLb2jxOcIpcRiPX4qjuUwHM5bfbRUgwOVTro Ukq6nLVnCdmHYzgFxcEuDPWxtUGmYgkvlcFf6MRLNtCYW325c2S5 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763446061011923178?= X-GMAIL-MSGID: =?utf-8?q?1763446061011923178?= v3 -> v4: - Use "data" instead of "d" for naming local struct master_stats_data * - Add "qcom_" prefix in the debugfs path - Add "Qualcomm" prefix in MODULE_NAME - Make the struct __packed__ to avoid padding surprises (even though it looks like there shouldn't be any, by eye) - use IS_ERR for checking debugfs_create_file return value instead of nullchecking, that apparently changed.. - Use -ENODEV instead of -EINVAL when a MSG RAM handle is not found - Add missing of_node_put() after of_parse_phandle() - Vastly improve the documentation bit v3: https://lore.kernel.org/r/20230405-topic-master_stats-v3-0-2cb2ba4f2092@linaro.org v2 -> v3: - rename rpm-master-stats.yaml to qcom,rpm-master-stats.yaml v2: https://lore.kernel.org/r/20230405-topic-master_stats-v2-0-51c304ecb610@linaro.org v1 -> v2: - Drop the `-` in /properties/compatible to make our entry be of the correct type [1/2] - Change %s to %d for printing out the iterator [2/2] v1: https://lore.kernel.org/r/20230405-topic-master_stats-v1-0-1b1fa2739953@linaro.org The RPM MSG ram includes per-subsystem low-power mode entry/exit/ residence/etc. statistics which are very useful for trying to debug what I'd call "SoC insomnia", or IOW the plaftorm refusing to drop the voltage rails to a minimum and gate the non-critical clocks. This series adds a very short and simple driver to query that data and expose it through debugfs. The base used for writing this driver is: https://github.com/sonyxperiadev/kernel/blob/aosp/LA.UM.9.14.r1/drivers/soc/qcom/rpm_master_stat.c Signed-off-by: Konrad Dybcio --- Konrad Dybcio (2): dt-bindings: soc: qcom: Add RPM Master stats soc: qcom: Introduce RPM master stats driver .../bindings/soc/qcom/qcom,rpm-master-stats.yaml | 69 +++++++++ drivers/soc/qcom/Kconfig | 11 ++ drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/rpm_master_stats.c | 162 +++++++++++++++++++++ 4 files changed, 243 insertions(+) --- base-commit: d3f2cd24819158bb70701c3549e586f9df9cee67 change-id: 20230405-topic-master_stats-ba201a9af93d Best regards,