Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1590745ybt; Mon, 15 Jun 2020 04:30:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsDEnX2kzM48qB/0erCgb2YiQg9fBcGZUNDJeC0r4DP57CMaTErzmCuU+OMecYLvmIWlF9 X-Received: by 2002:a50:fb92:: with SMTP id e18mr22542624edq.135.1592220600941; Mon, 15 Jun 2020 04:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592220600; cv=none; d=google.com; s=arc-20160816; b=FFQ2eM5Sj6ynTWvxxOOVj2Tp0McL1iDCLyurcYG1G5YOeemT0l7RAz1D0CTRPGFY69 9RogO8piZw+FmWLMnu4/Y7/TR3/kOFZwHB1sxfVTrQdQv5BOd0S6xSJkA/Mng4VIj2YW fKCcvwGiDMkVBzH9ux0EI3Gu9RaLIy446JmXC8yvVNfTb91AxJNzJTRCXGls2fIIJb2T 4bi7sv4fII+jz3Wy3LX329cnbvyhScHFqB7oiHe77+Rn2XOU2X266rUrLN82a6Hy0zi6 pgcWE8uvE6uTQbxQJj4fGHeuqT5e5nfnYjDdHumsPXj82cn5MhDCh6YGQNRU7CRVPsPV mtjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=vrKmkhg+c1u0kB4U6Q0PfBV1XmTvqqdQ8hWTNkN5v2k=; b=fvXfYN5ddY/ww9Q/zFsO8mKerHJa8wiaq1y0o+UL0gDE/e6XshK3yExgMFY++3afGN 0d9q2+Egw2vAuqKfZJm4MMDWcGYX5m6/xUKQ42Oe782x5dMqO+cI3k843oVbLFunNQNw In9fNxO7JAmzS4KUfdbUNPGRyrlnzdVr39gIPx/IbYPJBRYAXHdiD9EeQtgCnnFP46rI XzANF7apO+PdEUHvzEP/tLoDUxdtkHkBcbce0auF3SkK0OseHs0xP4i0ylphcf3tlflA oE2Avt8FtpaScv2xQnJk2Ub7+57bA9fPvsrTWIZRezjz8nztG1D+txJdC89lhDZhi/8M /0Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XIIEk3jh; 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 k12si8912824edi.198.2020.06.15.04.29.38; Mon, 15 Jun 2020 04:30:00 -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=XIIEk3jh; 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 S1728285AbgFOLZk (ORCPT + 99 others); Mon, 15 Jun 2020 07:25:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729038AbgFOLZi (ORCPT ); Mon, 15 Jun 2020 07:25:38 -0400 Received: from mail-ua1-x944.google.com (mail-ua1-x944.google.com [IPv6:2607:f8b0:4864:20::944]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 330C9C061A0E for ; Mon, 15 Jun 2020 04:25:38 -0700 (PDT) Received: by mail-ua1-x944.google.com with SMTP id b13so5535105uav.3 for ; Mon, 15 Jun 2020 04:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vrKmkhg+c1u0kB4U6Q0PfBV1XmTvqqdQ8hWTNkN5v2k=; b=XIIEk3jhhCjnXxJTApUX1KsztsSHxmkhzNIzJiVbqEHf7zAn0F9ATFYCTcxehIn7Db PSo6AK16Dk/Mq2bHaFCNXJPKhXFfIyKWlZ64UGJVCrZI5POsNEiNmiXtK4/nrUoQyxE7 QHFnkyTx7Mf1Cjrktsn7BMYv521Nzaa/sKvQWydv/s1Sx4G5vEEGEzjGrqvH0ubiDc45 oBYNVXzgJF6M5MhYQLfXHAaZnaB+ow+dxNe5MRjqhZkkny1Gytj8LuYB8sxhWldVtsrz jrDMHgw3N8/IG4Ozcd3vnUA3fApwh05lTSBFjbz5aKHtOvycqlLUQb87pFCTW7Ocp/gA +uhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vrKmkhg+c1u0kB4U6Q0PfBV1XmTvqqdQ8hWTNkN5v2k=; b=e9m8ysudpoMS7yL4ZOx+VoGM3SXuIKl7oIGgCAEHe5scl142TZPRB77eoMY5U5cZ++ LbIjx33a0Z49xlsNEfZ+Q5xiNoE3MT6Gawr+B6dBVxTn1zocmP6TIuDxY/UNysZhr6/E /z9HUrb430GkYJghSg3ARDaNseYYUnryS3K8FHU+JBnzhwXRyKTNw/+tSLEi+M+PYceO Yr+EXNI/pxu7Dq5/xc9QUPlsybXVanoF37lLEMAIS4XrZn9sm3t5FZ7EQR382402cnJl gQ9jmdoYi7iUjBQ6NHhKz00flAF6L4MQhwU2El65gYHFSxI3RlPRSCbBWe+FQFggTn3J qOBA== X-Gm-Message-State: AOAM532gEhWTn1VCjCm+xvZm9aDsVEJxdViJUYppACzKss6mX86UyyOi boXomTFDlnJg7QEjZFeQdUawwHxcIxuVpTcqCVMPJQ== X-Received: by 2002:a9f:22e1:: with SMTP id 88mr18170672uan.19.1592220336997; Mon, 15 Jun 2020 04:25:36 -0700 (PDT) MIME-Version: 1.0 References: <20200429103644.5492-1-daniel.lezcano@linaro.org> <20200429103644.5492-4-daniel.lezcano@linaro.org> In-Reply-To: <20200429103644.5492-4-daniel.lezcano@linaro.org> From: Ulf Hansson Date: Mon, 15 Jun 2020 13:25:00 +0200 Message-ID: Subject: Re: [PATCH v4 4/4] thermal: cpuidle: Register cpuidle cooling device To: Daniel Lezcano Cc: Zhang Rui , lukasz.luba@arm.com, "Rafael J. Wysocki" , Lorenzo Pieralisi , Sudeep Holla , "open list:CPU IDLE TIME MANAGEMENT FRAMEWORK" , open list , "open list:CPUIDLE DRIVER - ARM PSCI" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Apr 2020 at 12:37, Daniel Lezcano wrote: > > The cpuidle driver can be used as a cooling device by injecting idle > cycles. The DT binding for the idle state added an optional > > When the property is set, register the cpuidle driver with the idle > state node pointer as a cooling device. The thermal framework will do > the association automatically with the thermal zone via the > cooling-device defined in the device tree cooling-maps section. > > Signed-off-by: Daniel Lezcano > --- > - V4: > - Do not check the return value as the function does no longer return one > --- > drivers/cpuidle/cpuidle-arm.c | 3 +++ > drivers/cpuidle/cpuidle-psci.c | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c > index 9e5156d39627..8c758920d699 100644 > --- a/drivers/cpuidle/cpuidle-arm.c > +++ b/drivers/cpuidle/cpuidle-arm.c > @@ -8,6 +8,7 @@ > > #define pr_fmt(fmt) "CPUidle arm: " fmt > > +#include > #include > #include > #include > @@ -124,6 +125,8 @@ static int __init arm_idle_init_cpu(int cpu) > if (ret) > goto out_kfree_drv; > > + cpuidle_cooling_register(drv); > + > return 0; > > out_kfree_drv: > diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c > index bae9140a65a5..1f38e0dfc9b2 100644 > --- a/drivers/cpuidle/cpuidle-psci.c > +++ b/drivers/cpuidle/cpuidle-psci.c > @@ -9,6 +9,7 @@ > #define pr_fmt(fmt) "CPUidle PSCI: " fmt > > #include > +#include > #include > #include > #include > @@ -313,6 +314,8 @@ static int __init psci_idle_init_cpu(int cpu) > if (ret) > goto out_kfree_drv; > > + cpuidle_cooling_register(drv); > + Apologies for the late reply, but just noticed this change in v5.8-rc1. Don't you need a cpuidle_cooling_unregister function? For example, cpuidle-psci may fail and then calls cpuidle_unregister() to cleans up things. Is that okay? Kind regards Uffe