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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no 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 6E744C433DF for ; Fri, 3 Jul 2020 10:45:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 553EF207DA for ; Fri, 3 Jul 2020 10:45:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726169AbgGCKpu (ORCPT ); Fri, 3 Jul 2020 06:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725984AbgGCKpu (ORCPT ); Fri, 3 Jul 2020 06:45:50 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD40AC08C5C1; Fri, 3 Jul 2020 03:45:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 648AC2A617B Subject: Re: [PATCH v7 00/11] Stop monitoring disabled devices To: Daniel Lezcano , Zhang Rui , 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> <58265668-fc6d-729a-c126-0c73c2ea853b@linaro.org> From: Andrzej Pietrasiewicz Message-ID: <625911aa-a55f-dcbf-66b3-719117c6aa32@collabora.com> Date: Fri, 3 Jul 2020 12:45:44 +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: <58265668-fc6d-729a-c126-0c73c2ea853b@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed 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 Hi, W dniu 03.07.2020 o 08:38, Daniel Lezcano pisze: > 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! > > > I sent a short series with fixes. Daniel, can you kindly test it? Regards, Andrzej From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrzej Pietrasiewicz Subject: Re: [PATCH v7 00/11] Stop monitoring disabled devices Date: Fri, 3 Jul 2020 12:45:44 +0200 Message-ID: <625911aa-a55f-dcbf-66b3-719117c6aa32@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> <58265668-fc6d-729a-c126-0c73c2ea853b@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <58265668-fc6d-729a-c126-0c73c2ea853b@linaro.org> Content-Language: en-US Sender: linux-renesas-soc-owner@vger.kernel.org To: Daniel Lezcano , Zhang Rui , 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 List-Id: platform-driver-x86.vger.kernel.org Hi, W dniu 03.07.2020 o 08:38, Daniel Lezcano pisze: > 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! > > > I sent a short series with fixes. Daniel, can you kindly test it? Regards, Andrzej 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=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 22837C433DF for ; Fri, 3 Jul 2020 10:47:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCEA120826 for ; Fri, 3 Jul 2020 10:47:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ju9Mh9p4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCEA120826 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aewBh/Ip7J6HHl48H+mkAVhD193YpEK1ZbvxdkwhtG8=; b=Ju9Mh9p4eAHshKSVAjy8jacBw 8pXXAXaV/Jk42LG7j6UiOzuKnWPCRWcjfIoSz8p0Ugy/IJpo6C7O0yOKMRyqpUxkvF/T2AeeHu/jV l4+YmQAwEBIQm7RNM6lsF8Hq+h+J1zH1xE1+6/4DUxBioENUvEyT/l7dzpScMKMpDWjpuh7uZ2779 ncXPOzdG8pfAX3Bpzhj2JhMiXQ8pzTRtcqF8b6upIfxXJ73vLQ9GCtTmQDKFFuUtoINY5OL7w3wJt m2sga6NsTI5JiW2d3sVRiZ35jbMdBLfgFfJzNBRINnZy7wHciTtAIa1UGDhWtPQimj+DlsWl9KGen Co6Uz3qww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrJCb-0008Vz-Ls; Fri, 03 Jul 2020 10:45:53 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrJCX-0008Ty-Ge; Fri, 03 Jul 2020 10:45:50 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 648AC2A617B Subject: Re: [PATCH v7 00/11] Stop monitoring disabled devices To: Daniel Lezcano , Zhang Rui , 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 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> <58265668-fc6d-729a-c126-0c73c2ea853b@linaro.org> From: Andrzej Pietrasiewicz Message-ID: <625911aa-a55f-dcbf-66b3-719117c6aa32@collabora.com> Date: Fri, 3 Jul 2020 12:45:44 +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: <58265668-fc6d-729a-c126-0c73c2ea853b@linaro.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200703_064549_705634_1E296859 X-CRM114-Status: GOOD ( 17.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Emmanuel Grumbach , Heiko Stuebner , "Rafael J . Wysocki" , Vishal Kulkarni , Luca Coelho , Miquel Raynal , kernel@collabora.com, Fabio Estevam , Amit Kucheria , Chunyan Zhang , Bartlomiej Zolnierkiewicz , Allison Randal , NXP Linux Team , Darren Hart , Gayatri Kammela , Len Brown , Johannes Berg , Intel Linux Wireless , Sascha Hauer , Ido Schimmel , Baolin Wang , Jiri Pirko , Orson Zhai , Thomas Gleixner , Kalle Valo , Support Opensource , Enrico Weigelt , Peter Kaestle , Sebastian Reichel , Pengutronix Kernel Team , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Shawn Guo , "David S . Miller" , Andy Shevchenko Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org SGksCgpXIGRuaXUgMDMuMDcuMjAyMCBvwqAwODozOCwgRGFuaWVsIExlemNhbm8gcGlzemU6Cj4g T24gMDMvMDcvMjAyMCAwMzo0OSwgWmhhbmcgUnVpIHdyb3RlOgo+PiBPbiBUaHUsIDIwMjAtMDct MDIgYXQgMTk6NDkgKzAyMDAsIERhbmllbCBMZXpjYW5vIHdyb3RlOgo+IAo+IFsgLi4uIF0KPiAK Pj4+PiBTbyB0aGUgcmVhc29uIGlzIHRoYXQgLT5nZXRfdGVtcCgpIGlzIGNhbGxlZCB3aGlsZSB0 aGUgbXV0ZXggaXMKPj4+PiBoZWxkIGFuZAo+Pj4+IHRoZXJtYWxfem9uZV9kZXZpY2VfaXNfZW5h YmxlZCgpIHdhbnRzIHRvIHRha2UgdGhlIHNhbWUgbXV0ZXguCj4+Pgo+Pj4gWWVzLCB0aGF0J3Mg Y29ycmVjdC4KPj4+Cj4+Pj4gSXMgYWRkaW5nIGEgY29tbWVudCB0byB0aGVybWFsX3pvbmVfZGV2 aWNlX2lzX2VuYWJsZWQoKSB0byBuZXZlcgo+Pj4+IGNhbGwKPj4+PiBpdCB3aGlsZSB0aGUgbXV0 ZXggaXMgaGVsZCBhbmQgYWRkaW5nIGFub3RoZXIgdmVyc2lvbiBvZiBpdCB3aGljaAo+Pj4+IGRv ZXMKPj4+PiBub3QgdGFrZSB0aGUgbXV0ZXggb2s/Cj4+Pgo+Pj4gVGhlIHRoZXJtYWxfem9uZV9k ZXZpY2VfaXNfZW5hYmxlZCgpIGlzIG9ubHkgdXNlZCBpbiB0d28gcGxhY2VzLCBhY3BpCj4+PiB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