From patchwork Tue Oct 29 13:26:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21267 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 23E5325E1B for ; Tue, 29 Oct 2013 13:26:28 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id j10sf18165421oah.9 for ; Tue, 29 Oct 2013 06:26:27 -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:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=4WWjkN1Xucg4mq+MdiQGqdUWlgZ/9VZBrYAorhQ9Zas=; b=iI1icbMPFqCBe7Wed6hfCg5q4LF71++IodyMCKPb+f9sVU1vwRX/bFIItu9aT5cYZ0 tEL+1iDLL2Zk5daMp91eemYdxdAYv9HGns7wxMZR/TK/6UfljVFQ1l+OV6wAAB60s9CV ajJKhphysrUauYxGE2MnYhoLQ6vJA134S8WcwaEEzHNDA+a73arvfy+rgPX9USdi9VJm ntvO7HccCNfCnqg9MslMEIxFKkSKITh/o7cuydQtyPi/mO685EXO4fKzvjJouZrGGIGV RLOg8x/UGOhhVI5p8uHRJR/JTKDWQ3WaTuVdX1/WsWMmtrv8wrIycNVNdQkrkcL2tdOo m4Hg== X-Gm-Message-State: ALoCoQnrLnIKLNe19/cxXlXPEFm63/BabvdBxvUTjLm27FXv9bFX9s/M1YSfA8bvMcF59lKTHcc+ X-Received: by 10.182.42.161 with SMTP id p1mr9191348obl.29.1383053187695; Tue, 29 Oct 2013 06:26:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.229 with SMTP id l5ls64731qey.11.gmail; Tue, 29 Oct 2013 06:26:27 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr5070598vcb.22.1383053187582; Tue, 29 Oct 2013 06:26:27 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id gw7si6884047veb.114.2013.10.29.06.26.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 06:26:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id jz11so5921176veb.40 for ; Tue, 29 Oct 2013 06:26:27 -0700 (PDT) X-Received: by 10.220.161.74 with SMTP id q10mr73342vcx.61.1383053187464; Tue, 29 Oct 2013 06:26: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 u4csp202549vcz; Tue, 29 Oct 2013 06:26:27 -0700 (PDT) X-Received: by 10.42.128.207 with SMTP id n15mr17045760ics.7.1383053186662; Tue, 29 Oct 2013 06:26:26 -0700 (PDT) Received: from mail-ie0-f179.google.com (mail-ie0-f179.google.com [209.85.223.179]) by mx.google.com with ESMTPS id x1si1361566igr.37.2013.10.29.06.26.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 06:26:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.223.179 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.223.179; Received: by mail-ie0-f179.google.com with SMTP id aq17so13806913iec.38 for ; Tue, 29 Oct 2013 06:26:26 -0700 (PDT) X-Received: by 10.43.103.133 with SMTP id di5mr4744105icc.38.1383053186232; Tue, 29 Oct 2013 06:26:26 -0700 (PDT) Received: from localhost (205.158.164.101.ptr.us.xo.net. [205.158.164.101]) by mx.google.com with ESMTPSA id l7sm2641445igx.2.2013.10.29.06.26.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 29 Oct 2013 06:26:25 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH V2 Resend 1/2] cpufreq: distinguish drivers that do asynchronous notifications Date: Tue, 29 Oct 2013 18:56:06 +0530 Message-Id: <928878b755f369489479f7a105de175ef16e11b8.1383052613.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: 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.128.181 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: , There are few special cases like exynos5440 which doesn't send POSTCHANGE notification from their ->target() routine and call some kind of bottom halves for doing this work, work/tasklet/etc.. From which they finally send POSTCHANGE notification. Its better if we distinguish them from other cpufreq drivers in some way so that core can handle them specially. So this patch introduces another flag: CPUFREQ_ASYNC_NOTIFICATION, which will be set by such drivers. This also changes exynos5440-cpufreq.c and powernow-k8 in order to set this flag. Acked-by: Amit Daniel Kachhap Acked-by: Kukjin Kim Signed-off-by: Viresh Kumar --- drivers/cpufreq/exynos5440-cpufreq.c | 2 +- drivers/cpufreq/powernow-k8.c | 1 + include/linux/cpufreq.h | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 1bf9b06..76bef8b 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c @@ -312,7 +312,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) } static struct cpufreq_driver exynos_driver = { - .flags = CPUFREQ_STICKY, + .flags = CPUFREQ_STICKY | CPUFREQ_ASYNC_NOTIFICATION, .verify = cpufreq_generic_frequency_table_verify, .target_index = exynos_target, .get = exynos_getspeed, diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 62a1ce4..0023c7d 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -1204,6 +1204,7 @@ out: } static struct cpufreq_driver cpufreq_amd64_driver = { + .flags = CPUFREQ_ASYNC_NOTIFICATION, .verify = cpufreq_generic_frequency_table_verify, .target_index = powernowk8_target, .bios_limit = acpi_processor_get_bios_limit, diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 93a8c34..5bd6ab9 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -237,6 +237,13 @@ struct cpufreq_driver { */ #define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3) +/* + * Driver will do POSTCHANGE notifications from outside of their ->target() + * routine and so must set cpufreq_driver->flags with this flag, so that core + * can handle them specially. + */ +#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) + int cpufreq_register_driver(struct cpufreq_driver *driver_data); int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);