From patchwork Fri Mar 13 17:43:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 45805 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9CD35214CB for ; Fri, 13 Mar 2015 17:44:07 +0000 (UTC) Received: by wivr20 with SMTP id r20sf4938416wiv.0 for ; Fri, 13 Mar 2015 10:44:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=XFaBCekiX8ESDobZNDXePy5vh8Upj4TWGlDuVCGKmw4=; b=e0jtX3BIzzKo9myQ8R5hZ2PDLClYSzalxcSk6q3w0B2FJjvcHn/bXUcNAsdm/Z9i74 Fls5SioOQY++W96XI3e2r2A/xANyCMeSQEZMRfghysjj1JoSJO/wLLQ2lYrylmweyLOn oiWTFs5YKzJ5Do51lscoG3RNDRxRj84fy3LVMjRMFJZtwSF8U38LhO6kh6Bnnlyk68c2 +bswSSTKd/Q+6xtjvmB2XjXvccpWG6P6lNWY9LKEPM322XLuDxJJUbhO4zS/HggH9ILH 8UoTXxgR4FXXmkTxPw1SGq+ZuEq90xiyRFEFC8V32bXQu8z8cjGQwI0k68vYKDTsHeBb 7vnA== X-Gm-Message-State: ALoCoQmPaNi/u0LAtg7L0krscbI57PRcpzt9tdXDOXJMRBcrfUpzQ2SXJ1hpLpObnt8PdgL0D2AY X-Received: by 10.112.125.67 with SMTP id mo3mr5761952lbb.6.1426268645826; Fri, 13 Mar 2015 10:44:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.131 with SMTP id k3ls445237lak.21.gmail; Fri, 13 Mar 2015 10:44:05 -0700 (PDT) X-Received: by 10.152.43.51 with SMTP id t19mr43705886lal.73.1426268645651; Fri, 13 Mar 2015 10:44:05 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id s4si1858980lag.140.2015.03.13.10.44.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 10:44:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labge10 with SMTP id ge10so24135359lab.7 for ; Fri, 13 Mar 2015 10:44:05 -0700 (PDT) X-Received: by 10.112.130.39 with SMTP id ob7mr45691476lbb.32.1426268645353; Fri, 13 Mar 2015 10:44:05 -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.112.35.133 with SMTP id h5csp1071225lbj; Fri, 13 Mar 2015 10:44:04 -0700 (PDT) X-Received: by 10.66.231.204 with SMTP id ti12mr22932276pac.135.1426268643429; Fri, 13 Mar 2015 10:44:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id db3si5307492pad.9.2015.03.13.10.44.01; Fri, 13 Mar 2015 10:44:03 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S932230AbbCMRn5 (ORCPT + 28 others); Fri, 13 Mar 2015 13:43:57 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:35071 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753338AbbCMRny (ORCPT ); Fri, 13 Mar 2015 13:43:54 -0400 Received: by wesw55 with SMTP id w55so24877907wes.2 for ; Fri, 13 Mar 2015 10:43:53 -0700 (PDT) X-Received: by 10.194.83.66 with SMTP id o2mr101330083wjy.55.1426268633699; Fri, 13 Mar 2015 10:43:53 -0700 (PDT) Received: from mai.lan (135-224-190-109.dsl.ovh.fr. [109.190.224.135]) by mx.google.com with ESMTPSA id xy2sm3750963wjc.14.2015.03.13.10.43.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Mar 2015 10:43:52 -0700 (PDT) From: Daniel Lezcano To: rjw@rjwysocki.net Cc: mxs@sbrk.org, gregory.clement@free-electrons.com, linux-kernel@vger.kernel.org, linux-pm@lists.linux-foundation.org Subject: [PATCH 1/2] cpuidle: mvebu: Fix the CPU PM notifier usage Date: Fri, 13 Mar 2015 18:43:51 +0100 Message-Id: <1426268632-12800-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <55032186.3000306@linaro.org> References: <55032186.3000306@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 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: , From: Gregory CLEMENT As stated in kernel/cpu_pm.c, "Platform is responsible for ensuring that cpu_pm_enter is not called twice on the same CPU before cpu_pm_exit is called.". In the current code in case of failure when calling mvebu_v7_cpu_suspend, the function cpu_pm_exit() is never called whereas cpu_pm_enter() was called just before. This patch moves the cpu_pm_exit() in order to balance the cpu_pm_enter() calls. Cc: stable@vger.kernel.org Reported-by: Fulvio Benini Signed-off-by: Gregory CLEMENT Signed-off-by: Daniel Lezcano --- drivers/cpuidle/cpuidle-mvebu-v7.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c index 38e6861..cefa074 100644 --- a/drivers/cpuidle/cpuidle-mvebu-v7.c +++ b/drivers/cpuidle/cpuidle-mvebu-v7.c @@ -37,11 +37,11 @@ static int mvebu_v7_enter_idle(struct cpuidle_device *dev, deepidle = true; ret = mvebu_v7_cpu_suspend(deepidle); + cpu_pm_exit(); + if (ret) return ret; - cpu_pm_exit(); - return index; }