Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4488884pxv; Tue, 27 Jul 2021 08:31:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycljOJJtyu5F7m7Sd1+LvNKOEt5sHbGPgLyfAk0XlbMelWKK3D2yDS2YU+RYyA3l902t0+ X-Received: by 2002:a05:6402:1456:: with SMTP id d22mr8227951edx.143.1627399892225; Tue, 27 Jul 2021 08:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627399892; cv=none; d=google.com; s=arc-20160816; b=zYU1OY9aycG2Puqs68yJ/5RxKnI2eRiO4wllAfM9mTkXAtaIKNgb7yW8+wmXR4a2o4 nlTzNznFFNaeYHxSr2390838TLr/Iii3939TYUne5cHH7OXv1B6hLNyLqURt9ThOrwhm s54EifO4+BQsmrCPMBqFGxkVZd77nfaI8qo843hWO+AeYK1mDPp9IpHYlxyUaEoSKlFE aQpvp0HYdZW/qrKvwOVF5r7dW6JI32nZ+zL/gM4QIIQQecwVjVOCSLWsGX5xEVVTI3Ib 8CGKkG9V66JaCzTdhPklG4Nh7oD0ZDSJu0wjjc5h+buw4BbexmipM+Fjb5O/AY1SiCuy ftEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=GT96W2ZOEoojDz5M8pDOb9+CTD0yhAQtMG6GVe4JdkQ=; b=WVRWBfW/HR8ZbRyH47hXPWZcGIHny0IXfXeKz78F9Rd4+M/UUeAjwGbKIxGcqcwi01 sbYyxvhkDYQ18Dfl6IK96lNmmtB8YtT/SBox9IJ/SRzGoIvRGlqqlMdnQmOzkE0+CyBx XwQWlnnI4QN09BW3dLW0SE+vWjwKN2XPHn3dwINoN3kiUHPfMzDnXPalNbbS3dR0AgZM AxXSV1qy2sIDvwQfVgPnw/7S/I24KQ6GWD28DrE7rNAO6L3bBE+EvYFEhZ7r/gg9L9t2 Kof9KvUw1DRS/T8fxJNXC0/Esr2aAYKUa86i/1x5z56tBp7NQ/FqKz/eD5fLHUs8Mnn1 zQ2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eDL7hgQB; 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 g14si3058738edu.31.2021.07.27.08.31.07; Tue, 27 Jul 2021 08:31:32 -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=eDL7hgQB; 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 S237124AbhG0P3n (ORCPT + 99 others); Tue, 27 Jul 2021 11:29:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237160AbhG0P3j (ORCPT ); Tue, 27 Jul 2021 11:29:39 -0400 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F130EC06136B for ; Tue, 27 Jul 2021 08:29:17 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id w6so7044524qvh.3 for ; Tue, 27 Jul 2021 08:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GT96W2ZOEoojDz5M8pDOb9+CTD0yhAQtMG6GVe4JdkQ=; b=eDL7hgQBA0PqGEhVymQR4EUNmyBuVlMS+hOW9vVkHPrNMZ5p9Y5HgqRd0MEoYfHM6I kR+qSGcRQoIdlaeN58IDQE1rvuLJ1KowYhEm5TKPiQlxaAGBL/VVBSn1YJjOgaqVTrBe RcwfGdbqn7k2nm5QZGte++YY5cyVnn45Wdk/mw9yJndD4M5aFx0q3z8awE/IfnyEEIMw 7q/+jEwlrjEKFeLipGYCNB33JZ1siGwdust1Z/kbqqSnKNiVsAyYPyQvI43+VjeSA4Fe V6k+U333Drl+tea60+2SZUcnhbxUsyCAAxdh5qHeJYV2IXuQ3EJ1MCdLte+w+mYiFUDA ue6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GT96W2ZOEoojDz5M8pDOb9+CTD0yhAQtMG6GVe4JdkQ=; b=i5H1X4L7rx1RqfYhYEfvYCveHupjtBdfpLrpFZ+zqisrUph+Kj+fuc7s4ttPrYArPx Q9L3DbzCHSI3SdD7RZG1i8estM80PaaimN5DW16SAmRW2Kt/5wnibpFFCXZv1kO83xzl p0MnIpfU5UU4WXDpZ1BflFcKxsF8XSZKSmX+qB9HU+rZMlFDXoEkQriipIemQKRLl4z4 eU24B9sDbjy75AlUeREMo/3DzgHZITIDP7Qn9XdhuR/IHAHLZRP4fLRc+rYdyKvYpwPH MjXD6STmEN9QOxjNcnKGxYea6NVOTdVBi2PQgv/hYhO4BxmLvKo97jT0pPxXvkXoD6jW DmeQ== X-Gm-Message-State: AOAM531IQj/BE85TC1fdgApyorAL+nKDA68kb3FjYeDlP9kr1iUPgbS7 ZEXbLL4s4UMTXmSLeyrYFxZGHg== X-Received: by 2002:ad4:5c4a:: with SMTP id a10mr10256122qva.59.1627399757087; Tue, 27 Jul 2021 08:29:17 -0700 (PDT) Received: from [192.168.1.93] (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.gmail.com with ESMTPSA id n13sm1415537qtx.92.2021.07.27.08.29.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Jul 2021 08:29:16 -0700 (PDT) Subject: Re: [Patch v3 0/6] Introduce LMh driver for Qualcomm SoCs To: Steev Klimaszewski , 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: tdas@codeaurora.org, mka@chromium.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20210708120656.663851-1-thara.gopinath@linaro.org> From: Thara Gopinath Message-ID: Date: Tue, 27 Jul 2021 11:29:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/21/21 11:14 PM, Steev Klimaszewski wrote: > Hi Thara! > > On 7/8/21 7:06 AM, Thara Gopinath wrote: >> 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 >> >> v2->v3: >> - Included patch adding dt binding documentation for LMh nodes. >> - Rebased to v5.13 >> >> Thara Gopinath (6): >> 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 cpufreq cooling devices for CPU >> thermal zones >> dt-bindings: thermal: Add dt binding for QCOM LMh >> >> .../devicetree/bindings/thermal/qcom-lmh.yaml | 100 ++++++++ >> arch/arm64/boot/dts/qcom/sdm845.dtsi | 162 ++---------- >> drivers/cpufreq/qcom-cpufreq-hw.c | 118 +++++++++ >> drivers/firmware/qcom_scm.c | 58 +++++ >> drivers/firmware/qcom_scm.h | 4 + >> drivers/thermal/qcom/Kconfig | 10 + >> drivers/thermal/qcom/Makefile | 1 + >> drivers/thermal/qcom/lmh.c | 239 ++++++++++++++++++ >> include/linux/qcom_scm.h | 14 + >> 9 files changed, 570 insertions(+), 136 deletions(-) >> create mode 100644 Documentation/devicetree/bindings/thermal/qcom-lmh.yaml >> create mode 100644 drivers/thermal/qcom/lmh.c >> > I've been using these patches on a 5.13 kernel > (https://github.com/steev/linux/tree/linux-5.13.y - while trying to > track down a different issue, while playing a video on youtube, as well > as compressing a 9.2GB file with xz, I got the following Hi Steev, Thanks for testing this. I was unable to reproduce this. I have posted v4 moving the interrupt handling in qcom-cpufreq-hw to threaded interrupt handler and hopefully this should fix the issue. It will be great if you can test and let me know. -- Warm Regards Thara (She/Her/Hers)