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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 237C2C433FE for ; Thu, 10 Nov 2022 14:12:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230469AbiKJOML (ORCPT ); Thu, 10 Nov 2022 09:12:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbiKJOME (ORCPT ); Thu, 10 Nov 2022 09:12:04 -0500 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16C716DCDD; Thu, 10 Nov 2022 06:12:01 -0800 (PST) Received: by mail-ot1-x330.google.com with SMTP id cn2-20020a056830658200b0066c74617e3dso1176492otb.2; Thu, 10 Nov 2022 06:12:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=qgitUI25orkTm6hu0BUf7qb2z/SQWHD4V7BDy7lOFss=; b=Qof1BVpWA73p43EjL/UhEFiBNyunqnZqTW6lqveRYVwSClwz/+4OgDagYm/Y/HTo6P 7gjv9jwo33AqRRMr+wMHHTJoHOf4SitbCZkUE+m55SEVJ+QMkdU/LUXuTG5H/iDdX5J9 FPXdjzUiIbYoDm4puM5xAAz8BcmDoU9OoMbabL5N0P8k+CKhlOnCs7xY2I/RpJ90klFV gaAIF1VM0RTZ5zy7qO4cre9azbyyFpZL8sSzav8lMaj08Bq+NGs9w4k8oNhwVIFajlev t0AGRjEsO6Da9ZDq3xdxIWXaA84ZInMkPkBx3s+MEJW4sK+5EtQKBXxdTyI+ilCRkD+j kYPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qgitUI25orkTm6hu0BUf7qb2z/SQWHD4V7BDy7lOFss=; b=7bZ0b3UJRiJ5/FqVfyQTb256ClhHw53UG5wBdQC/WCy6OCAyskW1+P4GmkhgrCIXHm yfxbbvQDjGjEXL+gb4W91xJG2xxRwYXsmSxqFXbnyRhnIJ1DlySr86P71LLhPA5BSKFV FPBztgKsPWSU9qRRaD4Mewr0M265JJo2thU9pk3/PRSF/ZjTHvILvS1t2eV6Ma2+xHAX OsOhlV3m8c+5yrxj2SGwXl9HZA+Q0gs9m63VJBY0oyrvKW1cCEoohIUlcwYnhaFhdnJf eH5bgHS/k6zsLjWFN/IyfQlhgnBXWtitLRTTPaXj5+ABcgiiRYl2ApVQKVtMWmSuVndh /J5g== X-Gm-Message-State: ACrzQf1QYtIXKmS4Yvfj/ZdRjm1L0gWQQ5WY4cpaq48R60Cpr5Rkumlk 0EGa7zBA5/lcDq63A1sbZIc= X-Google-Smtp-Source: AMsMyM6FNRRmBkuiFe5OHi2HI6hH6b6xDPmqXhlZK1d0kjPEzn36ZBwt9Wvr5U0KJY6mtYfj7evr5Q== X-Received: by 2002:a9d:1aa:0:b0:66c:6922:8640 with SMTP id e39-20020a9d01aa000000b0066c69228640mr1402503ote.34.1668089520403; Thu, 10 Nov 2022 06:12:00 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id x66-20020acae045000000b0034d8abf42f1sm5709639oig.23.2022.11.10.06.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 06:11:59 -0800 (PST) Sender: Guenter Roeck Date: Thu, 10 Nov 2022 06:11:57 -0800 From: Guenter Roeck To: "Rafael J. Wysocki" Cc: Daniel Lezcano , Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/9] thermal/core: Introduce locked version of thermal_zone_device_update Message-ID: <20221110141157.GA2404288@roeck-us.net> References: <20221017130910.2307118-1-linux@roeck-us.net> <20221017130910.2307118-6-linux@roeck-us.net> <20221110002549.GA3550654@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 10, 2022 at 02:01:49PM +0100, Rafael J. Wysocki wrote: > On Thu, Nov 10, 2022 at 1:25 AM Guenter Roeck wrote: > > > > On Wed, Nov 09, 2022 at 08:15:17PM +0100, Rafael J. Wysocki wrote: > > > On Mon, Oct 17, 2022 at 3:09 PM Guenter Roeck wrote: > > > > > > > > In thermal_zone_device_set_mode(), the thermal zone mutex is released only > > > > to be reacquired in the subsequent call to thermal_zone_device_update(). > > > > > > > > Introduce __thermal_zone_device_update() as locked version of > > > > > > Did you mean "unlocked"? > > > > > No, I did mean "locked", as in "must be called with thermal zone device > > mutex acquired". > > > > locked: > > > > void __thermal_zone_device_update(struct thermal_zone_device *tz, > > enum thermal_notify_event event) > > { > > ... > > } > > > > unlocked: > > > > void thermal_zone_device_update(struct thermal_zone_device *tz, > > enum thermal_notify_event event) > > { > > mutex_lock(&tz->lock); > > if (device_is_registered(&tz->device)) > > __thermal_zone_device_update(tz, event); > > mutex_unlock(&tz->lock); > > } > > Thanks for the explanation. > > > Should I phrase or explain it differently ? > > I would rather say "bare" or something like that so it is all clear to > people like me, but it is your call. I updated the commit description to use "must be called with thermal device mutex held". I kept 'locked' in the subject; I don't think using 'bare' there would add any clarity. Hope that is ok. Thanks, Guenter