From patchwork Fri Dec 1 09:56:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13475594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18D5DC4167B for ; Fri, 1 Dec 2023 09:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: List-Owner; bh=CaJE9X7wcMNL5g43+HtZse2a6kux/NEyw+x8VyiH4OU=; b=ugJtRThybVv0W7 vM0MC4onrXxTTwYgYHiri/asTBPCSR3yjgOdQVPSsngyl+cegPsvphAoUW0ObrlAfZHV0lhzGyXhn 3HOS6ft6sM1mLpENDgvFoE47vaR4uI5uGUwwNzgas9xG4/yoS5kjMaBv8IEnuERO4n2YaNiw/NMDX 8EWvG9Rhc1sRgeogANCeeIUCqliItpAw1+YQeRsI65ykMFvEQb9zbCeTEheN0sT9Pew5vH59pKDLz W3cjdznJOZK/Z7TKd4w8GYiIHo2JqSh3l8cvjRIcPPADgn06gKbFji7DvhqVM/uN12yOGoDw+rfxv vjf9zhQJzpUz0eQVxVqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r90GU-00D90p-28; Fri, 01 Dec 2023 09:56:54 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r90GL-00D8uS-3A for linux-arm-kernel@lists.infradead.org; Fri, 01 Dec 2023 09:56:50 +0000 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231201095638euoutp02f6d62e86f71768b421ada5399fecaf9f~crKhWdZJB0701507015euoutp02h for ; Fri, 1 Dec 2023 09:56:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231201095638euoutp02f6d62e86f71768b421ada5399fecaf9f~crKhWdZJB0701507015euoutp02h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1701424598; bh=106CZkth6hhVA2GeHffBolAXmeoKzLlk2xMt1fH43Hw=; h=From:To:Cc:Subject:Date:References:From; b=D54GpXlU/BkUXdJ0xQ4tObKtgsTPEaGwTwoW4tCeN6e2pVCC2Y3Czk9dgUbwIvIEC 9zCSNE3YE2He8F+C+rvfnVwxKQ43Mi9PjVrLM4O1BsR/HJLPkh7eScNiDnMSuQ0LOA 1YxCxJB2wZbMLhCAFWbjwcydVFFE8Q6125oAM0UM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231201095637eucas1p24daf3a73854e038c995442c08df054c3~crKg22ki72503225032eucas1p2G; Fri, 1 Dec 2023 09:56:37 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 4F.32.09814.5DDA9656; Fri, 1 Dec 2023 09:56:37 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231201095637eucas1p25e14bd24e05ae61eb12dee18af2a1dc5~crKgXSBn11612516125eucas1p2W; Fri, 1 Dec 2023 09:56:37 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231201095637eusmtrp175840ba9962ac971a809e70c1b4a0c95~crKgWfadY0736407364eusmtrp1y; Fri, 1 Dec 2023 09:56:37 +0000 (GMT) X-AuditID: cbfec7f4-727ff70000002656-da-6569add5abbd Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 92.20.09146.5DDA9656; Fri, 1 Dec 2023 09:56:37 +0000 (GMT) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231201095636eusmtip22e4e7027907d2125b29c0a2bde3512b9~crKfcYENZ1357813578eusmtip2I; Fri, 1 Dec 2023 09:56:36 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski , Lukasz Luba , Dan Carpenter Subject: [PATCH v6 0/9] Improve Exynos thermal driver Date: Fri, 1 Dec 2023 10:56:16 +0100 Message-ID: <20231201095625.301884-1-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJKsWRmVeSWpSXmKPExsWy7djPc7pX12amGsw6r27xYN42NovD8yss pj58wmbxfct1JosP81rZLeZ9lrXY+3oru8W3Kx1MFpseX2O1uLxrDpvF594jjBYzzu9jsljY 1MJuMfHYZGaLtUfuslvM/TKV2eLJwz42B0GPNfPWMHrsnHWX3WPxnpdMHptWdbJ53Lm2h81j 85J6j74tqx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TR: 20231201095637eucas1p25e14bd24e05ae61eb12dee18af2a1dc5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231201095637eucas1p25e14bd24e05ae61eb12dee18af2a1dc5 References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231201_015646_702273_86FB3229 X-CRM114-Status: GOOD ( 12.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This work improves Exynos thermal driver in various ways. This is related to the discussion in https://lore.kernel.org/all/97201878-3bb8-eac5-7fac-a690322ac43a@linaro.org/ The primary issue being fixed is a lockdep warning, which is fixed by the thermal: exynos: use set_trips patch. We also simplify the code in general. Changelog: v6: - Fixed cleanup after split initialization failure v5: - Used BIT wherever possible - Simplified Exynos 7 code and used the correct register offsets for Exynos 7 - Refactored some common register-setting code v4: - Resolved merge conflict when applying thermal: exynos: split initialization of TMU and the thermal zone - Reordered calls done when leaving exynos_tmu_initialize for symmetry v3: - Fixed regulator initialization - Fixed formatting of some comments v2: - Added missing field descriptions - Removed an unnecessary field description - Removed the commits that made clock management more fine-grained (need more discussion), and adapted the new code to manage clocks - Removed the devicetree changes (will be uploaded separately), changing the recipient list accordingly - Improved formatting of the devm_request_threaded_irq call Mateusz Majewski (9): thermal: exynos: remove an unnecessary field description thermal: exynos: drop id field thermal: exynos: switch from workqueue-driven interrupt handling to threaded interrupts thermal: exynos: handle devm_regulator_get_optional return value correctly thermal: exynos: simplify regulator (de)initialization thermal: exynos: stop using the threshold mechanism on Exynos 4210 thermal: exynos: split initialization of TMU and the thermal zone thermal: exynos: use BIT wherever possible thermal: exynos: use set_trips drivers/thermal/samsung/exynos_tmu.c | 547 ++++++++++++++------------- 1 file changed, 274 insertions(+), 273 deletions(-)