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: 749688 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="D54GpXlU" Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE53C10FF for ; Fri, 1 Dec 2023 01:56:41 -0800 (PST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20231201095638euoutp01edbd254945129bc6520fe54d569abd4d~crKhY20Xc3266132661euoutp01q for ; Fri, 1 Dec 2023 09:56:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20231201095638euoutp01edbd254945129bc6520fe54d569abd4d~crKhY20Xc3266132661euoutp01q 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 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJKsWRmV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gzd8nLuia8rrdwXrvNM/6NfdCXkXMCNvvpSe/3cz/R1+ 29rzRfvKuCy/67iuKD6gcCFRPYOTK8ryOv82UzfGJQlBL/WSriuxFGckGmoxFxUnAgA0wCdI OAMAAA== X-CMS-MailID: 20231201095637eucas1p25e14bd24e05ae61eb12dee18af2a1dc5 X-Msg-Generator: CA X-RootMTR: 20231201095637eucas1p25e14bd24e05ae61eb12dee18af2a1dc5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231201095637eucas1p25e14bd24e05ae61eb12dee18af2a1dc5 References: 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(-)