From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbcKHNa1 (ORCPT ); Tue, 8 Nov 2016 08:30:27 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:11982 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbcKHNaT (ORCPT ); Tue, 8 Nov 2016 08:30:19 -0500 X-AuditID: cbfec7f2-f79556d000002c42-18-5821d366a31f From: Marek Szyprowski To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, Joerg Roedel Cc: Marek Szyprowski , Inki Dae , Kukjin Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , "Rafael J. Wysocki" , Mark Brown , "Luis R. Rodriguez" , Greg Kroah-Hartman , Tomeu Vizoso , Lukas Wunner , Kevin Hilman , Tobias Jakobi , Tomasz Figa Subject: [PATCH v6 0/7] Exynos IOMMU: proper runtime PM support (use device dependencies) Date: Tue, 08 Nov 2016 14:29:17 +0100 Message-id: <1478611764-6473-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAAzWSfyyUYRzAe+59731f6q23c+MZMt1qlZb86I+nyLS19bZptWpjNavrvKEc di+isRmLnN/MuiidLmlkfu6SCaGjmMMVmjBzpJoQDdMs5+W/z2fP5/t99mwPhUkKxPZUaHgU pwqXh8kIa1xvWDUeu23aH+D2eM0D1WiqxKhgwkygZF0VgfLGc3CkbfFCaUXVJMqe/IWhqbpJ ETIaN9TU+IRAi5kdAGmMzSI0890BVXaMkmg4Zwqgnu4BMUqpmBej8sZ/AGVVDhC+Nqz5fbGI bRh9Adi3haMkW1ueRrAtT1+TbP5wGWDXDSRb/yUVZ7PqywG7WOvEalL14ks7r1l7B3FhoTGc 6rjPTeuQ3ukaUWSpY6xuboBMBNN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SSy9f5kZpIpN wFCi620XWJWIwGJGiYZDUxhBHGaBYywSi3sOglUJC0RLbDh8hgXEZhFQlVh+/TojiM0r4C5x rvMAM8Q+OYmTxyazTmDkXsDIsIpRJLW0ODc9t9hIrzgxt7g0L10vOT93EyMwnrYd+7llB2PX u+BDjAIcjEo8vC/6FSKEWBPLiitzDzFKcDArifBePqcYIcSbklhZlVqUH19UmpNafIjRFGj5 RGYp0eR8YKznlcQbmhiaWxoaGVtYmBsZKYnzTv1wJVxIID2xJDU7NbUgtQimj4mDU6qBMcw4 z/vHw5S6R8tEvLolIh1lsnoTU7t9TCPMXNPi1945blyutYTH03R7tv/dw1sajyu2lgsmCxZk rHnb8Iz9xpHbqzIn/Fkv+VmyPziHw+tv0qlkpqeP7m73ujS9S8L14dumeG/fD8faAqqCzHPr Lhc/adK7bfBPY8vrneGNE47Jts0+MWWGEktxRqKhFnNRcSIAdty8Rr0CAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161108133014eucas1p2a5dd3306a464ee840e26532f6c405b66 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161108133014eucas1p2a5dd3306a464ee840e26532f6c405b66 X-RootMTR: 20161108133014eucas1p2a5dd3306a464ee840e26532f6c405b66 References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This is another update of the patchset for adding proper runtime PM support to Exynos IOMMU driver. This has been achieved by using recently introduced device links, which lets SYSMMU controller's runtime PM to follow master's device runtime PM state (the device which actually performs DMA transaction). The main idea behind this solution is an observation that any DMA activity from master device can be done only when master device is active, thus when master device is suspended SYSMMU controller device can also be suspended. This patchset solves the problem of all power domains being always enabled. It happened, because all SYSMMU controllers (which belongs to the same domains) are permanently kept active, because existing driver was simplified and kept SYSMMU device active all the time after initialization and attaching to the master device. This patchset is based on sixth version of Rafael's "Functional dependencies between devices" patchset [1], which has been merged to Greg's driver-core-next branch [2] (last patch commit id is baa8809f60971d10220dfe79248f54b2b265f003). As Greg pointed, the branch will not be rebased and can be used as a base for applying my patchset [3]. Joerg: I hope you can merge this version on top of Greg's driver-core-next branch to iommu tree. [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1261311.html [2] git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-next [3] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1264906.html If one wants to test this patchset, I've provided a branch with all needed patches (a small fix for Exynos4 FIMC-IS DTS is still needed, it is already in samsung tree): https://git.linaro.org/people/marek.szyprowski/linux-srpol.git v4.9-iommu-pm-v6 Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v6: - removed LATE_SYSTEM_SLEEP_PM_OPS-based workaround, because it is no longer needed after introducing device links (they also take care of proper system sleep suspend/resume sequence) - updated some comments v5: https://lkml.org/lkml/2016/10/20/70 - split main patch into several small changes for easier review (requested by Luis Rodriquez) - fixed usage of runtime_pm_active, now it is guarded by pm_runtime_get_noresume() and pm_runtime_put() pair v4: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1241601.html - rebased on top of v4 of device dependencies/links patchset, what resolved system hang on reboot v3: http://www.spinics.net/lists/linux-samsung-soc/msg55256.html - rebased on top of latest device dependencies/links patchset - added proper locking between runtime pm, iommu_attach/detach and sysmmu enable/disable(added per iommu owner device's rpm lock) v2: http://www.spinics.net/lists/arm-kernel/msg512082.html - replaced PM notifiers with generic device dependencies/links developed by Rafael J. Wysocki v1: http://www.spinics.net/lists/arm-kernel/msg509600.html - initial version Patch summary: Marek Szyprowski (7): iommu/exynos: Remove excessive, useless debug iommu/exynos: Remove dead code iommu/exynos: Simplify internal enable/disable functions iommu/exynos: Set master device once on boot iommu/exynos: Rework and fix internal locking iommu/exynos: Add runtime pm support iommu/exynos: Use device dependency links to control runtime pm drivers/iommu/exynos-iommu.c | 230 ++++++++++++++++++------------------------- 1 file changed, 95 insertions(+), 135 deletions(-) -- 1.9.1