From patchwork Sun Oct 13 00:37:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20994 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F27825E03 for ; Sun, 13 Oct 2013 00:37:34 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf22764901obc.7 for ; Sat, 12 Oct 2013 17:37:33 -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=FeXSYIrKj7GCHV4MLK7pp0S9sBrf2igtS8m32xf4Jao=; b=ijFegUW1opj2o55xVmfCvI58yFANknwogFq4AAyCri9lJ7RT0SBmCHrm14cnpJ14VE uQiXqr9UYYhlQWUwWDshasXq36E5z5rS1K141gLY6vqF0IgDA6J2fYpTAFrMyQTyf41o wziBbBQZUZF/8riJ9U9q3X1gJVTN7UcoFg0i0Cm1Eypu4++vvr7DovyqmHngtRi8VRGq qemZxxhhNQ6SXuPlPJwLKQQj4lMbWbb/K+yWWBtisHGWyj6kkw03IvehoskbkQhkghVP ES0X3p2RHLlAbwtRUo5ygkIBhYSp8G001fh7+SsBogi3id+pYpbW7oK+bE9QGicCA+TY svyw== X-Received: by 10.182.27.36 with SMTP id q4mr9654584obg.7.1381624653507; Sat, 12 Oct 2013 17:37:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.12.20 with SMTP id u20ls1903484qeb.92.gmail; Sat, 12 Oct 2013 17:37:33 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr123900vcb.22.1381624653384; Sat, 12 Oct 2013 17:37:33 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id bl10si19424419vcb.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Oct 2013 17:37:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 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.169; Received: by mail-vc0-f169.google.com with SMTP id ib11so4012088vcb.28 for ; Sat, 12 Oct 2013 17:37:33 -0700 (PDT) X-Gm-Message-State: ALoCoQk308Lr1mJbSdc4uHgDQxqOPdYiO6qVc/sm9ShK73MYANSqfNmToJ5li0rR/I0GkwrymyBg X-Received: by 10.220.69.212 with SMTP id a20mr27889991vcj.10.1381624653240; Sat, 12 Oct 2013 17:37:33 -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 u4csp136419vcz; Sat, 12 Oct 2013 17:37:32 -0700 (PDT) X-Received: by 10.224.22.75 with SMTP id m11mr26496147qab.27.1381624652439; Sat, 12 Oct 2013 17:37:32 -0700 (PDT) Received: from mail-qe0-f43.google.com (mail-qe0-f43.google.com [209.85.128.43]) by mx.google.com with ESMTPS id c10si26831161qer.40.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Oct 2013 17:37:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.43 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.128.43; Received: by mail-qe0-f43.google.com with SMTP id nc12so4399740qeb.30 for ; Sat, 12 Oct 2013 17:37:32 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.224.4.133 with SMTP id 5mr13213688qar.73.1381624652182; Sat, 12 Oct 2013 17:37:32 -0700 (PDT) Received: by 10.49.119.37 with HTTP; Sat, 12 Oct 2013 17:37:32 -0700 (PDT) In-Reply-To: <1402816.XYNGOIhCWR@vostro.rjw.lan> References: <6334c0aed4840857944d1b267871ada4d7014d57.1381541632.git.viresh.kumar@linaro.org> <1922770.iubCDBg3Zg@vostro.rjw.lan> <1402816.XYNGOIhCWR@vostro.rjw.lan> Date: Sun, 13 Oct 2013 06:07:32 +0530 Message-ID: Subject: Re: [PATCH] cpufreq: acpi: Add comment under ACPI_ADR_SPACE_SYSTEM_IO case 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 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.169 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/10/2013, Rafael J. Wysocki wrote: > -> What about this: > > /* > * The core will not set policy->cur, because cpufreq_driver->get is NULL, > * so we need to set it here. However, we have to guess it, because the > * current speed is unknown and not detectable via IO ports. > */ Far better. Attached again. Thanks. >From 055b5d73bef0898d477188372b215cd2ec82fe81 Mon Sep 17 00:00:00 2001 Message-Id: <055b5d73bef0898d477188372b215cd2ec82fe81.1381624602.git.viresh.kumar@linaro.org> From: Viresh Kumar Date: Sat, 12 Oct 2013 07:00:01 +0530 Subject: [PATCH] cpufreq: acpi: Add comment under ACPI_ADR_SPACE_SYSTEM_IO case policy->cur is now set by cpufreq core when cpufreq_driver->get() is defined and so drivers aren't required to set it. When space_id is ACPI_ADR_SPACE_SYSTEM_IO for acpi cpufreq driver it doesn't set ->get to a valid function pointer and so policy->cur is required to be set by driver. This is already followed in acpi-cpufreq driver. This patch adds a comment describing why we need to set policy->cur from driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Viresh Kumar --- drivers/cpufreq/acpi-cpufreq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index a8dac7b..a1717d7 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -837,7 +837,12 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) switch (perf->control_register.space_id) { case ACPI_ADR_SPACE_SYSTEM_IO: - /* Current speed is unknown and not detectable by IO port */ + /* + * The core will not set policy->cur, because + * cpufreq_driver->get is NULL, so we need to set it here. + * However, we have to guess it, because the current speed is + * unknown and not detectable via IO ports. + */ policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); break; case ACPI_ADR_SPACE_FIXED_HARDWARE: -- 1.7.12.rc2.18.g61b472e