Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp372609ybt; Wed, 1 Jul 2020 00:08:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyZDTnKf4OGZHhetCY8ehfRzmCVA3LNH5w2fnsHi1blCPRWTNg/fj35NKdRa+pelcwUSjR X-Received: by 2002:a05:6402:c06:: with SMTP id co6mr27850408edb.142.1593587336317; Wed, 01 Jul 2020 00:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593587336; cv=none; d=google.com; s=arc-20160816; b=htSPhqEhtNJOEUqDqrhUTQi/st3c1Pqyvy9EkamvguFnp26MWBCHomt2zXbB8W05TI vKHOMpuCZrwQn2JWQe+V/q/985/CcjvzhZSYe06YX1aQpDFHHqaDigs8wRBhk9DI3UHQ 5DCrhYEugrlAtnGb0DpEDwJhO2dD8Rz2p7WqCgJdS50PWZB6KUi9LjxBZybZqUtdKcde IFIUsyYY565dGqRPdgUOBVpr/jBtlLfUV5Ow1+UCRug7hPTRSOuKZbvqHsZG7kA0gm82 c50Ymv2/Dqh7MMqKG1bKfrV5fOXkn+qg2rRZlXBsLL1wPGpk+Cdt0DnComIt6L8fQVL3 wT8g== 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=ZOhd+w6SRKJEtTQwBcpU/qkykA7+rmhMgIFWkoBoqBM=; b=qKgVtzSKNByITm9mWNtupyIwkNoTi/ZeehL6DQ3th+f6JfosVEDCKcRkXnlTQvvitE mAPy0CUX5qgpk6JrfzMg5E7iZCJz/ycvg4Jlmfe/R7+HYTAU2JWvMjkfKvIgAGgTA+oi 6s9zuSKnKUmIYGqm0epukGMECGQpmVC+eQu7uXS+pNZTEBRovyMmbHWDuONmPO7TuDb/ gWL592rs951hlqle8NlFUYL+cmttbZdRVl/QcIEFYK0NoatjUsjpxy370Hb23oPTRzZU 33+Ksy27cWRZRVwkczqC2gd6hzo8ldYCvs3IZAauVsT0/SxobNIYKfZa0XXsQ+qMabnt DuHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tyC/SPwy"; 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 ce10si3552376edb.534.2020.07.01.00.08.33; Wed, 01 Jul 2020 00:08:56 -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="tyC/SPwy"; 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 S1728059AbgGAHI1 (ORCPT + 99 others); Wed, 1 Jul 2020 03:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727847AbgGAHI1 (ORCPT ); Wed, 1 Jul 2020 03:08:27 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C587DC061755 for ; Wed, 1 Jul 2020 00:08:26 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id l17so21250166wmj.0 for ; Wed, 01 Jul 2020 00:08:26 -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=ZOhd+w6SRKJEtTQwBcpU/qkykA7+rmhMgIFWkoBoqBM=; b=tyC/SPwyySO5z/5I0YJreE3FQ/N/tCdN5ADeXWsIlFmmjXevaHmibS3duzGAVdrw2L ChQp2jRb9DoruG/c701GDmp8wamXB/CNx7ju2Ks+y4k1rp+nDeRzkitBBBPNjQuiWrAL PlIE1maNz/kFMXnBVpNaOiQtk6yxIOzU3xYVi0Wa0g0NLsQhecBTJx4aiAXf4wPzU30j Aj641V1sLhpNLIphnY3o1EjaQR+kb6QfH2UhBjzkg/fDxbyMv2JlJnhiiSKg5jIPY7vJ bGXdxwujUVOoWpM52uyDyWMHoNhgS9JbN4UUSOKReYUT7UTgEltC3aXh7WsN0FBCXfQ8 8FUg== 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=ZOhd+w6SRKJEtTQwBcpU/qkykA7+rmhMgIFWkoBoqBM=; b=UQUi9X0qq6KXJvjGQvJRixSHFII4rm2vO0GktuBWn5yhYdAUbv07aTc+WUrzichowG 9iikWwbBP9qfUThOPbwz0cGN0YS1q42Mix+bfy01cfV2kHWlGu6AhztAwFF5Kih1ZjEU Xw3+fmoF6lZsTa8O4qz7Opc4HJP2GcyiUYSE5GbV/S/+uJJmAkhPbaFMAh4eRd2iiFrW CNjwEzMWfzJY7CM3r9UkNuq6zh4zdQhDUp6igfKy72ZR3TJlKCwDlywyY05Z0ThZh0mC vMQUKKYsHz5CVCRjqylYXKZFYoS2KeDhbgeAzObeGDP4/2AOUieWN7fR5N03PEaV+Dqa he4A== X-Gm-Message-State: AOAM531xsvZTew42+skJny/e3oK+IFsEII9YPkcuSSEGSgha28v9EMZM Xdf+QgdzGLRkG44Lju/dNBdDxRWqm0s= X-Received: by 2002:a1c:2d0d:: with SMTP id t13mr9880641wmt.43.1593587305273; Wed, 01 Jul 2020 00:08:25 -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 j24sm6882055wrd.43.2020.07.01.00.08.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2020 00:08:24 -0700 (PDT) Subject: Re: [PATCH v2 1/5] thermal: core: Add helpers to browse the cdev, tz and governor list To: Amit Kucheria , Zhang Rui Cc: Srinivas Pandruvada , Ram Chandrasekar , Linux Kernel Mailing List References: <20200625144509.17918-1-daniel.lezcano@linaro.org> From: Daniel Lezcano Message-ID: <7f4f9a0a-404c-79ff-4aa8-8629e3e9e76b@linaro.org> Date: Wed, 1 Jul 2020 09:08:23 +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 20:46, Amit Kucheria wrote: > On Tue, Jun 30, 2020 at 8:40 PM 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 > > I was actually serious about killing thermal_helper.c :-) > > What is the reason for those 5-6 functions to live outside > thermal_core.c? Functions in thermal_helper.c are called by governors > and drivers, just like the functions in thermal_core.c. I couldn't > find a pattern. I propose to move these functions in the thermal_helper.c for now as requested by Rui. Then you can send a patch to merge thermal_helper.c to thermal_core.c after and we can comment the move. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog