From patchwork Mon Jun 24 13:16:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18071 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BE8FA25CFE for ; Mon, 24 Jun 2013 13:16:43 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id ey16sf3407390wid.1 for ; Mon, 24 Jun 2013 06:16:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=3WLRKooGig9fBHtRA6IlLiOCkVIwJaLUKsR+k9X3q44=; b=UPetj9FJNrhflptDk4P11pw2LyM/pa5mOmok52FH2VXMhlYCZwV5ZWiEqs4e63bkvn srDydCFxsl3weoCRuspqJsTsRiBEjF5Uk352TIcWBpIb0xPgkbHzpEw2LzVMcfPabc2n 6QVxuBNgBjpgM7dXgh37BN/r5FYAIdfJ2SO9JWPlz1R9zpUKl4sDmvG4fKZNmBHAvx7n 4ahrfnkc4UVCkNFPZBCEu51a6L3kDiwVgsMHFHex8ug/esOH6Ds1dCPw9k/Ftatp5MAV TOXc6qgr7mLreVLD4s9uGYIaI4SROjCWmsQmgoPxPcn3CDwXbigUTS3aLsZ0P5GCH+DS LJ6Q== X-Received: by 10.180.37.229 with SMTP id b5mr3508910wik.4.1372079802934; Mon, 24 Jun 2013 06:16:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.73.204 with SMTP id n12ls864785wiv.29.gmail; Mon, 24 Jun 2013 06:16:42 -0700 (PDT) X-Received: by 10.194.119.195 with SMTP id kw3mr16637436wjb.64.1372079802405; Mon, 24 Jun 2013 06:16:42 -0700 (PDT) Received: from mail-ve0-x229.google.com (mail-ve0-x229.google.com [2607:f8b0:400c:c01::229]) by mx.google.com with ESMTPS id r4si6097423wjz.78.2013.06.24.06.16.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 06:16:42 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::229 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::229; Received: by mail-ve0-f169.google.com with SMTP id m1so8818148ves.0 for ; Mon, 24 Jun 2013 06:16:41 -0700 (PDT) X-Received: by 10.52.95.113 with SMTP id dj17mr9715718vdb.82.1372079800966; Mon, 24 Jun 2013 06:16:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp27156veb; Mon, 24 Jun 2013 06:16:40 -0700 (PDT) X-Received: by 10.182.213.10 with SMTP id no10mr8032774obc.76.1372079800016; Mon, 24 Jun 2013 06:16:40 -0700 (PDT) Received: from mail-oa0-x235.google.com (mail-oa0-x235.google.com [2607:f8b0:4003:c02::235]) by mx.google.com with ESMTPS id qh3si6681791obc.22.2013.06.24.06.16.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 06:16:39 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4003:c02::235 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:4003:c02::235; Received: by mail-oa0-f53.google.com with SMTP id k14so11686318oag.40 for ; Mon, 24 Jun 2013 06:16:39 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.179.51 with SMTP id dd19mr1704537oec.9.1372079799540; Mon, 24 Jun 2013 06:16:39 -0700 (PDT) Received: by 10.182.96.138 with HTTP; Mon, 24 Jun 2013 06:16:39 -0700 (PDT) In-Reply-To: <11846442.bozySFIXTh@vostro.rjw.lan> References: <1894928.On8nI7rMdZ@vostro.rjw.lan> <11846442.bozySFIXTh@vostro.rjw.lan> Date: Mon, 24 Jun 2013 18:46:39 +0530 Message-ID: Subject: Re: [PATCH 13/13] cpufreq: make sure frequency transitions are serialized From: Viresh Kumar To: "Rafael J. Wysocki" Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, dave.martin@arm.com X-Gm-Message-State: ALoCoQk572xneVm1HVOtwSr2N7iYdpP9Z9vVRfquJS2QYsUzHJ73t8a2nXF5XUxog/xRJSAPU8ph X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::229 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 24 June 2013 18:53, Rafael J. Wysocki wrote: > You can do > > if (WARN(transition_ongoing, "")) > return; > > and below analogously. Ahh.. stupid code.. Check if this fixup is fine (attached too) @@ -293,10 +292,9 @@ void __cpufreq_notify_transition(struct cpufreq_policy *policy, break; case CPUFREQ_POSTCHANGE: - if (!transition_ongoing) { - WARN(1, "No frequency transition in progress\n"); + if (WARN(!transition_ongoing, + "No frequency transition in progress\n")) return; - } transition_ongoing--; diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6624694..6ca7eac 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -267,10 +267,9 @@ void __cpufreq_notify_transition(struct cpufreq_policy *policy, switch (state) { case CPUFREQ_PRECHANGE: - if (transition_ongoing) { - WARN(1, "In middle of another frequency transition\n"); + if (WARN(transition_ongoing, + "In middle of another frequency transition\n")) return; - } transition_ongoing++;