From patchwork Thu Jan 19 03:57:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 136756 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 03C00B6EEA for ; Thu, 19 Jan 2012 15:00:00 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Rnj8J-0003FX-Bs; Thu, 19 Jan 2012 03:57:51 +0000 Received: from mail-ee0-f49.google.com ([74.125.83.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Rnj8F-0003F8-Ln for linux-arm-kernel@lists.infradead.org; Thu, 19 Jan 2012 03:57:48 +0000 Received: by eekb15 with SMTP id b15so1505154eek.36 for ; Wed, 18 Jan 2012 19:57:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=fQ2G8k68rEA6XfLzGt3BzKBi2N8ohrMa6/FNb+vUJm8=; b=uPB0M5ebaMyI9PeNF1wXSD2k+/KLT21zhXdMdBMXYF4oF/gV4wp0ePzDVdjKoRb+0D ettk7iy3lCt3EDvVu3YNbSJ/lrDEp/ExJa2OuBm8iqYVxy++x5bpeiVujz3aVt1tlJVJ 3ShbtehIqnwLzE9Sv43iv3rHzjrVU2ffgVaXU= MIME-Version: 1.0 Received: by 10.14.99.71 with SMTP id w47mr1085586eef.78.1326945465914; Wed, 18 Jan 2012 19:57:45 -0800 (PST) Received: by 10.213.7.9 with HTTP; Wed, 18 Jan 2012 19:57:45 -0800 (PST) In-Reply-To: <20120119031726.GA2247@S2101-09.ap.freescale.net> References: <1326820526-26498-1-git-send-email-fabio.estevam@freescale.com> <20246.30805.391940.766120@ipc1.ka-ro> <20120119031726.GA2247@S2101-09.ap.freescale.net> Date: Thu, 19 Jan 2012 01:57:45 -0200 Message-ID: Subject: Re: [PATCH] ARM: mx28: Clear CLKGATE bit prior to changing DIV field From: Fabio Estevam To: Shawn Guo X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.49 listed in list.dnswl.org] Cc: Fabio Estevam , w.sang@pengutronix.de, marek.vasut@gmail.com, shawn.guo@freescale.com, kernel@pengutronix.de, Dong Aisheng , linux-arm-kernel@lists.infradead.org, =?UTF-8?Q?Lothar_Wa=C3=9Fmann?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org 2012/1/19 Shawn Guo : > My proposal is we need to clk_prepare_enable before clk_set_rate a clock > if the clock is gated, and then clk_disable_unprepare the clock after > clk_set_rate is done.  This applies whatever codes that want to > clk_set_rate a mxs clock. So something like: didn't work on my tests (probe of mxs-saif fails with the same timeout message). However if I use the clk_disable versions: + clk_disable(&saif0_clk); + clk_disable(&saif1_clk); Then it works fine. Regards, Fabio Estevam --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -809,6 +809,8 @@ int __init mx28_clocks_init(void) clk_prepare_enable(&xbus_clk); clk_prepare_enable(&emi_clk); clk_prepare_enable(&uart_clk); + clk_prepare_enable(&saif0_clk); + clk_prepare_enable(&saif1_clk); clk_set_parent(&lcdif_clk, &ref_pix_clk); clk_set_parent(&saif0_clk, &pll0_clk); @@ -822,6 +824,8 @@ int __init mx28_clocks_init(void) */ clk_set_rate(&saif0_clk, 24000000); clk_set_rate(&saif1_clk, 24000000); + clk_disable_unprepare(&saif0_clk); + clk_disable_unprepare(&saif1_clk); clkdev_add_table(lookups, ARRAY_SIZE(lookups)); ---