Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2078082ybt; Thu, 2 Jul 2020 23:39:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLGH9P5s8YZzXJKiXEiSAHtbu33eIZmDZyFuAd/s2Lr2xSgtRkFlTprbv9nWokUgvAg4F5 X-Received: by 2002:a17:906:d92e:: with SMTP id rn14mr32657035ejb.314.1593758389347; Thu, 02 Jul 2020 23:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593758389; cv=none; d=google.com; s=arc-20160816; b=BZOURrYlFjge18zHz/MKT5B/MF/DfbRpI/y/ktPAxJbtgyJ0WSm6Eh3FxwKyjZON2t RQGS0CAhJkGovMAJCweLTA4EGy08mSIT/w2k4AGfsnZYuzL3jFq0WTJv2momyTy51CwA C12gr/CipnOaZpfVmpTzT1ZagCtUVEOpDsGyqBhn3Mbj4n05PKHsOaiUUk9XNZfKqrCQ qq81PcZgrrj4AtXLI31S4QBhoVSqUwqJTRnert1LpoJ136G3j4t95WPtDrIqY/2lt4wI VFqXSOveKZ8GmWYN/mdBiiA1ZLsH9nuio+MqL2r+olIzfw1nLi8v1YumEbFU4yp3wt8N Q1kg== 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=eorUmfUDMZcNbxM4Fi+PFLp5IkxH/y0wJ21yqWKUjto=; b=PN7x797h1MziRds3KXevR9XfH+3ncEPrcsvvfR71o/74WPMKbTFuCdOvJtFqGkIfix a4ShEdJ/oRG/ImmfR0/+Q0Ml53n2mTdaMOmXhhc3hRBz6ga8BxJSSBoOeI2+Fvx99Dot Q8HlSFU1AKyvhq+q8B6RtPcAcJO1Vy1juLO/LUECbf5qmwJh51nI4174EkEXdbIZAZx5 7gruLYS2zNSEInYJoq/yo6Fs7uSlmSE3SfYPgH+wtjoL696Bl+h0aLH6yMPaBVd9Ltis U49baTncDXw9A23FpB16hpw4tVbuyUAPCAgCiZrxri04QvdVZYTPM5fDFCzjb+G7rrjI C36Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TW3k/K6s"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 be11si5100226edb.482.2020.07.02.23.39.07; Thu, 02 Jul 2020 23:39:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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="TW3k/K6s"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S1726194AbgGCGiz (ORCPT + 99 others); Fri, 3 Jul 2020 02:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbgGCGiy (ORCPT ); Fri, 3 Jul 2020 02:38:54 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE413C08C5DD for ; Thu, 2 Jul 2020 23:38:53 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id o2so32626864wmh.2 for ; Thu, 02 Jul 2020 23:38:53 -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=eorUmfUDMZcNbxM4Fi+PFLp5IkxH/y0wJ21yqWKUjto=; b=TW3k/K6sgcyOzEJs1rw4KfmOe6mN35kwzPQC2F/IgbreSFQA8LXxI7YB4jg768YPf/ qlg1GD44Sj2mlQxBQfGEjhGX+c1yfO9Z2Mc+s3nSyOkzpJAHcbxMv5x83AFf4RMl33Gm yETeAQpLmJArPgsTWZB5qQKZ8Av/jgJcSZrGjUH26ysjAUnp1x07PQ8p12XuVcqaQK5X GMh0+9HUQqJoYLlyJFUBhedpmjHLeeAZnlpCjwpSz8Hl1wDM4IBIpPuTU1aSgw+6hhf5 PQOMSuzQnnW914bYoIpCxkKUDZ3G876lD7uO8p49b0PgquhyTREZXOsoMzsDs/Eo5jcO p6mQ== 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=eorUmfUDMZcNbxM4Fi+PFLp5IkxH/y0wJ21yqWKUjto=; b=YKea9iYGRcNlGCTkeCs2WxcJl4BvvPxROLqAU32qD6Nv7XQMwuq/c4wlByH6qSI2qL PISEkBvW6ieB2zMbazaIo7Ya3qoDGUG7mQuBkInfJhNFxepLf9hsYwYURieyiLlr+WBZ o/wQk740xA1q4Wh022mkJPiItT2rtUtziKp6WtMD9ETxLsYJBh3R/AG2uiGl+01GoLTV vlOHw11YnnUdWzHrfbUwoZZbHMv5v33iB+ujJJZfgH0HS6rQgO3iuphhRCt432Z664ke iGKtDv4bRyJpPjPYANTVNBf5s2Ha/9q4t5Ib44PUJHf3iHSsXFJnEH8mWHyIz9Sa4DKd P7iQ== X-Gm-Message-State: AOAM532TdIaJEBg9ung6PTJT3Q8WD6h4Y7X44oIjusdP10MwpQB7F3Bh B17oGghnySA7PPyHQ1RCP4FV2g== X-Received: by 2002:a1c:7311:: with SMTP id d17mr24326224wmb.60.1593758332203; Thu, 02 Jul 2020 23:38:52 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:7019:4e9b:2970:f860? ([2a01:e34:ed2f:f020:7019:4e9b:2970:f860]) by smtp.googlemail.com with ESMTPSA id 65sm13709437wre.6.2020.07.02.23.38.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2020 23:38:51 -0700 (PDT) Subject: Re: [PATCH v7 00/11] Stop monitoring disabled devices To: Zhang Rui , Andrzej Pietrasiewicz , linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: "Rafael J . Wysocki" , Len Brown , Vishal Kulkarni , "David S . Miller" , Jiri Pirko , Ido Schimmel , Johannes Berg , Emmanuel Grumbach , Luca Coelho , Intel Linux Wireless , Kalle Valo , Peter Kaestle , Darren Hart , Andy Shevchenko , Sebastian Reichel , Miquel Raynal , Amit Kucheria , Support Opensource , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Heiko Stuebner , Orson Zhai , Baolin Wang , Chunyan Zhang , Allison Randal , Enrico Weigelt , Gayatri Kammela , Thomas Gleixner , Bartlomiej Zolnierkiewicz , kernel@collabora.com References: <20200629122925.21729-1-andrzej.p@collabora.com> <3d03d1a2-ac06-b69b-93cb-e0203be62c10@collabora.com> <47111821-d691-e71d-d740-e4325e290fa4@linaro.org> <4353a939-3f5e-8369-5bc0-ad8162b5ffc7@linaro.org> <73942aea-ae79-753c-fe90-d4a99423d548@collabora.com> <374dddd9-b600-3a30-d6c3-8cfcefc944d9@linaro.org> <5a28deb7-f307-8b03-faad-ab05cb8095d1@collabora.com> <8aeb4f51-1813-63c1-165b-06640af5968f@linaro.org> <685ef627-e377-bbf1-da11-7f7556ca2dd7@collabora.com> <44c622dd7de8c7bf143c4435c0edd1b98d09a3d6.camel@intel.com> From: Daniel Lezcano Message-ID: <58265668-fc6d-729a-c126-0c73c2ea853b@linaro.org> Date: Fri, 3 Jul 2020 08:38:48 +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: <44c622dd7de8c7bf143c4435c0edd1b98d09a3d6.camel@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 03/07/2020 03:49, Zhang Rui wrote: > On Thu, 2020-07-02 at 19:49 +0200, Daniel Lezcano wrote: [ ... ] >>> So the reason is that ->get_temp() is called while the mutex is >>> held and >>> thermal_zone_device_is_enabled() wants to take the same mutex. >> >> Yes, that's correct. >> >>> Is adding a comment to thermal_zone_device_is_enabled() to never >>> call >>> it while the mutex is held and adding another version of it which >>> does >>> not take the mutex ok? >> >> The thermal_zone_device_is_enabled() is only used in two places, acpi >> and this imx driver, and given: >> >> 1. as soon as the mutex is released, there is no guarantee the >> thermal >> zone won't be changed right after, the lock is pointless, thus the >> information also. >> >> 2. from a design point of view, I don't see why a driver should know >> if >> a thermal zone is disabled or not >> >> It would make sense to end with this function and do not give the >> different drivers an opportunity to access this information. > > I agree. >> >> Why not add change_mode for the acpi in order to enable or disable >> the >> events > > thermal_zone_device_is_enabled() is invoked in acpi thermal driver > because we only want to do thermal_zone_device_update() when the acpi > thermal zone is enabled. > > As thermal_zone_device_update() can handle a disabled thermal zone now, > we can just remove the check. Ah yes, good point! -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog