Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp947473ybg; Wed, 3 Jun 2020 18:59:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFL+OpwBvVsfdMEbb7yhYzJNyQMJPbvBS/19oE9V6mOVg0NLjwbp/8yjR5N+Jrf0bgICRo X-Received: by 2002:a17:906:6156:: with SMTP id p22mr1798763ejl.329.1591235951935; Wed, 03 Jun 2020 18:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591235951; cv=none; d=google.com; s=arc-20160816; b=zq0LE+7goHovovTix+381574AQ3APyN0UsF0NYNuYMYHg+aWi676lKM1HG/0H3aKBH Dk6x4Bq674W7a/J2VVhZop5tn+fqsZeeXxK14lSaHBmuTlbB+EQxubCPdvhYxiDndAZI 1eIdj7lcGtorKaz9PI/qPBk0irXpPyYmhrQDEh8YPJCXUUHnsHYyCdkyqpBVPDkhhJ4z iacH7ZnLOp3G3z/YUF7YR9CFWawl42bSGr3IvEjEfakogkRoF656cp7d6D+bDA5udKDS PFDN41ZnXk+ZB3SP+IjEZ0msSdW6ZVV6kvitlZnLznRaQ//8a+WHAl9XvyuJ8+NYWi36 6gXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=M/aBGpswVv6maZErzhj2cA/GWvid14/WP8iAXA5RYds=; b=IHfpjw+oD+EtbPEW+UqlAbgyZ2tAuAe3gIg1eRiNUGkAaIYGFepaxUYJQak31mGMqi ufXmVJIOBSQSFwofPMeNNayjhqliHu71IklqQYuwEcKTc7Xluf9/Ln2aao+uptQHjFMu ONnfwlQwck29AV+g/8ZXeuGp6eZtMUfsoe9rjnwrbhbZQA92S9roFJYwS35J2R7U7IYx EUA78KJsBzDbTPRWTW7GIpvJQAkMc3hf5exFzgiDLszsXhzoPgkx1ZpkZLjtjc5Y4Zfb 3RF67EzJJhh/7qCxE6nMmROK7HkNd28x4L0VkXHBHotoV9G4cLEPVV7mB7UaoLo97ofp nqdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SwblQzt1; 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 g15si764705ejh.346.2020.06.03.18.58.49; Wed, 03 Jun 2020 18:59:11 -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=SwblQzt1; 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 S1727992AbgFDBxV (ORCPT + 99 others); Wed, 3 Jun 2020 21:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbgFDBxU (ORCPT ); Wed, 3 Jun 2020 21:53:20 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0383C08C5C2 for ; Wed, 3 Jun 2020 18:53:19 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id w9so3973196qtv.3 for ; Wed, 03 Jun 2020 18:53:19 -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=M/aBGpswVv6maZErzhj2cA/GWvid14/WP8iAXA5RYds=; b=SwblQzt1kdFZTiYHtpL/Nk56Df7+NKanGfHYdrba6r5nkmLI2W+4j5HEJoqExqwKQA +/+svgVr/wuzXCmJxU453OMsaz5fIgO9/jvlV8ZKpzaPiHy/VPR0l3iazpjoO14TWH1A 6o3LT0+BWDZT992O3QbToU8Yi1jG/koloy93t98E3/Babcre2hUoY4fww4BEMapbYBbc RmHxca4z8bvbm6jV8UQIplrDSxG18wG65ATDlxg0K31fHy2THw+ZlZdphSS4CQVIklzk m4IUARo673EJE+w6BuiQLuDqABDL5f8E4KpDgpZwvtbd8KS4A87qHPav/CQnG6dp2TSX SIeA== 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=M/aBGpswVv6maZErzhj2cA/GWvid14/WP8iAXA5RYds=; b=B1ETPFxsRZQ+2hQbvbD7l+Ytxt5dAMRnd0ZVLsBEUTkMCRX7x2VkCyMGT+Fd365V3J 9PZoNrd1yhTDzl1gM0jWKNZu3yThGdWGpmhX6lWy3lvkYgYK0EU2SlHFHl9nAJ0XSvi5 nhsQqv1Ewe3TKXsk4Fq/+m/jIKjng/pP9KANph5iwP+jExNuAHouZujiCcPBKCVQnnk5 4Sf2dA9TgrxIAl6AX1GSIQMVvY/KlWnAUb+AyIamAsI7gWwY/v7WfiVNb5kEMFOongBN xyNg7lt6STtR5zgDhiYlSpzHaw8g06bENghoobkrazSn0HwW9RtLB9yFarUPOYKF9GzP qamA== X-Gm-Message-State: AOAM5307WcghEY8x/sYKEzDUwTOaZv2n6OFehVNGHGZFg5Xa8kZwOH61 sAjLkx1JeGoYpfuq6v+a4zr62w== X-Received: by 2002:ac8:108b:: with SMTP id a11mr2337950qtj.173.1591235598781; Wed, 03 Jun 2020 18:53:18 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id t74sm2986439qka.21.2020.06.03.18.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:53:18 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org, robh@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 v6 0/6] Introduce Power domain based warming device driver Date: Wed, 3 Jun 2020 21:53:11 -0400 Message-Id: <20200604015317.31389-1-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 a new cooling device register API that allows a parent to be specified for the cooling device. 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) v3->v4: - Dropped late_init hook in cooling device ops. Instead introduced a new cooling device register API that allows to define a parent for the cooling device. - Patch specific changes mentioned in respective patches. v4->v5: - Dropped the patch that introduced the cooling device register API with parent as per review comments from Ulf. - Patch specific changes mentioned in respective patches. v5->v6: - Rebased to latest kernel - Few other fixes identified in the review process mentioned in respective patches 1. https://lkml.org/lkml/2019/9/18/1180 Thara Gopinath (6): PM/Domains: Add support for retrieving genpd performance states information soc: qcom: rpmhpd: Introduce function to retrieve power domain performance state count thermal: Add generic power domain warming device driver. soc: qcom: Extend RPMh power controller driver to register warming devices. dt-bindings: power: Extend RPMh power controller binding to describe thermal warming device arm64: dts: qcom: Indicate rpmhpd hosts a power domain that can be used as a warming device. .../devicetree/bindings/power/qcom,rpmpd.yaml | 3 + arch/arm64/boot/dts/qcom/sdm845.dtsi | 1 + drivers/base/power/domain.c | 37 ++++ drivers/soc/qcom/rpmhpd.c | 25 ++- drivers/thermal/Kconfig | 10 ++ drivers/thermal/Makefile | 4 + drivers/thermal/pd_warming.c | 169 ++++++++++++++++++ include/linux/pd_warming.h | 29 +++ include/linux/pm_domain.h | 13 ++ 9 files changed, 290 insertions(+), 1 deletion(-) create mode 100644 drivers/thermal/pd_warming.c create mode 100644 include/linux/pd_warming.h -- 2.20.1