Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp388739ybt; Wed, 1 Jul 2020 00:38:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNEYuwHhG53NAIVC6LZrI+ZSRi4z4+QeGn29BHwjbjIIUXKCkA7YvYsNyGrLdwoiQ6QejF X-Received: by 2002:a50:9b18:: with SMTP id o24mr27894396edi.335.1593589115683; Wed, 01 Jul 2020 00:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593589115; cv=none; d=google.com; s=arc-20160816; b=wt/ML/HN/qXXsXwKH1rC773omriil+4zShH0SEOkJHKUYkKHBTyhSFQQOGxBYeHvG0 uABGG1tCPNvsbC869c3CxTUFl3mRbq26+7YenBB8G60hN/p8lQk5a774VsYaFnIkX5q+ JiO8Stgo6oZrRaRbFnPwzbcMPbQFmj303javoXbZaCiGjwTQ0xrMkN7BNiwsZFxaaJ5X s/XO0cEwGqKm5d38bK6Yn757iV3pf8J3jY4FWA8pf5yeYqFs7OFlz1CBiaC2eHf+l4rk lgfHHavVkcGIwKH00ecR1xXMzjFddm6/9CAvvR8pTkUDMB8BpXO6kNfE8cB3wulv+Sbw 7hGw== 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; bh=uuJwNZbCJukOAxG04+bEWS+MLz2Rq8gWyM8D40COw3k=; b=mxZdtn1i6MDvPzfwaflFt5F/Yd2F+3NmWIXcKX7ZYJ+chDYlqjtXw60YwYpQ8uPNJC yqgwRozk1m4QvN6aKUHyMZHJSoZoz4CMTWuY5F2+IBrOtIYFtVWEafpCpefji/rlP3QC l5PDwMwJDvcgI4Qw/R1taV4a6TwKzFoTYZMtqyes7IlngcwikCFN9dGrZ01No6lwJnbS YHKxNc9HiNAQWuKQ0MHp2XFpIe/GJjopbs9ob8RxpC2KOg45fAgbe48OGmZG8NRve/R8 Lo0e8ncavqaTSk2toRxPg2AyOY5qioEpMyDiY/UxqBr8eKQ/UWoriQV10GIrC+CrHWD0 OiZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yChXw7M9; 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 c25si3234852edv.335.2020.07.01.00.38.12; Wed, 01 Jul 2020 00:38:35 -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=yChXw7M9; 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 S1728200AbgGAHgA (ORCPT + 99 others); Wed, 1 Jul 2020 03:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727836AbgGAHf7 (ORCPT ); Wed, 1 Jul 2020 03:35:59 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E1AEC061755 for ; Wed, 1 Jul 2020 00:35:59 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id z15so11454480wrl.8 for ; Wed, 01 Jul 2020 00:35:59 -0700 (PDT) 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=uuJwNZbCJukOAxG04+bEWS+MLz2Rq8gWyM8D40COw3k=; b=yChXw7M9FFpaCgHzXPeEjg6Agoi5DJvvzkuLdDhKWaklgV/V8w1S0eCFEhS83ayX2B WF/5Smqdh5i19A58NL7uY9XiFmLFS/Db/gWZTcZ7WxiWMJsddOsI7WcGbKGUcTq40/D6 NpzHFxlMMsObCd3jLFUQLS+mlhgjj2zKGH2KiLT9gnPRGnpTJMLa2pFe9/U3BG6Vyeh4 MuVz/Ce4CQIvRMPa1YUww25zkQBlrXLqTpArkFBgITn9+di5Q8ploQM173ZrrWOfcTUq d8r66mBFTe8JtsclNqY9Ufq/72yEE/lBv5Dqz0+Jp/zJIDwT8Ww6OCBcouV9n/i+B7i0 A2LQ== 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=uuJwNZbCJukOAxG04+bEWS+MLz2Rq8gWyM8D40COw3k=; b=MVP7OYzcPeDDro/L6U94lgM8qigZJdMJUynsWYQpZg5srwIkIGP8IjQQJ80FUXWwf+ M2ZpsveCOYm26DDT+WcMestlyNQnr/Sx+njh91FSMUPirgiMix3ojIJeaQ9lhElvc+6U tmsq6CD6L0lnfLRqICizEVrvUTRR5jok8McTST+hz4pe6RbmLZugOgXJAlFv/e1uM3v2 xY4UkTwsJILXE/JWK9lfgHpiuAIhU61ThXjAPk9DMakPA6aHoEM239vCN1xQk0wG6Afs RcqrtVxwCGC12p/xps0o3c5s0CFsqz/qlj18avdzZwQozBKu+CgHqq9ebhWMfcDfJtiv lpww== X-Gm-Message-State: AOAM530z5uoloGQJGkmUB0Q1lA2MgFwUVCasM4zLoMr+ZQ0okwhm0KwW Y0blbDAW/6mtHcBclMffCo6A90H48vQ= X-Received: by 2002:adf:f34f:: with SMTP id e15mr25731085wrp.415.1593588957853; Wed, 01 Jul 2020 00:35:57 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:54f4:a99f:ab88:bc07? ([2a01:e34:ed2f:f020:54f4:a99f:ab88:bc07]) by smtp.googlemail.com with ESMTPSA id e5sm6588989wrs.33.2020.07.01.00.35.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2020 00:35:57 -0700 (PDT) Subject: Re: [PATCH v2 1/5] thermal: core: Add helpers to browse the cdev, tz and governor list To: Zhang Rui , Amit Kucheria Cc: Srinivas Pandruvada , Ram Chandrasekar , Linux Kernel Mailing List References: <20200625144509.17918-1-daniel.lezcano@linaro.org> From: Daniel Lezcano Message-ID: <143d954f-2ecf-c4d3-cb7d-f2ea75da8276@linaro.org> Date: Wed, 1 Jul 2020 09:35:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: 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 On 30/06/2020 17:09, Zhang Rui wrote: > Hi, Daniel, > > seems that you forgot to cc linux-pm mailing list. > > On Tue, 2020-06-30 at 17:16 +0530, Amit Kucheria wrote: >> On Thu, Jun 25, 2020 at 8:15 PM Daniel Lezcano >> wrote: >>> >>> The cdev, tz and governor list, as well as their respective locks >>> are >>> statically defined in the thermal_core.c file. >>> >>> In order to give a sane access to these list, like browsing all the >>> thermal zones or all the cooling devices, let's define a set of >>> helpers where we pass a callback as a parameter to be called for >>> each >>> thermal entity. >>> >>> We keep the self-encapsulation and ensure the locks are correctly >>> taken when looking at the list. >>> >>> Signed-off-by: Daniel Lezcano >>> --- >>> drivers/thermal/thermal_core.c | 51 >>> ++++++++++++++++++++++++++++++++++ >> >> Is the idea to not use thermal_helpers.c from now on? It fits >> perfectly with a patch I have to merge all its contents to >> thermal_core.c :-) > > I agree these changes should be in thermal_helper.c Oh, actually I remind put those functions in the thermal_core.c file because they need the locks which are statically defined in there. If the functions are moved to thermal_helper.c that will imply to export the locks outside of the file, thus breaking the self-encapsulation. Do you want to move them out? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog