From patchwork Thu Jun 30 13:05:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 586253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F0AAC433EF for ; Thu, 30 Jun 2022 13:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbiF3NFs (ORCPT ); Thu, 30 Jun 2022 09:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232771AbiF3NFs (ORCPT ); Thu, 30 Jun 2022 09:05:48 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A4151F62D for ; Thu, 30 Jun 2022 06:05:46 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id o25so6430338ejm.3 for ; Thu, 30 Jun 2022 06:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YiSqVIzhdKNt6jDuv6m0mtfu6qdlxyAFm39nziCEFfE=; b=LdIaWH7US44QX7IILZNcJGjXl7yhOLYLouzEwIoJ+KNAEWGmExBmeIQZ29Suavq9Sq i1CYsIEC7qA0DVrwHA7YP+QX9K9GSmVDeH3gMrPLIBDST4ssWU7wyct5XGwQSSc3CIGB 2Bj+jkPCcjulhWoFk3FltD8ZCS0uh1ilcLU9t5KMSzNulQH4LUuwjNUpm1DPHFDJ9UAE 4DJHwAs7FYpZz8cymBQusgNw5fcwuJVJ+ZibrrksD3bCOscFayGZt/Kt0OpC/rVLM8yR NSaG0wuVOz7wbqxREJ65u90eHApyo+yw6FV9MZayPmbzSwlTXVbSWOH5++gypvQs5aPm X9sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YiSqVIzhdKNt6jDuv6m0mtfu6qdlxyAFm39nziCEFfE=; b=OW6Kz6hlCaTORI0LtYIgycQt7uugWq5sjL1B2xae3frWDOOzbjKFBLqqnPISR+gaRs gnIYlWOBKPK54JwZkCCAbAcxnXL4ACjv/Wo6xNxb6XPa39RR1NahyZxsXINmhGlmdqzm pd7hbxoiH1IeaC+GzxxRraMybEOiL7RhsjPt5E/TtXiL3A3leFP2ieu8z5EZ7d30cwGM ooqlPCGH5JOqHXIsOZLh1eqQORKx2uebY31ZVnXpRX4HV0muRAb/C8MVJgGhqgfM/TrN sl5stuLJ5dXirZi4KKp56nc54+3LQrgPfl01U4wYd9E6ODgrBnxbrNS6HOAu7JAfaB0p GPFg== X-Gm-Message-State: AJIora/4FX+sil6I9CthPZRruLHG2Nl4ZWMHsD6hhB9JgovQLHlx/rEa b0IKollLy9VfnwQ6UoyxHhgCdQ== X-Google-Smtp-Source: AGRyM1tZe+0W4d+ICqLzhJw1k47MwurWZZZ6YzgHwcuZ1uK6sFiwanVofJyXP1RnfwHFxl81sOjW8g== X-Received: by 2002:a17:906:a0cf:b0:726:cbdd:466b with SMTP id bh15-20020a170906a0cf00b00726cbdd466bmr8617602ejb.410.1656594345137; Thu, 30 Jun 2022 06:05:45 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id f15-20020a1709062c4f00b007081282cbd8sm9124967ejh.76.2022.06.30.06.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 06:05:44 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Krzysztof Kozlowski , Georgi Djakov , Rob Herring , Catalin Marinas , Will Deacon , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Rajendra Nayak Subject: [PATCH v7 0/4] soc/arm64: qcom: Add initial version of bwmon Date: Thu, 30 Jun 2022 15:05:37 +0200 Message-Id: <20220630130541.563001-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, Changes since v6 ================ 1. Patch #2 (driver): use MSM8998 compatible. Changes since v5 ================ 1. Rename compatible (and files) to qcom,msm8998-llcc-bwmon as Rajendra suggested. Keep the reviews/acks as the change is not significant. 2. Update comment in DTS, update description in bindings and in Kconfig. Changes since v4 ================ 1. Patch #1 (binding): Use qcom,msm8998-cpu-bwmon fallback compatible, only one interconnect. Rename to qcom,msm8998-cpu-bwmon.yaml. This reflects discussion with Bjorn, about the proper fallback compatible. Driver was tested only on SDM845, so only that one compatible is actually implemented. Keep the reviews/acks as the change is not significant. 2. Patch #4 (DTS): Use qcom,msm8998-cpu-bwmon fallback compatible, only one interconnect, use the LLCC bandwidth in OPP. remove unused irq_enable (kbuild robot); Changes since v3 ================ 1. Patch #2 (bwmon): remove unused irq_enable (kbuild robot); split bwmon_clear() into clearing counters and interrupts, so bwmon_start() does not clear the counters twice. Changes since v2 ================ 1. Spent a lot of time on benchmarking and learning the BWMON behavior. 2. Drop PM/OPP patch - applied. 3. Patch #1: drop opp-avg-kBps. 4. Patch #2: Add several comments explaining pieces of code and BWMON, extend commit msg with measurements, extend help message, add new #defines to document some magic values, reorder bwmon clear/disable/enable operations to match downstream source and document this with comments, fix unit count from 1 MB to 65 kB. 5. Patch #4: drop opp-avg-kBps. 6. Add accumulated Rb tags. Changes since v1 ================ 1. Add defconfig change. 2. Fix missing semicolon in MODULE_AUTHOR. 3. Add original downstream (msm-4.9 tree) copyrights to the driver. Description =========== BWMON is a data bandwidth monitor providing throughput/bandwidth over certain interconnect links in a SoC. It might be used to gather current bus usage and vote for interconnect bandwidth, thus adjusting the bus speed based on actual usage. The work is built on top of Thara Gopinath's patches with several cleanups, changes and simplifications. Cc: Rajendra Nayak Best regards, Krzysztof Krzysztof Kozlowski (4): dt-bindings: interconnect: qcom,msm8998-cpu-bwmon: add BWMON device soc: qcom: icc-bwmon: Add bandwidth monitoring driver arm64: defconfig: enable Qualcomm Bandwidth Monitor arm64: dts: qcom: sdm845: Add CPU BWMON .../interconnect/qcom,msm8998-llcc-bwmon.yaml | 85 ++++ MAINTAINERS | 7 + arch/arm64/boot/dts/qcom/sdm845.dtsi | 37 ++ arch/arm64/configs/defconfig | 1 + drivers/soc/qcom/Kconfig | 15 + drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/icc-bwmon.c | 421 ++++++++++++++++++ 7 files changed, 567 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,msm8998-llcc-bwmon.yaml create mode 100644 drivers/soc/qcom/icc-bwmon.c