From patchwork Fri Sep 13 16:03:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20288 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 39F3320F2F for ; Fri, 13 Sep 2013 16:03:28 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id r5sf1475669qcx.0 for ; Fri, 13 Sep 2013 09:03:28 -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:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=Vg/2Tdj/yd9ik5H02AZ5UyypTX0CQdkq8gb1VuhQ+X0=; b=VIlyqGx4/JTvfHmv4XKKTjRNh1MxQo22XVI2Yq2RjcNV8jGL4MluNL8qoeNXG7gCnJ VYfBJXtdj3gv11nwT5zWXoYu1U4OYZpRLPZ4LynzgICrs1vSpkovESZKTm7IReM2ExnA fSJf5uKiVI+iKkJi5+0ABh2z4tBjv30vrpnCdEkHGEF0cStBrcETyovh84o7rRVNwf26 S+z5zSKmFyWHE2xGcO4naaA4S3kqNxAA3HgruqLsA3rXH4qlOz4ZEB0LqJgKP0a5nNPw qUV/3mggzvUUQAKRc+GjnLTdsxDq8oskReZblqBtOr/K7et6Kl4ZoT4JIxSQ09Mta/x/ TcfQ== X-Gm-Message-State: ALoCoQlf5RDFDCVhX4jjqhQeDh+b4zUqkLLY9N5ediCG6BzFr62Lvt9AD6wpX6sMuC6Fes8KXALA X-Received: by 10.236.93.45 with SMTP id k33mr5465659yhf.19.1379088208040; Fri, 13 Sep 2013 09:03:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.9 with SMTP id kq9ls1224495qeb.48.gmail; Fri, 13 Sep 2013 09:03:27 -0700 (PDT) X-Received: by 10.58.118.130 with SMTP id km2mr12550810veb.0.1379088207818; Fri, 13 Sep 2013 09:03:27 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id wp10si3345821vdb.19.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 09:03:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ht10so1071125vcb.24 for ; Fri, 13 Sep 2013 09:03:27 -0700 (PDT) X-Received: by 10.52.122.68 with SMTP id lq4mr10669346vdb.21.1379088207674; Fri, 13 Sep 2013 09:03:27 -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.220.174.196 with SMTP id u4csp88272vcz; Fri, 13 Sep 2013 09:03:26 -0700 (PDT) X-Received: by 10.182.237.75 with SMTP id va11mr13010299obc.5.1379088206668; Fri, 13 Sep 2013 09:03:26 -0700 (PDT) Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by mx.google.com with ESMTPS id g7si6900043oez.25.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 09:03:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.177 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.214.177; Received: by mail-ob0-f177.google.com with SMTP id wp18so1247105obc.22 for ; Fri, 13 Sep 2013 09:03:26 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.227.136 with SMTP id sa8mr12881091obc.39.1379088206306; Fri, 13 Sep 2013 09:03:26 -0700 (PDT) Received: by 10.182.28.168 with HTTP; Fri, 13 Sep 2013 09:03:26 -0700 (PDT) In-Reply-To: <20130913155313.GA12758@n2100.arm.linux.org.uk> References: <20130913155313.GA12758@n2100.arm.linux.org.uk> Date: Fri, 13 Sep 2013 21:33:26 +0530 Message-ID: Subject: Re: [PATCH 181/228] cpufreq: move freq change notifications to cpufreq core From: Viresh Kumar To: Russell King - ARM Linux Cc: "Rafael J. Wysocki" , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Patch Tracking , Linux Kernel Mailing List , "cpufreq@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 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 13 September 2013 21:23, Russell King - ARM Linux wrote: > On Fri, Sep 13, 2013 at 06:32:07PM +0530, Viresh Kumar wrote: >> + read_lock_irqsave(&cpufreq_driver_lock, flags); >> + notify = !(cpufreq_driver->flags & CPUFREQ_ASYNC_NOTIFICATION); >> + read_unlock_irqrestore(&cpufreq_driver_lock, flags); > > I don't think this needs to be read under a lock - if this bit changes > dynamically, then there's something very wrong. No it doesn't change dynamically.. Was a mistake.. Following change folded into the original commit (attached) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 2c1ae708..bb7402d 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1802,7 +1802,6 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, else if (cpufreq_driver->target_index) { struct cpufreq_frequency_table *freq_table; struct cpufreq_freqs freqs; - unsigned long flags; bool notify; int index; @@ -1824,9 +1823,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, goto out; } - read_lock_irqsave(&cpufreq_driver_lock, flags); notify = !(cpufreq_driver->flags & CPUFREQ_ASYNC_NOTIFICATION); - read_unlock_irqrestore(&cpufreq_driver_lock, flags); if (notify) { freqs.old = policy->cur;