From patchwork Thu May 15 18:29:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 30300 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8B68420068 for ; Thu, 15 May 2014 18:30:20 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rq2sf7287820pbb.1 for ; Thu, 15 May 2014 11:30:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=6r904p33lT/3feOgLny/ujzxOt1FrJBc5BfYg98DMv0=; b=i5h9QTpq2JSuNwlSqEuyDeizCqIjKvUc7ayM6uEFBtRNY5cwmJhu/O5q/hW3ZE8TUO 8fYLxt7jcKYC5fVEHXZ5Wxh/dQhnX1gWs13oTB/18+f1Ib/FJ92Q9UnmwuEvJBmufM/W GzIowGvUrJmvcvvSeA0TKNSnPqliiTdwyvSQB5g0FGtlHkyYQdT/kX0oAzhhDgTqmSaO R2NuoVDz8DhsK926acJhu5KZQf5EjYEpFLk4u2d0AGas3w81OTM+emTiH1pTtrbM/xba 5bznapLG5mHQKLhkyVQrCEFAt7iVG+5TIMeyjmHm/6A63tk/7kfmEX1AJf/qRPOL1KP9 3/7w== X-Gm-Message-State: ALoCoQk7G3pLgP0A8kJewZ3+/RtodbIpPH4+JawLS/r9iboUvkquxLEvgPs5salduy6YmybWBblZ X-Received: by 10.66.66.35 with SMTP id c3mr3242603pat.7.1400178619877; Thu, 15 May 2014 11:30:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.133 with SMTP id t5ls347778qgt.43.gmail; Thu, 15 May 2014 11:30:19 -0700 (PDT) X-Received: by 10.52.99.168 with SMTP id er8mr8236687vdb.26.1400178619754; Thu, 15 May 2014 11:30:19 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id ww7si1077616vec.102.2014.05.15.11.30.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 May 2014 11:30:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.175 as permitted sender) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jw12so1802710veb.20 for ; Thu, 15 May 2014 11:30:19 -0700 (PDT) X-Received: by 10.52.137.74 with SMTP id qg10mr1178119vdb.61.1400178619561; Thu, 15 May 2014 11:30:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp344475vcb; Thu, 15 May 2014 11:30:19 -0700 (PDT) X-Received: by 10.66.66.108 with SMTP id e12mr14624881pat.35.1400178618464; Thu, 15 May 2014 11:30:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oq10si6200382pac.48.2014.05.15.11.30.17; Thu, 15 May 2014 11:30:17 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753764AbaEOSaR (ORCPT + 6 others); Thu, 15 May 2014 14:30:17 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:40432 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752826AbaEOSaQ (ORCPT ); Thu, 15 May 2014 14:30:16 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s4FITp0P024291; Thu, 15 May 2014 13:29:51 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4FITphW032221; Thu, 15 May 2014 13:29:51 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Thu, 15 May 2014 13:29:51 -0500 Received: from [158.218.103.31] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4FIToHm031591; Thu, 15 May 2014 13:29:51 -0500 Message-ID: <5375079E.3060305@ti.com> Date: Thu, 15 May 2014 14:29:50 -0400 From: Santosh Shilimkar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Daniel Lezcano , Alex Shi CC: , , , , Roger Quadros Subject: Re: [PATCH] ARM: OMAP4: Fix the boot regression with CPU_IDLE enabled References: <1399991966-14582-1-git-send-email-santosh.shilimkar@ti.com> <5373C78E.7040301@linaro.org> <5373C8E8.6040208@ti.com> <5373CBB9.40506@linaro.org> <5373DD94.8030208@ti.com> <5374F35E.5040900@ti.com> <5374FE61.50901@linaro.org> <5374FF5B.8050702@ti.com> In-Reply-To: <5374FF5B.8050702@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: santosh.shilimkar@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Thursday 15 May 2014 01:54 PM, Santosh Shilimkar wrote: > On Thursday 15 May 2014 01:50 PM, Daniel Lezcano wrote: >> On 05/15/2014 07:03 PM, Santosh Shilimkar wrote: [..] >>>> With above mentioned change, it should work. Other alternatives is OMAP4 driver does >>>> its won registration where it can start the timer. The way it was before the >>>> consolidation. >>>> >>>> Ofcourse if you have better fix, then great. >>>> >>> What is your suggestion. We *must* fix the regression asap. I think >>> $subject patch with an update to bctimer start under CPUIDLE_FLAG_COUPLED >>> seems a good way forward. >>> >>> Do let me know. >> >> Did you see Alex Shi's email [cc'ed] ? Reverting this change makes the panda ES to hang. >> > The hang is definitely due to the bctimer not started. As I said, I assumed it was and > then you corrected saying it is under the flag. > >> I am not convinced the culprit is this code you are trying to revert. >> > fair enough. Thats why I said if you have an alternative fix thats great. > For record, below is updated patch with bctimer started which was missed in earlier version. I haven't tested it though. Alex, Please give a try with your test-case and see if you still see the hang. Am just curious about your issue and hence the request.. Regards, Santosh >From bb3b82cc5645b83bedf1343d03cc956f27f6fc83 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Mon, 12 May 2014 17:37:59 -0400 Subject: [PATCH] ARM: OMAP4: Fix the boot regression with CPU_IDLE enabled On OMAP4 panda board, there have been several bug reports about boot hang and lock-ups with CPU_IDLE enabled. The root cause of the issue is missing interrupts while in idle state. Commit cb7094e8 {cpuidle / omap4 : use CPUIDLE_FLAG_TIMER_STOP flag} moved the broadcast notifiers to common code for right reasons but on OMAP4 which suffers from a nasty ROM code bug with GIC, commit ff999b8a {ARM: OMAP4460: Workaround for ROM bug ..}, we loose interrupts which leads to issues like lock-up, hangs etc. Patch reverts commit cb7094 {cpuidle / omap4 : use CPUIDLE_FLAG_TIMER_STOP flag} and 54769d6 {cpuidle: OMAP4: remove timer broadcast initialization} to avoid the issue. With this change, OMAP4 panda boards, the mentioned issues are getting fixed. We no longer loose interrupts which was the cause of the regression. Cc: Roger Quadros Cc: Kevin Hilman Cc: Tony Lindgren Cc: Daniel Lezcano Reported-tested-by: Roger Quadros Reported-tested-by: Kevin Hilman Tested-by: Tony Lindgren Signed-off-by: Santosh Shilimkar --- arch/arm/mach-omap2/cpuidle44xx.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index 01fc710..2498ab0 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -83,6 +84,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, { struct idle_statedata *cx = state_ptr + index; u32 mpuss_can_lose_context = 0; + int cpu_id = smp_processor_id(); /* * CPU0 has to wait and stay ON until CPU1 is OFF state. @@ -110,6 +112,8 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, mpuss_can_lose_context = (cx->mpu_state == PWRDM_POWER_RET) && (cx->mpu_logic_state == PWRDM_POWER_OFF); + clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id); + /* * Call idle CPU PM enter notifier chain so that * VFP and per CPU interrupt context is saved. @@ -165,6 +169,8 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, if (dev->cpu == 0 && mpuss_can_lose_context) cpu_cluster_pm_exit(); + clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id); + fail: cpuidle_coupled_parallel_barrier(dev, &abort_barrier); cpu_done[dev->cpu] = false; @@ -172,6 +178,16 @@ fail: return index; } +/* + * For each cpu, setup the broadcast timer because local timers + * stops for the states above C1. + */ +static void omap_setup_broadcast_timer(void *arg) +{ + int cpu = smp_processor_id(); + clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu); +} + static struct cpuidle_driver omap4_idle_driver = { .name = "omap4_idle", .owner = THIS_MODULE, @@ -189,8 +205,7 @@ static struct cpuidle_driver omap4_idle_driver = { /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ .exit_latency = 328 + 440, .target_residency = 960, - .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED | - CPUIDLE_FLAG_TIMER_STOP, + .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, .enter = omap_enter_idle_coupled, .name = "C2", .desc = "CPUx OFF, MPUSS CSWR", @@ -199,8 +214,7 @@ static struct cpuidle_driver omap4_idle_driver = { /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */ .exit_latency = 460 + 518, .target_residency = 1100, - .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED | - CPUIDLE_FLAG_TIMER_STOP, + .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, .enter = omap_enter_idle_coupled, .name = "C3", .desc = "CPUx OFF, MPUSS OSWR", @@ -231,5 +245,8 @@ int __init omap4_idle_init(void) if (!cpu_clkdm[0] || !cpu_clkdm[1]) return -ENODEV; + /* Configure the broadcast timer on each cpu */ + on_each_cpu(omap_setup_broadcast_timer, NULL, 1); + return cpuidle_register(&omap4_idle_driver, cpu_online_mask); }