From patchwork Fri Dec 28 07:06:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ??? X-Patchwork-Id: 1914401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id D74E93FF0F for ; Fri, 28 Dec 2012 07:09:13 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1ToU1W-0005l3-G0; Fri, 28 Dec 2012 07:06:30 +0000 Received: from mail-vc0-f176.google.com ([209.85.220.176]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1ToU1T-0005kn-Pk for linux-arm-kernel@lists.infradead.org; Fri, 28 Dec 2012 07:06:28 +0000 Received: by mail-vc0-f176.google.com with SMTP id fo13so10430282vcb.21 for ; Thu, 27 Dec 2012 23:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=HlbPER8Xshw3GwuB1g6D0s5gcGmezPlTfZOXaaCYQR0=; b=vnqsS2Tg1l3na0/pN5Dmh9EsmK0zBHhRaEJTxQ17EARRVKqs7fdlYCL/agVajyI5mg SQRe4eBeC+O8YFd9Lb4fYU+go+H9aOtSCpHm774U7m7mIt6tCneqs+uggPeLnYwQLgSy QW87njQhG/3MVTNZu2d4FJL5mzZzXmpo/mFoC/RV1h2LjpJwTRAFlta3ep61IB/UV4pd NwiLni5uFXhQtVDEUM+t5GVyPvFJSLHaIwwBhCCN79nM6GXd1TvIfzAyzTESvBCDFdAm 1ssWy6eQ72g7ul91rzJf3bqytNsMkaERyPz8RnJ6nu7KKcoHDYnt2P6yjCfcoODxrpQK ruQA== MIME-Version: 1.0 Received: by 10.220.141.6 with SMTP id k6mr49613581vcu.24.1356678385434; Thu, 27 Dec 2012 23:06:25 -0800 (PST) Received: by 10.220.2.72 with HTTP; Thu, 27 Dec 2012 23:06:25 -0800 (PST) Date: Fri, 28 Dec 2012 15:06:25 +0800 Message-ID: Subject: [PATCH 1/1] ARM: ux500:mach-ux500/cpuidle.c spinlock dis-matching From: "steve.zhan" To: daniel.lezcano@linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121228_020627_918867_4E0F572A X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. 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 (zhanzhenbo[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.176 listed in list.dnswl.org] -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 Cc: linux-arm X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi Daniel, I think we must unlock the master spinlock even prcmu_gic_decouple function now always return 0. Could you give some infos about this? Thanks. Steve Zhan diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c index b54884bd..b0759ce 100644 --- a/arch/arm/mach-ux500/cpuidle.c +++ b/arch/arm/mach-ux500/cpuidle.c @@ -29,6 +29,7 @@ static inline int ux500_enter_idle(struct cpuidle_device *dev, { int this_cpu = smp_processor_id(); bool recouple = false; + bool locked = false; clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &this_cpu); @@ -39,6 +40,8 @@ static inline int ux500_enter_idle(struct cpuidle_device *dev, if (!spin_trylock(&master_lock)) goto wfi; + locked = true; + /* decouple the gic from the A9 cores */ if (prcmu_gic_decouple()) goto out; @@ -76,7 +79,7 @@ static inline int ux500_enter_idle(struct cpuidle_device *dev, /* When we switch to retention, the prcmu is in charge * of recoupling the gic automatically */ recouple = false; - + locked = false; spin_unlock(&master_lock); } wfi: @@ -86,7 +89,8 @@ out: if (recouple) { prcmu_gic_recouple(); - spin_unlock(&master_lock); + if (locked) + spin_unlock(&master_lock); } clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &this_cpu);