Re: clk_disable_unused() is bugged

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Tero (and anyone else),

On Wed, 24 Sep 2008, Tero.Kristo@xxxxxxxxx wrote:

> clk_disable_unused (in plat-omap/clock.c) is bugged in latest kernel. It
> checks whether ck->enable_reg is zero, and in most cases this happens to
> be so (CM_FCLKEN = 0.) Seems to be caused by some late change to
> clocktree where enable_reg fields are defined as module offsets, not
> register addresses. This bug causes several clocks to remain enabled
> after boot, and at least on OMAP3 it prevents retention.
> 
> Paul, you got a fix coming for this?

Yes, here's something that should at least fix the clk_disable_unused() 
problem.  It seems to work on 2430SDP and 3430SDP here.  

Any other help testing from anyone else is appreciated -


- Paul


Author: Paul Walmsley <paul@xxxxxxxxx>
Date:   Wed Sep 24 04:48:05 2008 -0600

    OMAP2/3 clock: fix CONFIG_OMAP_RESET_CLOCKS
    
    plat-omap/clock.c was skipping clocks with enable_reg == 0.  This no longer
    works now that we use enable_reg as an offset from a PRCM module.
    
    Problem found and traced by Tero Kristo <tero.kristo@xxxxxxxxx> -
    thanks Tero.
    
    Signed-off-by: Paul Walmsley <paul@xxxxxxxxx>

diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 197974d..7bbfba2 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -384,8 +384,11 @@ static int __init clk_disable_unused(void)
 	unsigned long flags;
 
 	list_for_each_entry(ck, &clocks, node) {
-		if (ck->usecount > 0 || (ck->flags & ALWAYS_ENABLED) ||
-			ck->enable_reg == 0)
+		if (ck->usecount > 0 ||
+		    (ck->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK)))
+			continue;
+
+		if (cpu_class_is_omap1() && ck->enable_reg == 0)
 			continue;
 
 		spin_lock_irqsave(&clockfw_lock, flags);
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux