Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp145489pxv; Thu, 24 Jun 2021 04:59:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl17iLYbGXWAdiwpp8JKhcMwI+fLbcM5mrPfH55FSJx1LlgOC0k3aGwbSdtnN9bqaWQheZ X-Received: by 2002:a05:6402:158c:: with SMTP id c12mr6392940edv.335.1624535975130; Thu, 24 Jun 2021 04:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624535975; cv=none; d=google.com; s=arc-20160816; b=yETQubQpikEtXk7ZWcilnrSx90fVDlRS/4YddFDBFlr24EjuhfS3+xYFlVzsRDnfYr 53OKaB+gxW/bWiiMXlgKHtftERv1tNWfQjdk45FPKNPiUTw1Jch52OolM2OeP9vBatir zXCOwegApkdQrcVogltbsCJezfJ4NsIzTzPp4EmQixI5nxXtaCsgGE/Wyp5VRkhC9ZHR 9/r0wYBNFM8V1+6XJ6puZuD+W6VyTrxVRrB1RVgp1vX4Ky4gWYoLg9sGK9sX77Dlb3zr 4hkVR6T2pgrkUufMohefT6MmstiELgrxE7KzK4wO26cbxQ8B9Kfweb0Dy6krDlPJ0VyY Srew== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=WwLl5u4O61O74++WtE584Gux9OkK2rj8VPrz5kolkEg=; b=vHHEajHSfPwn/Yf91Nd2ALA4TXsfcDugVuOLQWTwW8mhOHVBnuvQwjxkwKonrC8eul S9kLGWE6gfj3RFqMb/7Z4yGREmICGgCp3Nft1Dmd6wPU+3bGlVBoXw4eM6NBLBZl16hs +c1skEydJv4of+MADQDUudXpREfajXj79gSxpKSzLv/nF9RbKwaLE1lBuqM2w+qXH+lS F/2zlCNHMmvb5uu+cSF4JK36ZvYc3yn1YCWEc4hy7Xq4puR75/lrWMdeIy4Hdd9gSqiB 3ibSu6dB99xObl+gN9uO1yKH1CQ7ef1BzlOtVdxe+MAYOMBM8kdvM0k0+wUoCnRTShKc C9sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BuGZElxT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ze15si2649841ejb.147.2021.06.24.04.59.12; Thu, 24 Jun 2021 04:59:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BuGZElxT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230249AbhFXMAg (ORCPT + 99 others); Thu, 24 Jun 2021 08:00:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230188AbhFXMAf (ORCPT ); Thu, 24 Jun 2021 08:00:35 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF9F5C061756 for ; Thu, 24 Jun 2021 04:58:15 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id g4so13784324qkl.1 for ; Thu, 24 Jun 2021 04:58:15 -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=WwLl5u4O61O74++WtE584Gux9OkK2rj8VPrz5kolkEg=; b=BuGZElxT9d2bPp2vJ3vm68V2zqLXycPZwaWV34SKRJk62Y/5FLpPjFZ9aZEl4HnxAH KUNVELYQjKXq7lelDdrWgZ0+XR2J9ruLsQJkRTm3jIb+4866+W5KZ2zjpxe5A9M8Gf4B m869/dhLJ/NDDPSFsT9Bc0r9YksuDMb4BIriuhQIG3hpznS2OQcPv/pdurz1wtHb7RFY HcKVXsq8J/eI7wrbbDFYPh6yZ7FwqT/SsjQwO6oVwDtLPyBxu5gC4A/HX9WDqltUhQ1L 6kSnmdnfW7wt3qUVlVm9Y615+9XmIMvF4S2Drs07odpyes1u3LHptBIPqwK0zTcSdjmX rKWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WwLl5u4O61O74++WtE584Gux9OkK2rj8VPrz5kolkEg=; b=M9HRxn/w3tSpAk8fyrbZC12KziOt3RzPnyFGujLpwHlzlvQuEALnxKA3NtoWazw5LY 8WN+7p7GHB+vc5IHtUQXfUQ9eO58elsumKNTwktlXzeDgZFXMiOT0WFjbLEmnqCsZdgM Q0ncQ1VtBLFneEGuGBRUNVT+9vzIXs+2YXFETt3C7EzbqT6QAJjgyafJTwL7TneaDmAF HULOatNBKlTVdZnA5ildyPqxtsqqdWCXu7CftQqPIDtvG+vHaI6LHfEXg0BDv25X/dze 3WT8ER8WwN3o2g4fRRTsNwzf6BN4Dq0yG0uXh+oUOxFCxXn8fLx4HDVBVLtEvIVv160O GnUA== X-Gm-Message-State: AOAM530gUFSA0vxRNQH8Gtaik67yndoOduyAwaYtDv/0de1ePtOACRpH zOhHyZKjv0X/tb6ab6QLDECGvA== X-Received: by 2002:a37:6244:: with SMTP id w65mr5390624qkb.304.1624535894939; Thu, 24 Jun 2021 04:58:14 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id w3sm2287173qkp.55.2021.06.24.04.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 04:58:14 -0700 (PDT) From: Thara Gopinath To: agross@kernel.org, bjorn.andersson@linaro.org, rui.zhang@intel.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, rjw@rjwysocki.net, robh+dt@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [Patch v2 0/5] Introduce LMh driver for Qualcomm SoCs Date: Thu, 24 Jun 2021 07:58:08 -0400 Message-Id: <20210624115813.3613290-1-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Limits Management Hardware(LMh) is a hardware infrastructure on some Qualcomm SoCs that can enforce temperature and current limits as programmed by software for certain IPs like CPU. On many newer SoCs LMh is configured by firmware/TZ and no programming is needed from the kernel side. But on certain SoCs like sdm845 the firmware does not do a complete programming of the h/w block. On such SoCs kernel software has to explicitly set up the temperature limits and turn on various monitoring and enforcing algorithms on the hardware. Introduce support for enabling and programming various limit settings and monitoring capabilities of Limits Management Hardware(LMh) associated with cpu clusters. Also introduce support in cpufreq hardware driver to monitor the interrupt associated with cpu frequency throttling so that this information can be conveyed to the schdeuler via thermal pressure interface. With this patch series following cpu performance improvement(30-70%) is observed on sdm845. The reasoning here is that without LMh being programmed properly from the kernel, the default settings were enabling thermal mitigation for CPUs at too low a temperature (around 70-75 degree C). This in turn meant that many a time CPUs were never actually allowed to hit the maximum possible/required frequencies. UnixBench whets and dhry (./Run whets dhry) System Benchmarks Index Score Without LMh Support With LMh Support 1 copy test 1353.7 1773.2 8 copy tests 4473.6 7402.3 Sysbench cpu sysbench cpu --threads=8 --time=60 --cpu-max-prime=100000 run Without LMh Support With LMh Support Events per second 355 614 Avg Latency(ms) 21.84 13.02 Thara Gopinath (5): firmware: qcom_scm: Introduce SCM calls to access LMh thermal: qcom: Add support for LMh driver cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support arm64: boot: dts: qcom: sdm45: Add support for LMh node arm64: boot: dts: qcom: sdm845: Remove passive trip points for thermal zones 0-7 arch/arm64/boot/dts/qcom/sdm845.dtsi | 162 +++-------------- drivers/cpufreq/qcom-cpufreq-hw.c | 103 +++++++++++ drivers/firmware/qcom_scm.c | 54 ++++++ drivers/firmware/qcom_scm.h | 4 + drivers/thermal/qcom/Kconfig | 10 ++ drivers/thermal/qcom/Makefile | 1 + drivers/thermal/qcom/lmh.c | 251 +++++++++++++++++++++++++++ include/linux/qcom_scm.h | 14 ++ 8 files changed, 463 insertions(+), 136 deletions(-) create mode 100644 drivers/thermal/qcom/lmh.c -- 2.25.1