From patchwork Mon Nov 20 14:50:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 745553 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21CE8C197A0 for ; Mon, 20 Nov 2023 14:52:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233859AbjKTOwO (ORCPT ); Mon, 20 Nov 2023 09:52:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233297AbjKTOvy (ORCPT ); Mon, 20 Nov 2023 09:51:54 -0500 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FB3910F1 for ; Mon, 20 Nov 2023 06:51:02 -0800 (PST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231120145058euoutp0289baa89c4479fd6ffacd1cf865875683~ZXFXtEpLx2487424874euoutp02c for ; Mon, 20 Nov 2023 14:50:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231120145058euoutp0289baa89c4479fd6ffacd1cf865875683~ZXFXtEpLx2487424874euoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1700491858; bh=kWsxoLQNXYZ1sg/aFjeO2DmyiYG2CGJGIrMWlbQssos=; h=From:To:Cc:Subject:Date:References:From; b=sBXcqkjzFS+tJ4kQ5DXqArlNzHFfuU8lN61S1lgku27DNLXfqsTCsMqZwOAcTHkG4 d58kwdtLJaerGSlZ3d3e8+vUUlhkJK/CadJwBB/z4SPL2A2G2P0zg9NoMOuK7+IyQ0 8Xp8F1JMqbizg15V0C0vO5T8qooMwUvsZr6cmad0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231120145057eucas1p28fcd91b9d36324a7ed5aaeb6e8732682~ZXFXPX2fG1152011520eucas1p2s; Mon, 20 Nov 2023 14:50:57 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id E4.37.09539.1527B556; Mon, 20 Nov 2023 14:50:57 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231120145057eucas1p2d3f7936d6a988d138af18e0011e7ad75~ZXFWp3QmW1152011520eucas1p2r; Mon, 20 Nov 2023 14:50:57 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231120145057eusmtrp232c8ff735899e1d7f795311f1994d531~ZXFWo-u0U0691806918eusmtrp2z; Mon, 20 Nov 2023 14:50:57 +0000 (GMT) X-AuditID: cbfec7f2-52bff70000002543-3f-655b7251e0c2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8E.B3.09146.1527B556; Mon, 20 Nov 2023 14:50:57 +0000 (GMT) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231120145056eusmtip283cfcb2cc1784047a130724fc22843e0~ZXFVygwwk1014210142eusmtip2Z; Mon, 20 Nov 2023 14:50:56 +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 Subject: [PATCH v5 0/9] Improve Exynos thermal driver Date: Mon, 20 Nov 2023 15:50:40 +0100 Message-ID: <20231120145049.310509-1-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKKsWRmVeSWpSXmKPExsWy7djPc7qBRdGpBvcuGVs8mLeNzeLw/AqL qQ+fsFl833KdyWLeZ1mLva+3slt8u9LBZLHp8TVWi8u75rBZfO49wmgx4/w+JouFTS3sFhOP TWa2WHvkLrvF3C9TmS2ePOxjcxDwWDNvDaPHzll32T0W73nJ5LFpVSebx51re9g8Ni+p9+jb sorR4/MmuQCOKC6blNSczLLUIn27BK6Mo/+vMRZM46+4veQaWwNjP08XIweHhICJxJa7Hl2M XBxCAisYJZZPXckG4XxhlNgzoZMJwvnMKPHsy1cghxOs4/imYywgtpDAckaJE/+cIIpamST+ T3nLCJJgEzCQePBmGTuILSLQyigxs0kdpIhZ4CuzxNXX85lBdgsLmErsveQDUsMioCrR0rEY bAGvgK3Em/U9rBDL5CX2LPoOFReUODnzCdhiZqB489bZzCAzJQS+cEh0rToN1eAisfnzRBYI W1ji1fEt7BC2jMT/nfOhPsiXmLH5PQvE/xUSdw96QZjWEh/PgF3GLKApsX6XPkSxo8TKNxMZ ISr4JG68FYQ4gE9i0rbpzBBhXomONiGIalWJ43smMUPY0hJPWm5DrfSQ2LjpJTtIuZBArMS7 tpoJjAqzkHw1C8lXsxBOWMDIvIpRPLW0ODc9tdgwL7Vcrzgxt7g0L10vOT93EyMwpZ3+d/zT Dsa5rz7qHWJk4mA8xCjBwawkwvtNKCJViDclsbIqtSg/vqg0J7X4EKM0B4uSOK9qinyqkEB6 YklqdmpqQWoRTJaJg1OqgUmcI3De0oDEohrlv7cabz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ZxgpBG743vM9G0nrsbn 1YZ7a8xyzvF8sLvhRqFfqqLfypv5P5PELqZ2vPnhIxIRdTCsVsOUZXv7pH+mRz58PqYlubXu ikWG/cztFgkB9i9neKzaY6H9KqI0Nf+NjW5BqALbbNGY41yn+tzrQmqv9/6PcN/YeWPt3Pak ienn/HUmrOjs9phd3X9m7rX5p4O+9H0OvfNg/iqVXXyH74bkGZ1mTGzK2OtaXWhjpTqvgONH 44ttZyJzVS5N3MT8+veWL8FshznkEpftF7gophSj1BH9oSN9N/PxqH3595a+fWV12/l95va9 ttsnTJ3x9VBEmphs/MbGBP+WyPaqfX85bu//8uuLEktxRqKhFnNRcSIA+mxlFzQDAAA= X-CMS-MailID: 20231120145057eucas1p2d3f7936d6a988d138af18e0011e7ad75 X-Msg-Generator: CA X-RootMTR: 20231120145057eucas1p2d3f7936d6a988d138af18e0011e7ad75 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231120145057eucas1p2d3f7936d6a988d138af18e0011e7ad75 References: Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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: 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 | 532 +++++++++++++-------------- 1 file changed, 258 insertions(+), 274 deletions(-) Reviewed-by: Lukasz Luba