Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp908084rdb; Wed, 6 Dec 2023 03:33:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZCj9q1qCSFvymse2vj9L+KkcohuAt15oLcDGm4nf6WeF1ReuVi0jqzER0x6UOc5NYcS1+ X-Received: by 2002:a05:6870:b246:b0:1fb:75c:3fe4 with SMTP id b6-20020a056870b24600b001fb075c3fe4mr852564oam.68.1701862394316; Wed, 06 Dec 2023 03:33:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701862394; cv=none; d=google.com; s=arc-20160816; b=wmj6b50D0aBaMwuopw9ig2V3JJkY5WQf8Dd59FKIR3UtdlA2dURDhA3m6w+W5cahqU 0yUwlE/b437eqqGsLz2vlASRIY++RFs9ObPEVsY9SN6Fdo2lE72L0pVagoPdVBJymNqz 9GcXgNspqUkHTErw9k+l2py5nR6IHB1NZYGUQ7QlyaaRcdPZPq2TH7FLtuSQcDKaeL46 cJfOMN4KidnP3iU8KIdesdAU+X5C+uMIW8NSEqqtYhCOXc/uNPCzYADPIFqUVvQjxusi bKuNxN9NMLkyefqlkHUCdbYqQ5DAFMcDX5Tb2ODnyeInU8vJg6Kl1sVR4uwthNnl6OcR WjbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SVOy+xIVPDzsighaco+7FzAHWPggjXl/SyI7kXPYVS4=; fh=WD3PUBwbKW+eURwNczkCMPvWicegbE0hVFODSxn7LTw=; b=KcOx/YtWpVIFR44FeNf5OAOZKz0yLKPXigABC7U/XeW0MY3a9r3wMVEIc5fZk5STfy GknddGoSjB0C5hQY7bUC2CzuxDGA+NFgRGzVSC/lQK9Bd6fUjYTuJNxhYth8TupRiJHV gliBSbayYevPGHVPccSGPlittAHvl559cYd3af/UZrPMcvxwb58fu3bonUndsXppbyip NnzlR+dMBuKaDYJjG8AN6c0Vzn6xeN/slpGdmhIjPptEr3wyUvtY9UfT6wxg6TsIjwrR 8gFyVK1Zbb+73mTmaXcw/c/lradd7yZ/MgMGGMVh63Av8so6tjvYcLtP0VHfZFt5K07+ nUQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QRRm2VuF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j4-20020aa783c4000000b006cd8454cbb4si11147237pfn.337.2023.12.06.03.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 03:33:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QRRm2VuF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E8C35802A81C; Wed, 6 Dec 2023 03:33:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377650AbjLFLdC (ORCPT + 99 others); Wed, 6 Dec 2023 06:33:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377585AbjLFLdB (ORCPT ); Wed, 6 Dec 2023 06:33:01 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D8F11BD for ; Wed, 6 Dec 2023 03:33:06 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40c09dfa03cso38315255e9.2 for ; Wed, 06 Dec 2023 03:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701862385; x=1702467185; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=SVOy+xIVPDzsighaco+7FzAHWPggjXl/SyI7kXPYVS4=; b=QRRm2VuFsvdhsh+gx/mGSmSu2BHlFwGhUxOZm2vEG5v1r4SUKT+8Si9AMrRl0dqaLO iCx8zYz2TybmQRZtilolJAqulibi74L04+cNFZvz2szXaG5Bv6B91N3x8E6gM6c/piXl xd62SQ1F3BEoEwvVVZzPgJmPsqxG/rEKOWRjUdG2uKdyjXOaAjD8XRJqJ8qjB95GrCfl 4TdQzvEzW408Iy9ETs64fUn3BjtL6eRUzZctbh3OqHF/ke8Un4KIFCN78011BsmDmA0g uYIwSnS2PSMsEZUwg8PYVRtUG5RT1hC3q9iQ0UZhea8Op777oO0hfSABz1vPHGKAo3iL oVJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701862385; x=1702467185; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SVOy+xIVPDzsighaco+7FzAHWPggjXl/SyI7kXPYVS4=; b=Wpy7iN2Fq0lK0MSh/Q63a4/Achut45ZZsPI0X4zwkjuulp9ms2fHQb7UZyn3TZ80MN azLP89pzvR0BR7TFb1SArrv8AFGKkJKrB0x/OjAChie/vzN2x3mII6LZszpO68yJPZMn KyOHwjGjIlHaqXOzNpir/DmX4tKA/+EJ4F4ON4eaB8USZfEhS2iuYHVKUJ4b3PzP2fUj QDmMYs3Owcuz3xaO4YFoljPYIW77s90bbJL5sD6zs/Vxtvi1vNeHP8oBjaFct9Ivby+/ LUlyxpMlGGC7pKuPOMdGL4nP0HC0Z5632G7nTF8auataZhHgwfCKXu480qE178SQelq3 NrCQ== X-Gm-Message-State: AOJu0YzYKIrw8sc9kH2Tc/j2tQseeMXwwUGOMxSTURqwjhfMloisHGtB KTHv7CoJg4N702JJkSoqXcgucQ== X-Received: by 2002:a05:600c:4a12:b0:40b:5e21:d338 with SMTP id c18-20020a05600c4a1200b0040b5e21d338mr526890wmp.65.1701862384945; Wed, 06 Dec 2023 03:33:04 -0800 (PST) Received: from ?IPV6:2a05:6e02:1041:c10:c49e:e1a5:3210:b8c0? ([2a05:6e02:1041:c10:c49e:e1a5:3210:b8c0]) by smtp.googlemail.com with ESMTPSA id e5-20020a5d4e85000000b0033333bee379sm13279430wru.107.2023.12.06.03.33.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Dec 2023 03:33:04 -0800 (PST) Message-ID: <43046604-c67c-455e-8878-01425be40c60@linaro.org> Date: Wed, 6 Dec 2023 12:33:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/2] thermal: sysfs: Rework the handling of trip point updates Content-Language: en-US To: "Rafael J. Wysocki" , Lukasz Luba Cc: Linux PM , LKML , Srinivas Pandruvada , Zhang Rui References: <12337662.O9o76ZdvQC@kreacher> <4882089.31r3eYUQgx@kreacher> From: Daniel Lezcano In-Reply-To: <4882089.31r3eYUQgx@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 06 Dec 2023 03:33:13 -0800 (PST) On 05/12/2023 13:24, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Both trip_point_temp_store() and trip_point_hyst_store() use > thermal_zone_set_trip() to update a given trip point, but none of them > actually needs to change more than one field in struct thermal_trip > representing it. However, each of them effectively calls > __thermal_zone_get_trip() twice in a row for the same trip index value, > once directly and once via thermal_zone_set_trip(), which is not > particularly efficient, and the way in which thermal_zone_set_trip() > carries out the update is not particularly straightforward. > > Moreover, input processing need not be done under the thermal zone lock > in any of these functions. > > Rework trip_point_temp_store() and trip_point_hyst_store() to address > the above, move the part of thermal_zone_set_trip() that is still > useful to a new function called thermal_zone_trip_updated() and drop > the rest of it. > > While at it, make trip_point_hyst_store() reject negative hysteresis > values. > > Signed-off-by: Rafael J. Wysocki > --- Reviewed-by: Daniel Lezcano -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog