Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2223261ybt; Fri, 3 Jul 2020 04:05:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywk+FUGfHwyJ1pUyRn4ouCko6jZV8NM8v5MurL3//iFMkazCpa/M6ifQDEG5+9HWlRHzVl X-Received: by 2002:aa7:d650:: with SMTP id v16mr39873388edr.361.1593774355440; Fri, 03 Jul 2020 04:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593774355; cv=none; d=google.com; s=arc-20160816; b=lhWyixTwHbEyQAsAM6nINeF1NdO8WtXdZ7p5Lm1QeF0y+ZLSaBi0K644V4Ut0UHP6a 6aWHaXzzKMBWhIcJTzGljSKqT4cF/nYHXMu+D+nf1gGmeEcWvat/suzGsOtNXoXAqeus ApE7jRqB92JlDYdaluX6NLLcPaaluveawA6KL2d+eHHt/Rv0I/0utGpcI93ZD7hSlD4n yNy8k1oZddMzc0KJh4wfsKcnKHaNfWCo9BNnKvNvpw4Yf2ln7nmwRaVZbX98yz1TPM9W GMCroTT8gfZQAP+N7iZI3QbETxJeHxc6Vp3W5uWO3a8MGiYT1HKisSBirmF9XS68qzh6 Kp+w== 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=3V8xENO3GmDZDQdIsL9fROUuBGe1Tx1oO+97CX2LTX8=; b=qDEBr4rd2Iw0ZXFE49R844rOj8olelcg8nIsCGMOJZOI06qkCayL7vr+fZFuwku1GX qUK1jwj/liPjgnaiIUJRHl+9zCi3VtCIkaUbXIjSIAwIuXHmMxOUuIq54z/39Oemlnqj jB+9n0+1ugDhtXa13ukhEfhjvR1c9QtlqvOB5UN5GrJaRBubEtE2tAo6hcFq6LjNeWXK 1R77gBYgIE5zgQWOkxD5mU7SOs3Olf7sjuEsrk81J4ny6OORVlZ78L/1ppFwD0LLGMba X5WWdPT6jziQL/pE8PiT9eOCwbawW4SvWexnUTOAiPbkibxf+Fm0sk+1Y9GtL8aVl4zD /NHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o+WYd9Lj; 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 lm6si7686320ejb.268.2020.07.03.04.05.20; Fri, 03 Jul 2020 04:05:55 -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=o+WYd9Lj; 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 S1725915AbgGCLFQ (ORCPT + 99 others); Fri, 3 Jul 2020 07:05:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgGCLFP (ORCPT ); Fri, 3 Jul 2020 07:05:15 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27BF3C08C5DE for ; Fri, 3 Jul 2020 04:05:15 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id f139so33669552wmf.5 for ; Fri, 03 Jul 2020 04:05:15 -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=3V8xENO3GmDZDQdIsL9fROUuBGe1Tx1oO+97CX2LTX8=; b=o+WYd9LjQwXET+4lKvAmTVqDbkriQn2PZFkMX+cf7sO6gJ5zFu6/DhSy0j1kHVB71l LDN/Yd/xSBBpvmLwH1lOauD9RCBcY637YAg5vLYpQWiW3Gh/QwpbItyYAwL1+F+3UjaU UoDj1ms1Xc8Ry3kflHXShGqBKhP4RYEeSxCdTNhpJnP+VjKMOw+YLByPMn0IIia2/QsU 9+kYZpn/BMWfx3NmOCLkcrnqEOvupOjNe3XsAP0bAidb5SodU24GqeuXitqHYGqyr97W yAZZuhc6dPORFV95pVU3XtgHH3FCuwlVE6VrWquMnm/F/Q8HHvZZIwcTuyPBYhqAixeF Q40w== 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=3V8xENO3GmDZDQdIsL9fROUuBGe1Tx1oO+97CX2LTX8=; b=r17kwm85PMVF7MW1O2ipVnjWV3DD8rXfsQAdyDRBMMvxQSEtqpre1QDs+X4+UgQmzI CkjlzfkN6fLBi8hn0L9xBb8LMGzSZK3nUzjK8u3U4kCIxjzWghHlgZ5S652Nv3z+UtxJ yhPaENco/kwFI05t61CEQa2qVCqlb969VvjurEqK0JaZyBFAIktATwO+Mw7uTxSmeSn/ H4B6Z4xuE7GDzVRs6FdxvepY3o452o7Q4iTAOmPZ9UqOMD3JWY4Rjj02x13yndUr0/MY FUG2a0njFPED2Exv7z5okSlVgSWVpMnT5IBgBNyQP6VAuf2ur/tH9D0+9LaonXHiBTy/ vf9Q== X-Gm-Message-State: AOAM533jogaG+0sKHDMgS09XSygrUXIXcDvwwo0PXHtHSAUuHGW62eA9 5YAZxZQOJJeZ73B9KmUqZAMUIA== X-Received: by 2002:a1c:2392:: with SMTP id j140mr35420704wmj.6.1593774313405; Fri, 03 Jul 2020 04:05:13 -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 j16sm13782474wrt.7.2020.07.03.04.05.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jul 2020 04:05:12 -0700 (PDT) Subject: Re: [PATCH v7 00/11] Stop monitoring disabled devices To: Andrzej Pietrasiewicz , 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> <625911aa-a55f-dcbf-66b3-719117c6aa32@collabora.com> From: Daniel Lezcano Message-ID: <9fcd1d07-26af-4ff3-56d7-7226ef42a7e6@linaro.org> Date: Fri, 3 Jul 2020 13:05:06 +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: <625911aa-a55f-dcbf-66b3-719117c6aa32@collabora.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 12:45, Andrzej Pietrasiewicz wrote: > 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? I confirm the i.MX is now correctly booting with the thermal zone temperature available. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog