Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp437085ybt; Wed, 24 Jun 2020 03:01:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxSsRlwi+MfdKmYnChnE8hiaImbQ1YEMv/berKT3RIi1Pek4faD2jsW9XArnGH9Jly9Ns/ X-Received: by 2002:a17:907:42d5:: with SMTP id ng5mr24544411ejb.164.1592992904275; Wed, 24 Jun 2020 03:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592992904; cv=none; d=google.com; s=arc-20160816; b=Ztlr0TMwgSfvArJ4FH160KnHCRE66Yydl71De+0i2GICHBGIKEn68M7A47IUjBpVTs x9D7nPpmRv8EnH6q5cyEPsqbtshxoAd61sLPuefvHRC+5TL+sTH1KmVWsw7YeCkgXg6h TtSErHGo+Ez1fIYefa0Lv61K8cn9xxIeK0op+6FXhD8w+/2BympEzunNIhLf0TqfnHvg 5QJn3ujMFPoBKQ6t2/9BWLc96DXptajGXcIPx8xDtaqsKhdrKMEhZ1/d4wARFACzt0NJ dP43EX0m/aGFGYDJtbKEJRta38tkaeVOgXq3CnjlbM4odMpN68MUn4eztACMAg0OTSGu Qf2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:to:cc:subject:from:dkim-signature :dkim-filter; bh=Bqku5Z2OIdo8hodegXWtXPEDRyMLmFoXaOs44O9LgGY=; b=wGpKdjAaYmC8vlw01sDdGPf2NBnCXaAmHdWbQdCiqHyXArJxyYAU/DFiMwxQmRAo/c kyDXnsm7m7Nqw7mrkLwuIiB0oxZEsUvc1LjMpJYQnSFqpfVEiJIB/m+grp7OEvooNY1W JuXggXbnU89DUBkZR4wn/QwxuWWwohq5nJC6oLDScbnM9VyG2M9MsuBy3Ed1Yghrg5wn p5NiHYGe/dyWi68u2fnah1cXPdZGf7xd3NROWC+8ffd5rzH2o/v/iQw1V+xA4Vrvo7zm skLtu38iVjx/7XZZYemeLSNwKwXaCXz/RDkNrcPFbxotX60skEyWFcPwgv0iQ1ZJT56a k4kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TvRolLu9; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pw26si4592181ejb.240.2020.06.24.03.01.16; Wed, 24 Jun 2020 03:01:44 -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=@samsung.com header.s=mail20170921 header.b=TvRolLu9; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388502AbgFXKBG (ORCPT + 99 others); Wed, 24 Jun 2020 06:01:06 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:37610 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387927AbgFXKBF (ORCPT ); Wed, 24 Jun 2020 06:01:05 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200624100102euoutp01edcf1224efc3a947a8d50f8603c14816~bcpF00u3W0346003460euoutp01b; Wed, 24 Jun 2020 10:01:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200624100102euoutp01edcf1224efc3a947a8d50f8603c14816~bcpF00u3W0346003460euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592992862; bh=Bqku5Z2OIdo8hodegXWtXPEDRyMLmFoXaOs44O9LgGY=; h=From:Subject:Cc:To:Date:In-Reply-To:References:From; b=TvRolLu9x/l07KHMASbAmXI4X4khbVZZ/2YpYMcwnxh+uGpSzxpblA4L2krFYs1kH wbVewVMrBFr/mPSPnMA0R2xDoSaK4FWDP3WVIpMYUCK18s/iMH6JWWUGZfG3bKgTOb DDK1WtBePxaL1iHIaunEgtnDfggGk8Qqw8sI0UFg= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200624100102eucas1p2d3f3756b2c2ba5b64ed39a767a9fb559~bcpFplRzk1977619776eucas1p2K; Wed, 24 Jun 2020 10:01:02 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id EE.7F.05997.D5423FE5; Wed, 24 Jun 2020 11:01:02 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200624100101eucas1p1760f7fa4f393ff936f9422265376fa69~bcpFSek221104111041eucas1p1M; Wed, 24 Jun 2020 10:01:01 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200624100101eusmtrp24c56acca41d3f004e7b71f5561752c8a~bcpFRBNrU3175831758eusmtrp2W; Wed, 24 Jun 2020 10:01:01 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-27-5ef3245dfa09 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 26.95.06314.D5423FE5; Wed, 24 Jun 2020 11:01:01 +0100 (BST) Received: from [106.120.51.71] (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200624100059eusmtip1177d3f27cc77414e1c5eea6c6dd73175~bcpDfatnW2149021490eusmtip1i; Wed, 24 Jun 2020 10:00:59 +0000 (GMT) From: Bartlomiej Zolnierkiewicz Subject: Re: [PATCH v4 08/11] thermal: Explicitly enable non-changing thermal zone devices Cc: 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, "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 , Daniel Lezcano , 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 , Zhang Rui , Allison Randal , Enrico Weigelt , Gayatri Kammela , Thomas Gleixner , kernel@collabora.com To: Andrzej Pietrasiewicz Message-ID: <0dc0796a-1559-d5e9-5297-c95281792a06@samsung.com> Date: Wed, 24 Jun 2020 12:00:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20200528192051.28034-9-andrzej.p@collabora.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Tb0xbZRTGfe9/iMW7Utc3c8RYlcSFwSaanKhDnYteFxf3xQTNwFW5gUVg swU29MMgc7AVh2wLMjtkdENo2TJqy7+yjhi60RmkAxnEOdgolFmQEkYJWgKtbe+IfPs9zzn3 nuf58HKkvJLdxB3ILxA1+epcFRNL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K2qePEwu2icILv733PvzJqUPJlXG4pk2fLFSKPxxfKKD5OV7roeDJ1e jB0M33j3jx2VRtfQ++4dPdrPD3L/7CkaqHK+dKop7yPPuqkNdQ6Q3EMJlWGusab1sOF49vQu jYVZeH7OeMEyPPZ0N3mD1zJiuUmfTdtE03/4YJSjtQMAAA== X-CMS-MailID: 20200624100101eucas1p1760f7fa4f393ff936f9422265376fa69 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200528192214eucas1p183eafb73cad6465e71e779fb68679f03 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200528192214eucas1p183eafb73cad6465e71e779fb68679f03 References: <20200528192051.28034-1-andrzej.p@collabora.com> <20200528192051.28034-9-andrzej.p@collabora.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 5/28/20 9:20 PM, Andrzej Pietrasiewicz wrote: > Some thermal zone devices never change their state, so they should be > always enabled. > > Signed-off-by: Andrzej Pietrasiewicz > --- > drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c | 8 ++++++++ > drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 9 ++++++++- > drivers/platform/x86/intel_mid_thermal.c | 6 ++++++ > drivers/power/supply/power_supply_core.c | 9 +++++++-- > drivers/thermal/armada_thermal.c | 6 ++++++ > drivers/thermal/dove_thermal.c | 6 ++++++ > .../thermal/intel/int340x_thermal/int3400_thermal.c | 5 +++++ > .../intel/int340x_thermal/int340x_thermal_zone.c | 5 +++++ > drivers/thermal/intel/intel_pch_thermal.c | 5 +++++ > drivers/thermal/intel/intel_soc_dts_iosf.c | 3 +++ > drivers/thermal/intel/x86_pkg_temp_thermal.c | 6 ++++++ > drivers/thermal/kirkwood_thermal.c | 7 +++++++ > drivers/thermal/rcar_thermal.c | 9 ++++++++- > drivers/thermal/spear_thermal.c | 7 +++++++ > drivers/thermal/st/st_thermal.c | 5 +++++ > drivers/thermal/thermal_of.c | 10 +++++++++- > 16 files changed, 101 insertions(+), 5 deletions(-) [...] > diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > index 3c0397a29b8c..8e8c9af7e5f4 100644 > --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > @@ -485,6 +485,10 @@ static int int3400_thermal_probe(struct platform_device *pdev) > goto free_art_trt; > } > > + result = thermal_zone_device_enable(priv->thermal); I'm not sure about correctness of this addition. This driver contains ->set_mode but doesn't call it on initialization (in v3 it was using THERMAL_DEVICE_DISABLED as .initial_mode parameter). > + if (result) > + goto free_tzd; > + > priv->rel_misc_dev_res = acpi_thermal_rel_misc_device_add( > priv->adev->handle); > > @@ -518,6 +522,7 @@ static int int3400_thermal_probe(struct platform_device *pdev) > free_rel_misc: > if (!priv->rel_misc_dev_res) > acpi_thermal_rel_misc_device_remove(priv->adev->handle); > +free_tzd: > thermal_zone_device_unregister(priv->thermal); > free_art_trt: > kfree(priv->trts); [...] > diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c > index 43a516a35d64..011fd7f0a01e 100644 > --- a/drivers/thermal/thermal_of.c > +++ b/drivers/thermal/thermal_of.c > @@ -1066,7 +1066,7 @@ int __init of_parse_thermal_zones(void) > for_each_available_child_of_node(np, child) { > struct thermal_zone_device *zone; > struct thermal_zone_params *tzp; > - int i, mask = 0; > + int i, ret, mask = 0; > u32 prop; > > tz = thermal_of_build_thermal_zone(child); > @@ -1113,6 +1113,14 @@ int __init of_parse_thermal_zones(void) > of_thermal_free_zone(tz); > /* attempting to build remaining zones still */ > } > + ret = thermal_zone_device_enable(zone); This doesn't seem correct as it is done too early and there is already proper thermal_zone_device_enable() call in thermal_zone_of_sensor_register(). > + if (ret) { > + thermal_zone_device_unregister(zone); > + pr_err("Failed to enable thermal zone\n"); > + kfree(tzp); > + kfree(ops); > + of_thermal_free_zone(tz); > + } > } > of_node_put(np); > Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics