From patchwork Thu Oct 30 01:10:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 5192741 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72164C11AC for ; Thu, 30 Oct 2014 01:11:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C06F020219 for ; Thu, 30 Oct 2014 01:11:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00A05201DD for ; Thu, 30 Oct 2014 01:11:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjeGz-0007uy-6g; Thu, 30 Oct 2014 01:11:33 +0000 Received: from regular1.263xmail.com ([211.150.99.132]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjeGn-0007tX-Rh; Thu, 30 Oct 2014 01:11:25 +0000 Received: from kever.yang?rock-chips.com (unknown [192.168.167.140]) by regular1.263xmail.com (Postfix) with SMTP id 0FE687BA4; Thu, 30 Oct 2014 09:10:52 +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.9.187] (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id BF03C45F; Thu, 30 Oct 2014 09:10:48 +0800 (CST) X-RL-SENDER: kever.yang@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 127.0.0.1 X-LOGIN-NAME: kever.yang@rock-chips.com X-UNIQUE-TAG: <8922f360dd118fa64c48e0ed59b35373> X-ATTACHMENT-NUM: 0 X-SENDER: yk@rock-chips.com X-DNS-TYPE: 0 Received: from [172.16.9.187] (unknown [127.0.0.1]) by smtp.263.net (Postfix) whith ESMTP id 16006M7FLXC; Thu, 30 Oct 2014 09:10:50 +0800 (CST) Message-ID: <54519019.6010903@rock-chips.com> Date: Thu, 30 Oct 2014 09:10:49 +0800 From: Kever Yang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: =?UTF-8?B?SGVpa28gU3TDvGJuZXI=?= , Doug Anderson Subject: Re: [PATCH] clk: rockchip: disable unused clocks References: <1414577167-25666-1-git-send-email-kever.yang@rock-chips.com> <13348555.zj6gsMcCpK@diego> In-Reply-To: <13348555.zj6gsMcCpK@diego> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141029_181122_325162_F4E974FE X-CRM114-Status: GOOD ( 12.65 ) X-Spam-Score: -0.0 (/) Cc: Tao Huang , =?UTF-8?B?IuaItOWFi+mcliAoSmFjayki?= , Addy Ke , Mike Turquette , "linux-kernel@vger.kernel.org" , "open list:ARM/Rockchip SoC..." , Jianqun Xu , Eddie Cai , han jiang , Sonny Rao , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi On 10/30/2014 05:53 AM, Heiko Stübner wrote: > Am Mittwoch, 29. Oktober 2014, 13:50:20 schrieb Doug Anderson: >> Kever, >> >> On Wed, Oct 29, 2014 at 3:06 AM, Kever Yang > wrote: >>> The rockchip clock driver use CLK_IGNORE_UNUSED flag to make sure >>> all the clocks are available like default power on state. >>> We have implement the clock manage in most of rockchip drivers, >>> it is time to remove it for power save. >>> Instead we add CLK_IGNORE_UNUSED for some clock nodes which should >>> be on during boot or no module driver in kernel will initialize it. >>> >>> Signed-off-by: Kever Yang >>> --- >>> >>> drivers/clk/rockchip/clk-rk3188.c | 32 ++++----- >>> drivers/clk/rockchip/clk-rk3288.c | 146 >>> +++++++++++++++++++------------------- drivers/clk/rockchip/clk.c >>> | 9 --- >>> 3 files changed, 90 insertions(+), 97 deletions(-) >> Your patch didn't seem to apply to the top of Heiko's >> "v3.19-clk/next". Where should it apply to? I apply the patch on the top of linux-next, I will apply it on Heiko's "v3.19-clk/next" next version. >> >>> - GATE(ACLK_CPU, "aclk_cpu", "aclk_cpu_pre", 0, >>> + GATE(0, "aclk_cpu", "aclk_cpu_pre", CLK_IGNORE_UNUSED, >>> >>> RK3288_CLKGATE_CON(0), 3, GFLAGS), >> It seems strange to me that you're removing the ACLK_CPU ID here. Was >> that on purpose? Sorry for that, I didn't mean to removing any ID here, will fix in next version. >> >>> - COMPOSITE_NOMUX(PCLK_CPU, "pclk_cpu", "aclk_cpu_pre", 0, >>> + COMPOSITE_NOMUX(0, "pclk_cpu", "aclk_cpu_pre", CLK_IGNORE_UNUSED, >>> >>> RK3288_CLKSEL_CON(1), 12, 3, DFLAGS, >>> RK3288_CLKGATE_CON(0), 5, GFLAGS), >> Here too for PCLK_CPU. There are a few others as well. > yeah, they should keep their clock ids > > >> I'll also say that when I applied this atop my local tree that USB >> stopped working. I just see: >> >> [ 1647.626747] hub 2-1:1.0: hub_port_status failed (err = -110) >> [ 1657.626746] hub 2-1:1.0: hub_port_status failed (err = -110) >> >> ...over and over and over again. > maybe Kever's dwc2 clock-handling patch [0] might help there, as the dwc2-host > currently does not seem to do any clock handling at all. I think Heiko is right, I test in my evb with following change and dwc2 works well: RK3288_CLKGATE_CON(7), 4, GFLAGS), + GATE(HCLK_USBHOST0, "hclk_host0", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 6, GFLAGS), GATE(HCLK_USBHOST1, "hclk_host1", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 7, GFLAGS), GATE(HCLK_HSIC, "hclk_hsic", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 8, GFLAGS), GATE(0, "hclk_usb_peri", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 9, GFLAGS), - Kever --- a/drivers/clk/rockchip/clk-rk3288.c +++ b/drivers/clk/rockchip/clk-rk3288.c @@ -654,8 +654,8 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { /* hclk_peri gates */ GATE(0, "hclk_peri_matrix", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(6), 0, GFLAGS), - GATE(HCLK_OTG0, "hclk_otg0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 4, GFLAGS), - GATE(HCLK_USBHOST0, "hclk_host0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 6, GFLAGS), + GATE(HCLK_OTG0, "hclk_otg0", "hclk_peri", CLK_IGNORE_UNUSED,