From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 208CDC433ED for ; Thu, 22 Apr 2021 10:26:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4DE56145B for ; Thu, 22 Apr 2021 10:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235855AbhDVK1M (ORCPT ); Thu, 22 Apr 2021 06:27:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235867AbhDVK0w (ORCPT ); Thu, 22 Apr 2021 06:26:52 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69346C06138C for ; Thu, 22 Apr 2021 03:26:16 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id r7so32241419wrm.1 for ; Thu, 22 Apr 2021 03:26:16 -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=vLEMp8aF3tYBke1OWNpVeQPKV5uE710GQQXiqwBZMEk=; b=XDsq1JSqsubc7Q0X8WPoswRGyaacKlZ55tdtNMTD9ehUzmluYy93XDlSk4sd9nirDM xbe7f36m52VqCI4G2JH5MYcOCyngvmExTH72QqbbA+ChQE4Sha1jr30ic5uL1EJ9Nm6b lzvbUFfYmZHr3JOe8aY4v/AUhS3A7fiSufUXsAZymcM/xRu7HPObOj/dULqedx//fEa4 wS4vLJDj2nZ2lbbxNj8OKc+zb9Idc+aQn65jRE2dQN+zNHI4AstJnGU8tJ4kXvlkuwYm oZXuJIKFqvJEs+AodE2ZIXIxqVDZolktmFMRaT34NJLljmtlGJgsxwapPmkX3BJJv+qm lvkQ== 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=vLEMp8aF3tYBke1OWNpVeQPKV5uE710GQQXiqwBZMEk=; b=RGJmO3erwoZD4GmEhskrU4CYNCmdwZ0anlEDQQU9V//4df8HfbK+d/MlPMTiPlXHvo 1jmejBAQUWT4DvcpEREVXZwteq78Gb0pW7DTIb7VmMNUleNxFJTRqlAA773vVivelZ5N ySGEhehDAQBodTIsRCV9dKVi8TFgOAqMKwbFgUSt6SsJERHorHTo/UwDNNK7o3wx2soE 4kt+crLrbKbAHzx5t3UujXMRGqINHu5axT0lajcctgTHk209F9/SE5qaO4h9nlqsJzQW shQ1bcaCd42u0Dj4JQJqZopa2bQTfpM1/fZ9QMFn6AaEUapIvGeubrW0cXOxFCpEoJ2z tKVQ== X-Gm-Message-State: AOAM530kUGZ32e2goFcyHVEKo/2TgKe410JAeAFZ4ocrAD+hCPEj1vBY ChGN5GvE0Yce5/TIJNcHCTLOxA== X-Google-Smtp-Source: ABdhPJzqet+b3G/OqaI8TY71t835itdllLxYnmKuT8SeL9sDYPeuVHsklZpmIpg68EowvRePYoplYg== X-Received: by 2002:a5d:58fa:: with SMTP id f26mr3113044wrd.177.1619087175038; Thu, 22 Apr 2021 03:26:15 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:e88d:2580:c20:b786? ([2a01:e34:ed2f:f020:e88d:2580:c20:b786]) by smtp.googlemail.com with ESMTPSA id a72sm2584607wme.29.2021.04.22.03.26.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Apr 2021 03:26:14 -0700 (PDT) Subject: Re: [PATCH v3 3/3] thermal: create a helper __thermal_cdev_update() without a lock To: Lukasz Luba Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, amitk@kernel.org, rui.zhang@intel.com References: <20210421174145.8213-1-lukasz.luba@arm.com> <20210421174145.8213-4-lukasz.luba@arm.com> <3d08d5cf-9e3b-ae26-cfd5-bf9a40d11643@linaro.org> From: Daniel Lezcano Message-ID: Date: Thu, 22 Apr 2021 12:26:13 +0200 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: 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 On 22/04/2021 10:21, Lukasz Luba wrote: > > > On 4/22/21 8:58 AM, Daniel Lezcano wrote: >> On 21/04/2021 19:41, Lukasz Luba wrote: >>> There is a need to have a helper function which updates cooling device >>> state from the governors code. With this change governor can use >>> lock and unlock while calling helper function. This avoid unnecessary >>> second time lock/unlock which was in previous solution present in >>> governor implementation. This new helper function must be called >>> with mutex 'cdev->lock' hold. >>> >>> The changed been discussed and part of code presented in thread: >>> https://lore.kernel.org/linux-pm/20210419084536.25000-1-lukasz.luba@arm.com/ >>> >>> >>> Co-developed-by: Daniel Lezcano >>> Signed-off-by: Daniel Lezcano >>> Signed-off-by: Lukasz Luba >>> --- >>>   drivers/thermal/gov_power_allocator.c |  5 +---- >>>   drivers/thermal/thermal_core.h        |  1 + >>>   drivers/thermal/thermal_helpers.c     | 28 +++++++++++++++++---------- >> >> Why not add this patch first (without the ipa changes) and then replace >> patch 2 by using the new function ? That will prevent to go back and >> forth. > > I thought that it would show also the motivation and usage in the > governor. I can had this patch as first in the set, but then I thought > about this example. > I can change it if you like in v4. Yes, please. I think it is more logical. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog