Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3966918pxb; Tue, 10 Nov 2020 04:58:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBZbp0A3JFMIcpX7juNCFQ0xvapx71wbISLotG2mb8Vn/gbym8s03DEBAbTYs1BJOkVb+x X-Received: by 2002:a17:906:46d5:: with SMTP id k21mr12762809ejs.495.1605013086555; Tue, 10 Nov 2020 04:58:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605013086; cv=none; d=google.com; s=arc-20160816; b=f1Z2QlNzYVXoh0gmgjanZsKbFBG06gv0ZeA18MeEhLSBjH2CDfMlIJ82roacXVLNd/ +TpyG8L8qLPPZeJ5/gsF51DBI4Yfox/wdrZIQSdIwe26MHvajRhaGXB1NQS/+MT2k7r2 CQwmiCTJUP/Lvy0C3LMiC8FIwEJrQK/DhzXfVd65PowOzzOuEaSw2y+Uek3r9V52zAvb Dc66QAj8+yOXPRRbWV58qrSQCBpc4x1w8yhP58uAVvshB5ggZeCvYG2E7FW/vntQjXM3 GRgihus/JWoCJSSQ23mI5SqAKu10ysaFovwmhQ+L2CwOw14Om2qdB1trGfYiWbocK3D1 CXhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Nv2Iddcxs1d2PfbeIZnN3SiLsasGHglATCG+tB07IsI=; b=vTjRV32dDZKiU+mq/hVg1biByWFSLFKgw3AGmUGJGEcuQspADKjQhT1Yu2xGT6B/wk iZTCx4uy6WpFUmszpht+eJKTbodrG8Z5r/Fcs65uldFjLgz6I1VMgKLUrLdS2AE7ARtl GePKBsNgTmcFOG0utJ/EF8zOfTJyKK47fepN5Q4VI2TFoZnLG/Kz1mHRuQW/rZRQRL6j hGSKglyGfPcO6QDNGJYyvZl2HsM+oKjBLFjeuF+cmyQD/OKojZ8WqhACEj3M0xfnxBjI kdVqJFIxqhGtmD7rHW+9Xsg4yJmF64QrGTqMjTwgMbFBeLjkY82WA/3YINkO6WGvbGdQ nzHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WIVjv45X; 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 q14si8722714edb.353.2020.11.10.04.57.43; Tue, 10 Nov 2020 04:58:06 -0800 (PST) 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=WIVjv45X; 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 S1730473AbgKJMzw (ORCPT + 99 others); Tue, 10 Nov 2020 07:55:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730368AbgKJMzw (ORCPT ); Tue, 10 Nov 2020 07:55:52 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4275C0613D1 for ; Tue, 10 Nov 2020 04:55:50 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id h2so2906584wmm.0 for ; Tue, 10 Nov 2020 04:55:50 -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=Nv2Iddcxs1d2PfbeIZnN3SiLsasGHglATCG+tB07IsI=; b=WIVjv45X5toRFfkJ1lSrT0YVSLDS40EsO3c19JdIRRJXhJJiPh5wHBhSzMa0sZkU3M NN3kAzPgxlBGxobUZP1kN8kVJw6Kq/GqGFXT6CIjCr99S4nB1qziNbvIDZakx/CwB+Gv OMeqbOntEMQl0liun1n0Du7Hbbkt5pZKZkmo5Y+y7YIY1iAOvJ7lCNhPJ4nEt+UJwSJ9 XbiHr8IRj+oCHJurlLL4waYuCZt9Nsada1DDlNpOPgb4VcwW9jbVnR/y6WgtiENSNww/ ZzQQ1OW6gOXj0eUbkT3YnQa82ilMVNzOCOkvQD0dKszIoVYqsVn4IFo9qPk29tkCWGHZ ruhg== 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=Nv2Iddcxs1d2PfbeIZnN3SiLsasGHglATCG+tB07IsI=; b=kfXonqfMwhPapYpmigaxmJhBOkr7OwTiJYNZyn4TtizgiN8Cm4yG9C1wTi2mbOTrZ8 IIyksuUlapf1Mq+brq7dJey8rlLU5Xmxsx/3PhLru1K+Nl2KK7FTrl9mlv3wjreb57nu NUzRNIxDym/jZssLithtX2B4v3VD8Dk6PjkIJZOwLw4DX3H/pV4FZtsFVSs+gQ0Zc40j nmNwd6MZwFdMsTz8nkCT9LBhWtr1AmNRBHen/ikZ0vUjrl7iyyFKgpDrvm0qk08AogfC E87/sO4XW/tcL3jMak4D60e7JNsrgPFljRTg4XfGNbrQcMQr39c7IPRHbNQIcQYcqoSw VHYQ== X-Gm-Message-State: AOAM533d+KhXamMBNWLZeBQd0dm0+XMQcpS1U+sqDEGoU7KsreZx0iLD btF5riA1IxqFv4BDCMEJdoTIR5qKswAItg== X-Received: by 2002:a1c:9d02:: with SMTP id g2mr4804119wme.110.1605012949305; Tue, 10 Nov 2020 04:55:49 -0800 (PST) Received: from ?IPv6:2a01:e34:ed2f:f020:1087:e960:613c:926b? ([2a01:e34:ed2f:f020:1087:e960:613c:926b]) by smtp.googlemail.com with ESMTPSA id k20sm977440wmi.15.2020.11.10.04.55.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2020 04:55:48 -0800 (PST) Subject: Re: [PATCH 3/4] powercap/drivers/dtpm: Add API for dynamic thermal power management To: Lukasz Luba Cc: rafael@kernel.org, srinivas.pandruvada@linux.intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, "Rafael J. Wysocki" , Arnd Bergmann , "open list:GENERIC INCLUDE/ASM HEADER FILES" References: <20201006122024.14539-1-daniel.lezcano@linaro.org> <20201006122024.14539-4-daniel.lezcano@linaro.org> <8fea0109-30d4-7d67-ffeb-8e588a4dadc3@arm.com> From: Daniel Lezcano Message-ID: <6c018f8e-41b9-55bc-4d47-d2104cabfb86@linaro.org> Date: Tue, 10 Nov 2020 13:55:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8fea0109-30d4-7d67-ffeb-8e588a4dadc3@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lukasz, thanks for the review On 10/11/2020 10:59, Lukasz Luba wrote: [ ... ] >> +/* Init section thermal table */ >> +extern struct dtpm_descr *__dtpm_table[]; >> +extern struct dtpm_descr *__dtpm_table_end[]; >> + >> +#define DTPM_TABLE_ENTRY(name)            \ >> +    static typeof(name) *__dtpm_table_entry_##name    \ >> +    __used __section(__dtpm_table) = &name > > I had to change the section name to string, to pass compilation: > __used __section("__dtpm_table") = &name > I don't know if it's my compiler or configuration. Actually, it is: commit 33def8498fdde180023444b08e12b72a9efed41d Author: Joe Perches Date: Wed Oct 21 19:36:07 2020 -0700 treewide: Convert macro and uses of __section(foo) to __section("foo") Your change is correct, I've noticed it a few days ago when rebasing the series. > I've tried to register this DTPM in scmi-cpufreq.c with macro > proposed in patch 4/4 commit message, but I might missed some > important includes there... > >> + >> +#define DTPM_DECLARE(name)    DTPM_TABLE_ENTRY(name) >> + >> +#define for_each_dtpm_table(__dtpm)    \ >> +    for (__dtpm = __dtpm_table;    \ >> +         __dtpm < __dtpm_table_end;    \ >> +         __dtpm++) >> + >> +static inline struct dtpm *to_dtpm(struct powercap_zone *zone) >> +{ >> +    return container_of(zone, struct dtpm, zone); >> +} >> + >> +int dtpm_update_power(struct dtpm *dtpm, u64 power_min, u64 power_max); >> + >> +int dtpm_release_zone(struct powercap_zone *pcz); >> + >> +struct dtpm *dtpm_alloc(void); >> + >> +void dtpm_unregister(struct dtpm *dtpm); >> + >> +int dtpm_register_parent(const char *name, struct dtpm *dtpm, >> +             struct dtpm *parent); >> + >> +int dtpm_register(const char *name, struct dtpm *dtpm, struct dtpm >> *parent, >> +          struct powercap_zone_ops *ops, int nr_constraints, >> +          struct powercap_zone_constraint_ops *const_ops); >> +#endif >> > > Minor comment. This new framework deserves more debug prints, especially > in registration/unregistration paths. I had to put some, to test it. > But it can be done later as well, after it gets into mainline. Ok, I will add some debug traces. > I have also run different hotplug stress tests to check this tree > locking. The userspace process constantly reading these values, while > the last CPU in the cluster was going on/off and node was detaching. > I haven't seen any problems, but the tree wasn't so deep. > Everything was calculated properly, no error, null pointers, etc. Great! thank you very much for this test > Apart from the spelling minor issues and the long constraint name, LGTM > > Reviewed-by: Lukasz Luba > Tested-by: Lukasz Luba Thanks for the review -- Daniel -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog