Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp673589rdf; Tue, 21 Nov 2023 13:08:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHU8OYXFuS9ouUzqRgU33rW6U3mayvLOCgxHOtdglr3E8Vv1DRyiezOuD3J68mbRIQPT+sg X-Received: by 2002:a05:6808:1210:b0:3af:9330:9494 with SMTP id a16-20020a056808121000b003af93309494mr622433oil.32.1700600920466; Tue, 21 Nov 2023 13:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700600920; cv=none; d=google.com; s=arc-20160816; b=Jb2L8hX6LQo7RY0eC1uLmEQZ0hnNpEv4NQn0arNFPnxsFxt/jkN1TnFt4Kn79RKw56 H/3LsuwAxIQxN+AaXbAeW0XGxnsPf7oxdYHKKJsj0AUpUHCG6PszK8eZcoJaBzv73nBu m7oAZTlGGVGI08xR3GFoha3kFVgQIA5xfd0Bch7uc7v0B10Nf27HobYyBNywYgP9hqRo 3H2UeSamTE9o+IRSrM9BusapS4Wi8RyEI3mSmSXu4Sw26Ictabfk+xop9GXxajTZ0mgq NcXCjhoQJHgeiUl+sdi2d8tvJXLx6RTTrk7q0SDahmcatkvstWZSWAtneGmg+gAvJ6OD vieA== 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; bh=tOkjgVwF8O47umecabFVCekafPgHudJSNKfyuZbqLvo=; fh=EKa0o+8mHp00+nUz1CPE2pxM6qVIQaA5ayv+aCxs++k=; b=ohsm9HRsBRu8HGD+R2bPALs4HYkvTh4CjlrMhlrD9krBCppJGc88o899Q6UI/LEKaP rp7dagPEhkkwKWK0wZ2kudQkhhSzG0Zv7QQXFOP5Q7Y+m7levRTb3x/ytccXfFQaINRP h8+y183UP+rE/YizpuFHzlar/OMihIhyDVnWcBHy8bL4178s4KOOWSKYi3BcrWMcH92J C7FvH5h0sgX9Zu//RcslaepAOdDsDbbw6f7C+gsm04DeoHVIbWWEtNyP9QU+pVMVD8hE wTERbQ6qrOFwtGKjRk3uD6s3rYi9xUemkVXkIri7ekj0dxKXhF0i/S9PhN57d7KBlpe1 uyuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bz16-20020a056a02061000b005bdd8af5a1csi12793898pgb.499.2023.11.21.13.08.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 13:08:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EDFDC80481B1; Tue, 21 Nov 2023 13:08:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbjKUVIa (ORCPT + 99 others); Tue, 21 Nov 2023 16:08:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjKUVI3 (ORCPT ); Tue, 21 Nov 2023 16:08:29 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42F3419E; Tue, 21 Nov 2023 13:08:25 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C09D8168F; Tue, 21 Nov 2023 13:09:11 -0800 (PST) Received: from [10.57.3.233] (unknown [10.57.3.233]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E7C03F7F4; Tue, 21 Nov 2023 13:08:22 -0800 (PST) Message-ID: <4e3b7661-7233-4142-a785-406ec384d90a@arm.com> Date: Tue, 21 Nov 2023 21:09:21 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 9/9] thermal: exynos: use set_trips Content-Language: en-US To: Mateusz Majewski Cc: Bartlomiej Zolnierkiewicz , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20231120145049.310509-1-m.majewski2@samsung.com> <20231120145049.310509-10-m.majewski2@samsung.com> From: Lukasz Luba In-Reply-To: <20231120145049.310509-10-m.majewski2@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 13:08:38 -0800 (PST) On 11/20/23 14:50, Mateusz Majewski wrote: > Currently, each trip point defined in the device tree corresponds to a > single hardware interrupt. This commit instead switches to using two > hardware interrupts, whose values are set dynamically using the > set_trips callback. Additionally, the critical temperature threshold is > handled specifically. > > Setting interrupts in this way also fixes a long-standing lockdep > warning, which was caused by calling thermal_zone_get_trips with our > lock being held. Do note that this requires TMU initialization to be > split into two parts, as done by the parent commit: parts of the > initialization call into the thermal_zone_device structure and so must > be done after its registration, but the initialization is also > responsible for setting up calibration, which must be done before > thermal_zone_device registration, which will call set_trips for the > first time; if the calibration is not done in time, the interrupt values > will be silently wrong! > > Signed-off-by: Mateusz Majewski > --- > v4 -> v5: Simplified Exynos 7 code, used the correct register offsets > for Exynos 7 and refactored some common register-setting code. > v2 -> v3: Fixed formatting of some comments. > v1 -> v2: We take clocks into account; anything that sets temperature > thresholds needs clk. > > drivers/thermal/samsung/exynos_tmu.c | 393 ++++++++++++++------------- > 1 file changed, 209 insertions(+), 184 deletions(-) The code LGTM and I like the idea of dynamically configured IRQs for trips. Reviewed-by: Lukasz Luba Regards, Lukasz