From patchwork Wed Oct 16 19:37:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 176517 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp7827148ill; Wed, 16 Oct 2019 12:37:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHIVh6A/hvl43bQARf1VI5q884ar5a5hzZfnntMgIQqHwcUubgTBys7xicL7yWjChsemNC X-Received: by 2002:a05:6402:b16:: with SMTP id bm22mr41553896edb.160.1571254651005; Wed, 16 Oct 2019 12:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571254650; cv=none; d=google.com; s=arc-20160816; b=Q03PA/P/SPeZ4EjKuKBny1mccH9k9QUnz665LCg2yPXRCR5r4nqeofp/w/nAfElfrb Z4XNppDhIkfeOsrk2qVMDqkFl2pkU2jE4uN3YUsng5kiNIHkBiHtAE/Qpz7acL4XtAQw QpYiDNGXPaSf4uITJ4aY/9sCthzWhRz0VLmgNxixI1nmSy9Wbhzg9Ryp2qIFv64G+3X0 kY+SEFfEvvjpVxnMkHDNx1+cUA8sV42kfYsUbLAZCByFu1xr/QH2lQbmQPFA1di2SaSm n3X/LEqw/RpfwAO8NF7xu4R8SFRe/1gCFXhsD9oNgEEjMXrJ+MMC2QeJsEBlTiMMR1av UdWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=mJHOakKVvshLG3Rzud38KEbOaNx+SThGCVNUUHA+c8k=; b=ZKOeHYQBPuZwmHxjN3YXVINvsBjIfQKvfKIbP2F+RMz/wn+GAvycpqtzF8Aq5UbWkl ownx+H1rxgvxMpeC+BLESGe2zaYemFfZ7OlCJaLqveN2Su2WcgSG7jwYBp9YRob52pX3 885Ut8L93e0p9KbvLp7d+YQ98r5HBtp0G83e1aa3ZlHzpdVgOmeEWDNJlNWMl1wHZ+LI 1CPsrzrB8ppzvKBsWBdjiPwIslQ+Y0WraFq0ZEed8FSZxnFlKGQL0BMHsnaxQylliy7n X8dM0x3u0XAk0AJPoy44DP+xtHqAFwqN9uglfpVQln/7iLqv/gTK1S3ztEKpRhJNpIbF ueRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w5G4rO6c; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b20si17195091edc.359.2019.10.16.12.37.30; Wed, 16 Oct 2019 12:37:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w5G4rO6c; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 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 S2389265AbfJPTha (ORCPT + 8 others); Wed, 16 Oct 2019 15:37:30 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:34114 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728779AbfJPTh3 (ORCPT ); Wed, 16 Oct 2019 15:37:29 -0400 Received: by mail-qt1-f193.google.com with SMTP id 3so37961413qta.1 for ; Wed, 16 Oct 2019 12:37:29 -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; bh=mJHOakKVvshLG3Rzud38KEbOaNx+SThGCVNUUHA+c8k=; b=w5G4rO6cnoFzj2kF84Hr/GZtHT1Zve5j9WyjVpVK9JFX1mk/AvbZfE6glsJsrQ2bHZ d5BOsKSptJU5C1rkmoLn0qoBb/KDjamoVhNZQGaVK8YXrI5KcY4G4SHD3Y4lnNwXm4zd NmfTkknFJgHcYV9nVtUW8GTl+JrglpLjDPrfw5xC5bCBkIMICrkq32IqMFGPeZ+Rzc7t VZrraGhKRx+Z7vFexQpkgnUDhj+9WXA2uS/1/4J+kd1U2cQhs9M1HOwkxln44HNgMUiW GJ/mMZoochmYSU5FNxeRWPETGriXjfl6QqyVWhLFx8gwcRWSDYZb6/Wn+LJrVuDrsRtW /v7A== 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; bh=mJHOakKVvshLG3Rzud38KEbOaNx+SThGCVNUUHA+c8k=; b=dq7/oPpRZHeRJZ+rZrJ4jAyCItu+Uklh1zzWtzTdPZ0MrbP1b8uUTrzzAhK6HJQ7Mg Wa/rSGDQvcmCwgXswxLMX5Gd1t5ktTkxdf2gw7VMT9aGWrhoSUfujOf6I5FamabsTT7W LMFWTLTSN+YqE6l8mVf3W/ywgdlr/uZL8ZiJZ1zO65SvKNBZBGv3q/CusMdVrLYCij16 ekt9LQFNdUxNsTEX/XbfpGGWrw55LbxS7VWlW/tP+N5/1ww6Tyn2RIHV816OfW5egWMv 9ZiMT9AADZ0u04Au4tsh5zmyUrlblJbeedRwENw31SAp1nYlsgYeBQh8MqqzpJ0QSRTx bmyg== X-Gm-Message-State: APjAAAVYVWg2iMClaa3i2Cp7CSURMsPq/eL6Tpe1bjgeQGiM1ieKlpgT vlQFnplHpwEi2p7lq79uNb0RMg== X-Received: by 2002:a0c:c10d:: with SMTP id f13mr44317850qvh.88.1571254648443; Wed, 16 Oct 2019 12:37:28 -0700 (PDT) Received: from Thara-Work-Ubuntu.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id 54sm16246030qts.75.2019.10.16.12.37.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Oct 2019 12:37:27 -0700 (PDT) From: Thara Gopinath To: edubezval@gmail.com, rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/7]Introduce Power domain based warming device driver Date: Wed, 16 Oct 2019 15:37:14 -0400 Message-Id: <1571254641-13626-1-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Certain resources modeled as a generic power domain in linux kernel can be used to warm up the SoC (mx power domain on sdm845) if the temperature falls below certain threshold. These power domains can be considered as thermal warming devices. (opposite of thermal cooling devices). In kernel, these warming devices can be modeled as a thermal cooling device. Since linux kernel today has no instance of a resource modeled as a power domain acting as a thermal warming device, a generic power domain based thermal warming device driver that can be used pan-Socs is the approach taken in this patch series. Since thermal warming devices can be thought of as the mirror opposite of thermal cooling devices, this patch series re-uses thermal cooling device framework. To use these power domains as warming devices require further tweaks in the thermal framework which are out of scope of this patch series. These tweaks have been posted as a separate series[1]. The first patch in this series extends the genpd framework to export out the performance states of a power domain so that when a power domain is modeled as a cooling device, the number of possible states and current state of the cooling device can be retrieved from the genpd framework. The second patch implements the newly added genpd callback for Qualcomm RPMH power domain driver which hosts the mx power domain. The third patch introduces late init ops for thermal cooling device that is called after the cooling device is created and registered but before binding it to a thermal zone for specific initializations. The fourth patch introduces the generic power domain warming device driver. The fifth patch extends Qualcomm RPMh power controller driver to register mx power domain as a thermal warming device in the kernel. The sixth patch describes the dt binding extensions for mx power domain to be a thermal warming device. The seventh patch introduces the DT entreis for sdm845 to register mx power domain as a thermal warming device. v1->v2: - Rename the patch series from "qcom: Model RPMH power domains as thermal cooling devices" to "Introduce Power domain based thermal warming devices" as it is more appropriate. - Introduce a new patch(patch 3) describing the dt-bindings for generic power domain warming device. - Patch specific changes mentioned in respective patches. v2->v3: - Changed power domain warming device from a virtual device node entry in DT to being a subnode of power domain controller binding following Rob's review comments. - Implemented Ulf's review comments. - The changes above introduced two new patches (patch 3 and 4) 1. https://lkml.org/lkml/2019/9/18/1180 Thara Gopinath (7): PM/Domains: Add support for retrieving genpd performance states information soc: qcom: rpmhpd: Introduce function to retrieve power domain performance state count thermal: core: Add late init hook to cooling device ops thermal: Add generic power domain warming device driver. soc: qcom: Extend RPMh power controller driver to register warming devices. dt-bindings: soc: qcom: Extend RPMh power controller binding to describe thermal warming device arm64: dts: qcom: Add mx power domain as thermal warming device. .../devicetree/bindings/power/qcom,rpmpd.txt | 10 ++ arch/arm64/boot/dts/qcom/sdm845.dtsi | 5 + drivers/base/power/domain.c | 37 ++++++ drivers/soc/qcom/rpmhpd.c | 30 ++++- drivers/thermal/Kconfig | 10 ++ drivers/thermal/Makefile | 2 + drivers/thermal/pwr_domain_warming.c | 136 +++++++++++++++++++++ drivers/thermal/thermal_core.c | 13 ++ include/linux/pm_domain.h | 13 ++ include/linux/pwr_domain_warming.h | 31 +++++ include/linux/thermal.h | 1 + 11 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 drivers/thermal/pwr_domain_warming.c create mode 100644 include/linux/pwr_domain_warming.h -- 2.1.4