From patchwork Thu Jun 24 11:58:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 466340 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp382193jao; Thu, 24 Jun 2021 04:58:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybYpRMPk4dyQI8iqtyEW9CLtll4j2Ombhd4gkFveAYqFGR6p3tpxatvzVu8Ehn7b+4agGX X-Received: by 2002:a05:6402:12da:: with SMTP id k26mr6679850edx.10.1624535897473; Thu, 24 Jun 2021 04:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624535897; cv=none; d=google.com; s=arc-20160816; b=uIINFB6Fj/5kfO00d/Uyr5VvKnmXMZxkYWQSPWWGtxUfMOtx4+ehskxk7/+Dq7yYS2 WxPhTk8ajA9A1P9L8T8Vob2nEpL9rL96Xzaave3WT6/ri7zwyqEHNifknAciSqAQLium iHXlS/F20SfkCORPAgm39oLVXGcdyNxiuhO+NgLmTcZtjRxxvXqXM8ear3+NTI0HUuLa kaRvoe7+VLUeMMILMBsovymBdVZ1LREPBIRIaxTnwrolL2k45BjxbJKUvmjG7kTwzNUu NQ1xS8joevvB4lb95JSu8S+9ZpxL0Ki+h3xIpgCv0QQvc0Ag0Esi0R2YWojay4aUD0D1 Ytbg== 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=GiOCSBR5YWAnUQKJMF2IE6Qn98PN7KJoXFnLLLJkgSJsDGdIKp7N6s2sMVfl4L38Yo AivyPLwXXB19MN1A27Hor8V6JxlytkKAgXgH83e1sz40hlK7OSDdd0SoE5Bhia+QJcvP YVPnhXtXWqwvDkacziWk3X3CjHeWGs5yhtx0EUJtkLNFkJOvDwXUBBSJp4+EI4LFdAem JYi8LRN8Q+Nvk3p8oieY7MPcfAcViRu1Yg1fAe8u3c75T+Zfl6tpaR6krwzdzI74lIq8 wG0xwxr4XPHGPFIQoUH4AdoBp3YRjOSlck1MYI91UdtMTY67jTO4iDoB8anOdbqugS+n LPAA== 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 j12si2600954ejj.20.2021.06.24.04.58.17; Thu, 24 Jun 2021 04:58:17 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S230087AbhFXMAf (ORCPT + 7 others); Thu, 24 Jun 2021 08:00:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbhFXMAe (ORCPT ); Thu, 24 Jun 2021 08:00:34 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9D0FC061760 for ; Thu, 24 Jun 2021 04:58:15 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id o6so13741598qkh.4 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=FQELZQYbgCptw7YhNdEPro3dk/RdgxaoZspTIR2cOAugAZLwAhiNZfKttRho8D2yMC 9AUt45VQ7/khXQ/7f83Z4h0/2vNSS6JbDlu/5//MiUTGN0X+k0o0JFePsekfrO8JOKGF 2qKekU+EKIkkncMhL7TqaLCKA4SCFS4U1E73FvOzjdCycw62+jYaGlYB1vmuGKyty0bK Jp6g6NMOS9vml411IfEXte7V55ny97nwa0W1Li4iNdVkwPj9ndw5lbMOtsngbQDZoRZH yjye0KkyRqDftGHaRomMvLaHKQWcoB/1IIXtJGKDmIMOiwqLAXNHVtweDVIH45/1E+C6 vIiA== X-Gm-Message-State: AOAM533uFj1cXfIuMBZF12Fo9ecF9iSd0ptRzt1G00/7C5wM6xSKc5yu EoHmKOUI9t3hpKTj+8/zceKyHw== 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@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