Received: by 10.223.185.116 with SMTP id b49csp527293wrg; Fri, 23 Feb 2018 02:38:25 -0800 (PST) X-Google-Smtp-Source: AH8x2277pwTLGAgaHgfdqX83KvTDDdKYNiGT7FKkJblb4ySRRyFBV3qivWYyCr37xI4jVlaX/6k7 X-Received: by 10.99.168.8 with SMTP id o8mr1122885pgf.42.1519382305434; Fri, 23 Feb 2018 02:38:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519382305; cv=none; d=google.com; s=arc-20160816; b=cu7coF1MNIgHh+xT96wlmjUO3+7IB8TNQW/JJ065koWcg0UUI/i0A30vsUKMNCWkLP 4L3Z5JiVuVyYtPLi7/qvyEhKx16ESYcq2KMWR4dDUETKDRRusBiyO6ypkxux9dJgiMAq xFI0fdJtiV7rT5B3tfWMaQSWXjstOilYuMWuK/0f1GMwfmgyENnO9HNuXl9nSB7nuAsm cYx1Xb5JeXvhhvW8vi8F/lq5Y1P4RYKVqmb3gxLYGHlcZKgc0LDdXirZO2kItv1WzGKk 0yH4h5mR6RLn2umhNRZd4+q/N6z78vXSqrNZcTrM/akVGRK00TDe5Lhp5qrLPVqlc0/c 56DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=5LHbv/EL0Odn3DvCLBdxliUx4k5Ri8PrrijgUQhdcNA=; b=cPcQ85ILql49h4EU0n5zFyq82eNjEC3mOSHDGX+7kEaYx4T+IjZhyxgYGvLUhU/Gpw NsVunP9INHBszOcvnKx53ioK5fk2WTnKiyiuvbPWb8iRoMSqjaUxghaEwY1gOqtufyOV fTLm7r2ocJ9lRrZSN3y+mxIFOjqzc2NK+iZ1y65/7VsfammHmC6bsQh6Mi7YBEoQRgVr 3lAmyCHBJhwsMmpVIjBH4+my8x0XHMQOhij58ZPR1icd4GJV0UpMeM9Os264v0V6JQD+ PTehrX8iWua+psmdzrbStCHnXEZd/NXn92xQ6JtP87GEh76GocJEhLq2xnkv1J3t3wAH 4PwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si1589318plc.309.2018.02.23.02.38.11; Fri, 23 Feb 2018 02:38:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbeBWKhF (ORCPT + 99 others); Fri, 23 Feb 2018 05:37:05 -0500 Received: from regular1.263xmail.com ([211.150.99.137]:48419 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbeBWKhD (ORCPT ); Fri, 23 Feb 2018 05:37:03 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.152]) by regular1.263xmail.com (Postfix) with ESMTP id 142CBDB63; Fri, 23 Feb 2018 18:36:59 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from [172.16.22.58] (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 785A4381; Fri, 23 Feb 2018 18:36:49 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: randy.li@rock-chips.com X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from [172.16.22.58] (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 7362HRMCRQ; Fri, 23 Feb 2018 18:36:59 +0800 (CST) Message-ID: <5A8FEEC1.5040303@rock-chips.com> Date: Fri, 23 Feb 2018 18:36:49 +0800 From: JeffyChen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Randy Li , tfiga@chromium.org CC: Robin Murphy , linux-kernel@vger.kernel.org, Mark Rutland , devicetree@vger.kernel.org, xxm@rock-chips.com, Joerg Roedel , jcliang@chromium.org, linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, Rob Herring , linux-arm-kernel@lists.infradead.org, Heiko Stuebner Subject: Re: [PATCH v4 08/13] iommu/rockchip: Control clocks needed to access the IOMMU References: <20180118115251.5542-1-jeffy.chen@rock-chips.com> <20180118115251.5542-9-jeffy.chen@rock-chips.com> <5A60AE41.2050101@rock-chips.com> <1f4b3c0d-1414-0012-a072-f4a11f432c21@rock-chips.com> <5A654925.9020203@rock-chips.com> <5A6563FA.8080602@rock-chips.com> <5A69B065.30501@rock-chips.com> In-Reply-To: <5A69B065.30501@rock-chips.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi guys, On 01/25/2018 06:24 PM, JeffyChen wrote: > On 01/25/2018 05:42 PM, Randy Li wrote: >>>> >>> >>> confirmed with Simon, there might be some iommus don't have a pd, and >> We use the pd to control the NIU node(not on upstream), without a pd or >> fake pd, none of the platform would work. > after talked offline, it's possible to have iommu without pd in upstream > kernel(and chromeos kernel), but on our internal kernel, the drivers > would require pd(or fake pd) to reset modules when error happens. > > anyway, i think that means we do need clock control here. found another reason to not depend on pd to control clocks. currently we are using pd's pm_clk to keep clocks enabled during power on. but in our pd binding doc, that is not needed: - clocks (optional): phandles to clocks which need to be enabled while power domain switches state. confirmed with Caesar, the pm_clk only required for some old chips(rk3288 for example) due to hardware issue. and i tested my chromebook kevin(rk3399), it works well after remove the pm_clk: +++ b/drivers/soc/rockchip/pm_domains.c @@ -478,7 +478,6 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, pd->genpd.power_on = rockchip_pd_power_on; pd->genpd.attach_dev = rockchip_pd_attach_dev; pd->genpd.detach_dev = rockchip_pd_detach_dev; - pd->genpd.flags = GENPD_FLAG_PM_CLK; will do more tests and send patch tomorrow. > >>> the CONFIG_PM could be disabled.I am hard to believe a modern platform >>> can work without that. >>> >>> so it might be better to control clocks in iommu driver itself. >> I won't >> insist how the version of the iommu patch on the upstream, I >> just post an idea here. >> The version for kernel 4.4 is under internal review, the implementation >> has been modified many times. >> >> I would suggest the managing clocks in pd is a more easy way and don't >> need to spare those thing in two places.