From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752451AbcJJNdF (ORCPT ); Mon, 10 Oct 2016 09:33:05 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:57103 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338AbcJJNcO (ORCPT ); Mon, 10 Oct 2016 09:32:14 -0400 X-AuditID: cbfec7ef-f79e76d000005b57-b3-57fb985a2743 Subject: Re: [PATCH v4 2/2] iommu/exynos: Add proper runtime pm support To: "Luis R. Rodriguez" Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, Joerg Roedel , Inki Dae , Kukjin Kim , =?UTF-8?Q?Krzysztof_Koz=c5=82owski?= , Bartlomiej Zolnierkiewicz , "Rafael J. Wysocki" , Mark Brown , Greg Kroah-Hartman , Tomeu Vizoso , Lukas Wunner , Kevin Hilman , Tobias Jakobi From: Marek Szyprowski Message-id: <87aeb58b-bda0-93c5-e51d-ab9be0b9d518@samsung.com> Date: Mon, 10 Oct 2016 15:32:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-version: 1.0 In-reply-to: <20161006173756.GK3296@wotan.suse.de> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+c5tZ6vVcVq9WGktDEq6KP7xkREFQUf/qhCGVuSwg1beOicj i8qyNBfZvNWY1ygqTLHmbTO8FkpUmpo1Ca3QNU0lQUMrWrmdBf73e7/3+Z6H5+NjSc0w7c8e Tz4tiMn6RC2joho6f/ZsiTH91m0fMGL81FRD46IvowzOvFfD4PxPRgpXtIbjnOInCux0zSvw rZEJEjtqRwjc31TC4JmbLxA29bQQeMy5GtuNDoRfv+qjcdb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NTMvPSbZVCQ9x0 LZQU8hJzU22VInR9Q4KUFMoSc0qBPCMDNODgHOAerKRvl+CWsX/ibuaCAxIVHyY8ZG9gPC/c xcjJISFgInGwYxILhC0mceHeerYuRi4OIYEljBKbe5YxQzjPGCVunOliA6kSFnCX+H7+EiuI LSKgLdH84jITRFEzk8T5LxPBOpgFGlklHjw8DzaXTcBQoustRDevgJ3E2YX3mEBsFgFViee7 34DViArESFx/9giqRlDix+R7YHFOASOJ54ufgNUzC5hJfHl5mBXClpfYvOYt8wRGgVlIWmYh KZuFpGwBI/MqRpHU0uLc9NxiI73ixNzi0rx0veT83E2MwNjfduznlh2MXe+CDzEKcDAq8fC+ rPwVLsSaWFZcmXuIUYKDWUmEd+e03+FCvCmJlVWpRfnxRaU5qcWHGE2BnpjILCWanA9MS3kl 8YYmhuaWhkbGFhbmRkZK4rxTP1wJFxJITyxJzU5NLUgtgulj4uCUamA8uTqzRifCSkz/pu+d jx17Iiqbd1VECBzZmfc231y89v3OjYoSdxU5i983n9WYJ/eQV8XeZRqnkfe18w5s/7lqq2bW TdNeaGuy+9XDlLaJE3Ku+u1c8iLHsXrZaf6YJQ58KxnS//IrXVnrErdW/0/ei/u7GxS/z/Pg /DVp0/yNvQd/ae/lPuugxFKckWioxVxUnAgApsw/fhMDAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161010133209eucas1p1522187963fe716745fb1b4c2e338e51a 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: 20160929081240eucas1p231c1ab5c5936886cbec6bc3f5267c940 X-RootMTR: 20160929081240eucas1p231c1ab5c5936886cbec6bc3f5267c940 References: <1475136751-31340-1-git-send-email-m.szyprowski@samsung.com> <1475136751-31340-3-git-send-email-m.szyprowski@samsung.com> <20161006173756.GK3296@wotan.suse.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Luis On 2016-10-06 19:37, Luis R. Rodriguez wrote: > On Thu, Sep 29, 2016 at 10:12:31AM +0200, Marek Szyprowski wrote: >> This patch uses recently introduced device links to track the runtime pm >> state of the master's device. This way each SYSMMU controller is runtime >> activated when its master's device is active > instead of? instead of keeping SYSMMU controller runtime active all the time. > BTW what is the master device of a SYSMMU? I have no clue about these > IOMMU devices here. Here is a more detailed description of IOMMU hardware I wrote a few days ago for Ulf: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1231006.html In short: there is a SYSMMU controller and its master device - a device, which performs DMA operations. That SYSMMU sits in between system memory and the master device, so it performs mapping of DMA addresses to physical memory addresses on each DMA operation. > >> and can save/restore its state instead of being enabled all the time. > I take it this means currently even if the master device is disabled > (whatever that is) all SYSMMU controllers are kept enabled, is that right? > The issue here is this wastes power? Or what is the issue? Yes, the issue here is the fact that SYSMMU is kept active all the time, what in turn prevent the power domain for turning off even if master device doesn't do anything and is already suspended. This directly (some clocks enabled) and in-directly (leakage current) causes power looses. > >> This way SYSMMU controllers no >> longer prevents respective power domains to be turned off when master's >> device is not used. > So when the master device is idle we want to also remove power from the > controllers ? How much power does this save on a typical device in the > market BTW ? The main purpose of this patchset is to let power domains to be turned off, because with the current code all domains are all the time turned on, because SYSMMU controllers prevent them from turning them off. If you want I can measure the power consumption of the idle board with all domains enabled and disabled if you want to see the numbers. On the other board disabling most power domains in idle state (the clocks were already disabled) gave me about 20mA savings (at 3.7V), what is a significant value for the battery powered device. > >> Signed-off-by: Marek Szyprowski >> --- >> drivers/iommu/exynos-iommu.c | 225 ++++++++++++++++++------------------------- >> 1 file changed, 94 insertions(+), 131 deletions(-) > I'm reviewing the device link patches now but since this is a demo of > use of that I'll note the changes here are pretty large and it makes > it terribly difficult for review. Is there any way this patch can be split > up in to logical atomic pieces that only do one task upon change ? I will try to split it a bit, but I cannot promise that much can be done to improve readability for someone not very familiar with the driver internals. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland