Received: by 10.223.185.116 with SMTP id b49csp1043284wrg; Fri, 16 Feb 2018 11:21:39 -0800 (PST) X-Google-Smtp-Source: AH8x226GbnenQpmVeSJ99Pk/JFN25Cn72lFoRyUlb32YAKzMtUATXNeRzNtb7MeeaaeysHw852pG X-Received: by 10.99.132.74 with SMTP id k71mr5848448pgd.4.1518808899589; Fri, 16 Feb 2018 11:21:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518808899; cv=none; d=google.com; s=arc-20160816; b=z/SQkMzkiUrFrkrbbHKrTVo3cAc6HS8AIUawfss2KMW3402pcM7di1PLvq82zC/CIy 47b1c9zIJNlYKG7lstLHN8BesyCWRCCplP9EmR4y1gF5yWr+U0jTCoxjvdnh2wExJS0a GmLTp4Ty7Zwf7aZh1tdSxQgB7MLphcODOqDmgCBzVYLSwdOvPgp+n2QXHF47bF/kcFBm BKz8UYn53u0AuPe32tkVAWXALZNwpoaRCL9ytaOQB5O8Ke9F/qxTobg+AhmmFUqONeph UPOgpEw8y8HD5HLZGsiTYEW5QqbpZ8PNNuaB/QtfJ+fVdd8mzJWnKxnpeupbLjB3ARUT 2DsQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=CJiPnU9dGY3R1UvIizkdDaUtJzcg1pX9moXHtZuu4Sg=; b=DWciW2KWlltses9g0/wUSsPdmWwzcMnSi6TQrJwbiYT6Ow98gBDAmrPYehbMF5scbJ ZSP56Voy2A47r4heCcgRuZbrUBEqX5i5MPVcaHkUKdwzC4rE07hYYdf0SZKISt4q73UN qqLBDQCmdlgHnZ2PTTcoWKBkUReqv/LMkI674ieYXKXeyWwHt+xrbEPYGZclx8vhGg2a drqVxlFb13I/TjnqBJFSm27balJF/Ju4GLkZApSs09ybsXyn95p4mjWOItIEXQ39xwqM zulJ8SGtCxDh/fsCHmBfXcyNkWuzs8gCGvz7MHhSd6lK8i9fSCmC/f/E4K9GfmnjuVr3 nIIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b3zHCH38; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id r17si239465pfh.44.2018.02.16.11.21.25; Fri, 16 Feb 2018 11:21:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=b3zHCH38; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1162269AbeBPRjm (ORCPT + 99 others); Fri, 16 Feb 2018 12:39:42 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35404 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162052AbeBPRjj (ORCPT ); Fri, 16 Feb 2018 12:39:39 -0500 Received: by mail-wm0-f65.google.com with SMTP id x21so4476762wmh.0 for ; Fri, 16 Feb 2018 09:39:38 -0800 (PST) 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=CJiPnU9dGY3R1UvIizkdDaUtJzcg1pX9moXHtZuu4Sg=; b=b3zHCH38OzGG1/fs/hnAPEd99muzr4jyEj6mdYYS3N53Yvd9EkPX0Sy4+CHdS00Enq 8fCh+OBD+l8IzX+9T+IANTf2ZuyB7mbRZvR/P19CoAxOCGGvpGqL+ncskNZJmjT4G5c3 xaqJNKF8X0yOnkehtuMYKsYD3T8701FB+5zfg= 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=CJiPnU9dGY3R1UvIizkdDaUtJzcg1pX9moXHtZuu4Sg=; b=YyCaqaBa+YpHvjHJUat2MopOsL7zms8U8eK3Y7KNYL4M5pRyvyKm4q8qVGV9pZY2aD 4Jx5QFZPSJxqz/d8302bik2hGvA2et4MQdGwY2rTqc/RSyZF6XvkoQ+CSZhQVrGYG4Sr N0hnEwcblKI2c/qhuyFAZDD0+mSH6RkgNKiSvbmfr46T+nQoqFOhpidBicDMmgaDKNXv G9Ou8+kI7aKOjF19rQ4jOWMIxr3qSYjwPjh4rzjkDYGVC20DvJQNWGNWq9iHfmMa8FRg hOfR0I/t6lMKMMWrYAxrYSBcBWnjP4AGcdT728KnRzN2g/a9yc56+Eq06GFkiquqiGB1 GVkA== X-Gm-Message-State: APf1xPAt+jbfuO9gaItXXmHZbwvcOah+i2l6kufsSQLbIb7RUTkzuGTG Ehfz60YfmwxX0vwPcB08tDycJA== X-Received: by 10.28.132.202 with SMTP id g193mr5403048wmd.98.1518802777690; Fri, 16 Feb 2018 09:39:37 -0800 (PST) Received: from ?IPv6:2a01:e35:879a:6cd0:3e97:eff:fe5b:1402? ([2a01:e35:879a:6cd0:3e97:eff:fe5b:1402]) by smtp.googlemail.com with ESMTPSA id 59sm2654169wro.6.2018.02.16.09.39.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 09:39:36 -0800 (PST) Subject: Re: [PATCH 5/8] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver To: Viresh Kumar Cc: edubezval@gmail.com, kevin.wangtao@linaro.org, leo.yan@linaro.org, vincent.guittot@linaro.org, amit.kachhap@gmail.com, linux-kernel@vger.kernel.org, Zhang Rui , Javi Merino , "open list:THERMAL" References: <1516721671-16360-1-git-send-email-daniel.lezcano@linaro.org> <1516721671-16360-6-git-send-email-daniel.lezcano@linaro.org> <20180207091231.GQ28462@vireshk-i7> <54759b82-29e9-f376-bbe8-dcf683ed0cce@linaro.org> <20180209094100.GM28462@vireshk-i7> From: Daniel Lezcano Message-ID: <71c94b53-5945-bc91-18ce-b5ef7ba9ec3c@linaro.org> Date: Fri, 16 Feb 2018 18:39:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180209094100.GM28462@vireshk-i7> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Viresh, sorry for the late reply. On 09/02/2018 10:41, Viresh Kumar wrote: > On 07-02-18, 11:34, Daniel Lezcano wrote: >> On 07/02/2018 10:12, Viresh Kumar wrote: >>> What about cpuidle_cooling_unregister() ? >> >> The unregister function is not needed because cpuidle can't be unloaded. >> The cpuidle cooling device is registered after the cpuidle successfully >> initialized itself, there is no error path. > > Okay, then there are two more things here. > > First, you don't need a kref in your patch and simple counter should > be used instead, as kref is obviously more heavy to be used for the > single error path here. I prefer to keep the kref for its API. And I disagree about the heavy aspect :) struct kref { refcount_t refcount; }; > Secondly, what about CPU hotplug ? For example, the cpu-freq cooling > device gets removed currently if all CPUs of a cluster are > hotplugged-out. But with your code, even if the CPUs are gone, their > cpu-idle cooling device will stay. Yes and it will continue to compute the state, so if new CPUs are inserted the cooling device automatically uses the cooling state. I don't see a problem with that. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog