From patchwork Wed Feb 24 18:30:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 386873 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp593389jap; Wed, 24 Feb 2021 10:31:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrEc3u+QK9UFinUTSGFDInWZK2xfsRWwZSbLuhfU6R+5nljkbyWzzSxZtAeqtr6x+Dlz4T X-Received: by 2002:aa7:de8f:: with SMTP id j15mr35176350edv.268.1614191476063; Wed, 24 Feb 2021 10:31:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614191476; cv=none; d=google.com; s=arc-20160816; b=Inv9OiiNnbdBTeUxLor8HkgWxkUM5e6vFcgMdHLKKWS9GMcZERkp3MM5VmDumRoNXC XiHVvGIvixSCHC0h97tCgD7632nOuHRHRJ5Aq9A0JPk1T9wuNysOxsCpS/9EK6OdCNBu Pn6329bCG0DkKu/Zw18Mbvw02aQvGGCt6y+hjf6l5bJMy6iRj1pc+SRq09D9nOciUl3G 5CgR0sM0JIAdKzWtr5Nxlj7N36msp63HsUoT6Z0b8St4YEwTWusDMAvxl/Z+YgHzDJSQ mlP29KhQRrZMZReak1XQRGt8VIAyd+bPB7lUT7H8qT9otqYOLCWMJ715c39mcvXuBefd 5mRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=HNg21NrFFSzG03akl4ik4jz1Jh6GwsesirJ9uxFbwiU=; b=kdz6Vt69eYm3/C5AGgWbbJks3Fuvdbtt5gYUNrHqXlJ2VxWqvGAaMDDAgRyHz05ZBi ln7GBIzyP74EWlwUTYxpW+rGoryR4z7/llcHykz0MTPsruz1w4mTqdJJ9jjleLk7JTdv g7hATiW429+8JYlMOAzfcj5yv20dsiSk8uqlpJNp3MSvv0MM1H1zs43qTtbYvo+kNiot z7+scCnWC0w1t9XK6P+iYmOQPMZxr0qSiPZMB3GEVta4HVMdNoK8CruaUnqrnNCR3ZpD yU2flb/2o1SsAjRJfGZltg4Y5Rke4Jz7X0oYqfYcBIOO2ezbb+nHfOFpYiJt9jHRJlTV wulg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mu++/MQT"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 h17si1816305eja.457.2021.02.24.10.31.15; Wed, 24 Feb 2021 10:31:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-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="mu++/MQT"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S231895AbhBXSbO (ORCPT + 7 others); Wed, 24 Feb 2021 13:31:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbhBXSbN (ORCPT ); Wed, 24 Feb 2021 13:31:13 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73B1CC06174A for ; Wed, 24 Feb 2021 10:30:33 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id e10so2618853wro.12 for ; Wed, 24 Feb 2021 10:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=HNg21NrFFSzG03akl4ik4jz1Jh6GwsesirJ9uxFbwiU=; b=mu++/MQTLxhrxBnIq7qWduUGmbOCTgcpg/K1MUKyzsPEvgWoczFajqUT2PUn1tyqty 88/iOpznl4DdlFoWt5bbEW8G+TWi2W2NaODfzFYFIqW7wlB0o7S7FkdXU7RmYJziWvWE uw7ZQspVgYGALyjNfRDxE8mA0MlnlQhKUBiWjdJ/FtGugpdAsUCdeuv7ljurlnMUDO1q XlAqJTQn42+dFtqhRvpwy98i2REuaJKoi0J64R4ekhZVivfZ83dVbg6n5WMzxX1aaQG6 cV1EaqPusecLBLtdTmM++T2xseC5nGB9Qww8/N/9PCQOZY0Y0gfzzncNSImga6iY6Hvs zGvw== 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=HNg21NrFFSzG03akl4ik4jz1Jh6GwsesirJ9uxFbwiU=; b=B8+Py/0HHZBnHU+8DDLQ4zluLGUieHj8Ic0FCYls4Jf8VdCPUdntZ9BEOzdqsc8Vw2 G7KsI6jww0hOF6As8jfMjFE2k6f4WTsfC+ef+1foOZkjtBFyTB5lcTqX5l+lI3E19akb gFDhwc4gMGd4el/M5fb3PnnRphYxoeq9diHDlaLxPgTD848qcU39lhafA4/+PRgQ1YBW 3G99eBvgUjtNL7Ra2n9RlOWnnJtsIKez6MRlhs5cUcjAKMzEdZZFqzPdX5xyfmcc8/Ud islTp7FGlqfjeBXx9RtO/JY32AF6o33E8K+DKHPQ88CQMtGCruoeGcDrr3A12rWzAAtw 7CLg== X-Gm-Message-State: AOAM5330oyxs7FqMCsl3zzhf7I6NowZbt1NUp3S8CbW6MXKzfRiRxE6u HLP+VqhAqSgL6gXm+Ycs0NL4QQ== X-Received: by 2002:adf:8151:: with SMTP id 75mr3926866wrm.152.1614191431901; Wed, 24 Feb 2021 10:30:31 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-157-252.adsl.proxad.net. [82.252.157.252]) by smtp.gmail.com with ESMTPSA id c12sm5105987wru.71.2021.02.24.10.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 10:30:31 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Date: Wed, 24 Feb 2021 19:30:21 +0100 Message-Id: <20210224183022.11846-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The root node is not set to NULL when the dtpm root node is removed. Consequently, it is not possible to create a new root as it is already set. Set the root node to NULL when the last node is removed. Signed-off-by: Daniel Lezcano --- drivers/powercap/dtpm.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c index 5a51cd34a7e8..c2185ec5f887 100644 --- a/drivers/powercap/dtpm.c +++ b/drivers/powercap/dtpm.c @@ -207,6 +207,9 @@ int dtpm_release_zone(struct powercap_zone *pcz) if (dtpm->ops) dtpm->ops->release(dtpm); + if (root == dtpm) + root = NULL; + kfree(dtpm); return 0; From patchwork Wed Feb 24 18:30:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 386874 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp594295jap; Wed, 24 Feb 2021 10:32:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6AIEQSuASSuQa9ZlXiObqsCzekLWWeMw5MSBhb8b3AAO1vGS1p82ig2lkNHXSpb00Wr4v X-Received: by 2002:aa7:c90f:: with SMTP id b15mr26021349edt.51.1614191554541; Wed, 24 Feb 2021 10:32:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614191554; cv=none; d=google.com; s=arc-20160816; b=x26WUKeAkYRbdZ6TpjhzOpwCQzHDFQwJ64fvJ6t8lKiD0NmlB9De6gRTsnIGFAy4GQ e0Y2FZoHcpvuOfnqsG2wowTqhtIvInqSqR+mC1Ku2FbEIxdCW/8MKHuuqSc0dRgJxF1E HP2wXLou1nnFUqBM75WbJtqmQnODTMQzA2tqGOOUYq9O5dMpffg6MOd23LhysfG/1jOL NZ2k33MKULfER6MLg3oMLAamspXyHps0BXhW03BSyd7UgQFGC3NBV2HT5jlRAHTs9L/7 C6GRlJEKa/LcmiPd0mDGHuBih8O4oa0K+A8MT9cAJZCrDEw/ZIeyhbdpbiQJeaZF6Mev P5fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=wL1K9/n9PLRogotOLHvr5IREgjJjcX+pqPJAFHVOgkU=; b=fBLSXTDwAubITb2af8qSCegkOK2O13Ic4LqGVsIO5r1c6fYbqw2UF5MqHluY1Egm5p ChJQ+O7ixZ9bECIH8Y+0DyV4eY1I7h6YL1/EFN04k3uBjevzQv0uIHmz6FB0M5aks8ZD +bAGyYK8FMqatCOjbfR4HLICYEdA+q2T8oiQjwvLTQye3UmqI6lJya6uIqNlgWlCAhC4 mxFS49H6qtLLc48cSQ/zOK/CC9SjSRlySiz/LdN6S/yjk2CYzj0eVUsBM7LbscN9NCjI J6UayFPwgJpXxXgeYnjdqGkTN3dstf9tr7nNMOaQgk0+cnbxNZFQCOHgb7ndwRDhgEjo s2Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h8fU3PBt; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 x9si1577242eje.236.2021.02.24.10.32.34; Wed, 24 Feb 2021 10:32:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-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=h8fU3PBt; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S229599AbhBXSbS (ORCPT + 7 others); Wed, 24 Feb 2021 13:31:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233443AbhBXSbR (ORCPT ); Wed, 24 Feb 2021 13:31:17 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3211C061786 for ; Wed, 24 Feb 2021 10:30:36 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id p3so2632043wmc.2 for ; Wed, 24 Feb 2021 10:30:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wL1K9/n9PLRogotOLHvr5IREgjJjcX+pqPJAFHVOgkU=; b=h8fU3PBtSJjDPXgYs4/F4zTb4uHPnuRvghS3AJGYylHqnn11+oCHrRntCw2aOZXOnr KVy23orYJRYTnNI2w2+woHMgi1WG/1OgBES/Lu/gu0gfZG+SVaSFZJp4hzHUBHUAFLBK Fu3bbUnpoF/vzDJ0BXmUCMzl9qVuStBA/Hxqs2qVQ5ReNcTSvuoigefy2BE3zyn050Tc 8tuawF1aelGfd8OPDaGtCb2e4jO61uwnO/E6/aIrQyKMSQHYCo073eDsYBe/gFO1aFAH kc+hdIUw0fbr7CgLdhqKDpvnpD5unIDtAFV1YvDw/O8Eq5jx89HJp5W9D1jczRd7q0ls FlDQ== 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:in-reply-to :references; bh=wL1K9/n9PLRogotOLHvr5IREgjJjcX+pqPJAFHVOgkU=; b=JGPu7cQ43kLMJJIs5iMvprFTJfNpeZESHGqK8AkSKjjEL8fCUsPC6xfR6zSW1kjDq1 1Xtm/nj3uKg3Hsc6vBYryEAjr9M+P4JZoLGVqBnXlQ4agZh4BJA2/sRJTcfnzoKsPptQ jVfFlA/qGg649uAQ5J9zoPBxvweqs5xIAvep/SsN5ri0/UCoJ466BJXEeP8rjdKhlPkc 5GRndbKakuFs2Aaj+FziwMHm6McMnSXydI38k5gpx/g5DEm9puv0Aw/yFTotIq3TLqoG qWul8HPAuxnhuviXmlU91PxcXYMnqW2Dy2hl9fFb8m21ExGff8H8aClJG0RoZd2Dw+Ui lcrQ== X-Gm-Message-State: AOAM531JIO99xAqy0ULVH97dEFzvr52h3N2gETeYEZCEoFRgUKSQ+h+F LQwSxxDf94zqLAFI1/B9ISt3Fw== X-Received: by 2002:a05:600c:2942:: with SMTP id n2mr515523wmd.137.1614191435563; Wed, 24 Feb 2021 10:30:35 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-157-252.adsl.proxad.net. [82.252.157.252]) by smtp.gmail.com with ESMTPSA id c12sm5105987wru.71.2021.02.24.10.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 10:30:35 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 2/2] powercap/drivers/dtpm: Add the experimental label to the option description Date: Wed, 24 Feb 2021 19:30:22 +0100 Message-Id: <20210224183022.11846-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210224183022.11846-1-daniel.lezcano@linaro.org> References: <20210224183022.11846-1-daniel.lezcano@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The DTPM framework will evolve in the next cycles. Let's add a temporary EXPERIMENTAL tag to the option so users will be aware the API may change over time. Signed-off-by: Daniel Lezcano --- drivers/powercap/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/powercap/Kconfig b/drivers/powercap/Kconfig index 20b4325c6161..8242e8c5ed77 100644 --- a/drivers/powercap/Kconfig +++ b/drivers/powercap/Kconfig @@ -45,7 +45,7 @@ config IDLE_INJECT on a per CPU basis. config DTPM - bool "Power capping for Dynamic Thermal Power Management" + bool "Power capping for Dynamic Thermal Power Management (EXPERIMENTAL)" help This enables support for the power capping for the dynamic thermal power management userspace engine.