Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4129245rdb; Mon, 11 Dec 2023 09:35:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsiLAJ5t4Rdtc4f1+bvSBg969abtJBu8uP/71pd/y1HlNa+w+88dkRl5JZCLT4CubjqWVi X-Received: by 2002:aa7:9214:0:b0:6ce:f6f2:2ac5 with SMTP id 20-20020aa79214000000b006cef6f22ac5mr1238734pfo.16.1702316108786; Mon, 11 Dec 2023 09:35:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702316108; cv=none; d=google.com; s=arc-20160816; b=drbgUqQhoInFG2fO2p46Lu7t/JaEx/qPMBkuypPbn3J9sZHr+TBvgi27ndqAs59B3g Ik9vU9rM5Bru36XiUZX8Y1/NayH+8HnuvT0mUrUJxj2NzhDZXwtJuIFK2ifYINjYItGm 2JGFzRWPIz5CHu3ujbJ8TI7fnaeoLWWpoE04zHWK4UU2dEquGta6relqEEoiWPOY/KKs 4bC+xQXhpfrHozJRYJWpqjpoMpDm93vN1OwAoFjDIl+vRN4aPNEJVKOFVvECnhyHVk0R eP/TGpwkeeC8GImnQMY8zxy9M9JLVTT8IzKr2lLrbUUx80UGEcNPOWJi2qRShNpXz+7l DLaA== 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=gstntUJJhuUruQ6CLNsepakisEqtUTeEbOuI9lM82/A=; fh=sK4Tc0dqW1+VfldxJe0fJiJm4djpTXt4/3mAd9SgNU8=; b=SmtH1JLe4O9vN/Mu2jiXSusHJ4coI+l+r+5Tl3kAhhBt9cqSMmg3xHhsI/7AuBq5tb R6uq+01aMPiVn5zgtD9Q3NuFhXLLJaGLYL2daiBVscQ3xQDe0diNJzx7gq6h7u+W2HyC msOnn1/saX+XKIMjJyFi2CNytwnB23sDP67QqdE6Fve6dP710ivpqvpaYxn2025w47Fx Xr7eW6rFgK3aV8V1wPloKnU8eM9dmoFQ76X0T3TpXAyy3Qnfc0ivbMqZUWKlBPCzNho5 BlKK3FZ/vDeSXxLRlZ/iPEXc6hSS6Sj2LzMG2YQ5KHMEBDiOQLUI42tq36fW3Jxo1bAA gyRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q99BuM+Y; 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 j18-20020a632312000000b005c676beba09si6123096pgj.74.2023.12.11.09.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 09:35:08 -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=q99BuM+Y; 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 1E35680564AC; Mon, 11 Dec 2023 09:35:07 -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 S1344733AbjLKRe5 (ORCPT + 99 others); Mon, 11 Dec 2023 12:34:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344738AbjLKRez (ORCPT ); Mon, 11 Dec 2023 12:34:55 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC97F101 for ; Mon, 11 Dec 2023 09:34:59 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-336121f93e3so1304517f8f.0 for ; Mon, 11 Dec 2023 09:34:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702316098; x=1702920898; 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=gstntUJJhuUruQ6CLNsepakisEqtUTeEbOuI9lM82/A=; b=q99BuM+YhGN4lKfpf3MGaomsJifhCbtczimCixr3f6qWNcTug2KRXhqiZgm4qKk1pm D6lUOVIyjQYDL6chdWBNsYypi1PRs41p/26LtIeR5zqa3l2xEIDRyoU9HgPOVaptvyt6 +e73dW48t7eyConI/pXcdcm7VnxO3L+/liSPNb/o6pAVJqL/g21LEoo306UgBn+CsKB0 58wxMYb4PxUH1s690OLgIbo7UVquXJ+uj38Fk6gGJrxJlrR05MXMlSlNnv1uipwC2KF4 aY5/FbIfRoXOvbHfkZFzdWX11P3R7eNDVO5z4QcvciMilv5E+yuJ0Tv7fgllNi9gzL0i mYOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702316098; x=1702920898; 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=gstntUJJhuUruQ6CLNsepakisEqtUTeEbOuI9lM82/A=; b=uPvT7qY19pkfLyH1ciRXisOXLJonW9OiC5nCQUyvAMCbSHLCAjFtN4ZokY3flXvBmC e24zNj+d/RSY81RTZIuoAxicE3ZVzhsFYne2GIZQ4e/0wvBkDFMYxfU5InQXlZpEhE+r eE7qO0+j97Y7mr1LPYTVArMrsrJCTnk9yCQ7OiA5KmOthqTJhEJLZCUXjIlLFGAyONjB RCMmOrXpZ4S3PRgYR0A0B6A+nalX1htF86OZt/Yi/KdP5m/9YIpxBCXpbr7ZKy1kAP4b 0JNEeIvU2u/AQ/2EOoZVxNXIB7Kz01mimwRpQwMRNZWX2sOQSe3Iyh5yJD2lOwQ8LJGi J1qg== X-Gm-Message-State: AOJu0YxIW4p1Sz6TTara0fn/GzybEleqmJ/OdH+5weIdjBJcWDYJ4cS3 wy7vb27BLuCVNmd0778qjqW2tw== X-Received: by 2002:a5d:4712:0:b0:332:f501:8b56 with SMTP id y18-20020a5d4712000000b00332f5018b56mr2572878wrq.23.1702316098228; Mon, 11 Dec 2023 09:34:58 -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 g3-20020adff403000000b003335ddce799sm9046899wro.103.2023.12.11.09.34.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Dec 2023 09:34:57 -0800 (PST) Message-ID: <535558f8-096b-4917-92d2-b0defed42b15@linaro.org> Date: Mon, 11 Dec 2023 18:34:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/3] thermal: core: Make thermal_zone_device_unregister() return after freeing the zone Content-Language: en-US To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Linux PM , Srinivas Pandruvada , Zhang Rui , Linux ACPI , LKML , Lukasz Luba References: <1880915.tdWV9SEqCh@kreacher> <13414639.uLZWGnKmhe@kreacher> <0a0d5dd4-6b7a-428b-8ef1-bb6aff76fb51@linaro.org> From: Daniel Lezcano In-Reply-To: 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=unavailable 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]); Mon, 11 Dec 2023 09:35:07 -0800 (PST) On 11/12/2023 17:42, Rafael J. Wysocki wrote: > On Mon, Dec 11, 2023 at 5:28 PM Daniel Lezcano > wrote: >> >> On 08/12/2023 20:13, Rafael J. Wysocki wrote: >>> From: Rafael J. Wysocki >>> >>> Make thermal_zone_device_unregister() wait until all of the references >>> to the given thermal zone object have been dropped and free it before >>> returning. >>> >>> This guarantees that when thermal_zone_device_unregister() returns, >>> there is no leftover activity regarding the thermal zone in question >>> which is required by some of its callers (for instance, modular driver >>> code that wants to know when it is safe to let the module go away). >>> >>> Subsequently, this will allow some confusing device_is_registered() >>> checks to be dropped from the thermal sysfs and core code. >>> >>> Signed-off-by: Rafael J. Wysocki >>> --- >> >> Definitively agree on the change >> >> Acked-by: Daniel Lezcano > > Thanks! > >> Would it make sense to use kref_get/put ? > > Why and where? Well it is a general question. Usually this kind of removal is tied with a refcount -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog