From patchwork Sat Oct 12 15:28:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20991 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C44F725E03 for ; Sat, 12 Oct 2013 15:28:13 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id vb8sf21630150obc.10 for ; Sat, 12 Oct 2013 08:28:13 -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=jKAnSmZL10iBJjqpVuOAYVzZTt+ggQ24a6wNwoqqb78=; b=WrQwXjADcZnxu2uzJgYvH/Bhc2qm/lfrIeuBokbx4kYTgROMQ6DZs6ofkxM/st4Wg0 5QFl299MDE8LLn/nOqBCaziThv3KlJHTwmafXMUl8CT6LLyNE/ZnoVF8UAVMeHGqaWHh Bq2We26ashG7sVrAE6eLYAWJdVVK2TwaWyupDWxiXlKUAFeexQfIwDupMn6Jg69qvh+Y VWejQ+xVCm/IKFrsVQByADcwpIlEm4XRdD1mZ/GPIfPgverHHf6sYKrlDnmJqju4MhpJ Pm8zNIHO8liGTJDrKdCRwRfe58eIhk/TC+ss+/VlQnIBfWNGU+83GycEWbwB8Cv/MlqE lR+A== X-Received: by 10.50.109.193 with SMTP id hu1mr3859700igb.6.1381591692944; Sat, 12 Oct 2013 08:28:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.177 with SMTP id gf17ls1720787qeb.4.gmail; Sat, 12 Oct 2013 08:28:12 -0700 (PDT) X-Received: by 10.52.118.73 with SMTP id kk9mr21686742vdb.13.1381591692805; Sat, 12 Oct 2013 08:28:12 -0700 (PDT) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id f20si18847647vcs.67.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Oct 2013 08:28:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id w16so3555274vbb.8 for ; Sat, 12 Oct 2013 08:28:12 -0700 (PDT) X-Gm-Message-State: ALoCoQnSlRH9cRU5Z4Ge8TfNQUFaKtjiB3sPHxoHm2b2Q6DXJmagBxwQEqDE/rv7DYnXvfDZpNvl X-Received: by 10.52.165.131 with SMTP id yy3mr21898705vdb.25.1381591692664; Sat, 12 Oct 2013 08:28:12 -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 u4csp117128vcz; Sat, 12 Oct 2013 08:28:12 -0700 (PDT) X-Received: by 10.224.167.16 with SMTP id o16mr10801908qay.58.1381591691880; Sat, 12 Oct 2013 08:28:11 -0700 (PDT) Received: from mail-qe0-f44.google.com (mail-qe0-f44.google.com [209.85.128.44]) by mx.google.com with ESMTPS id e3si26112573qew.65.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Oct 2013 08:28:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.128.44; Received: by mail-qe0-f44.google.com with SMTP id 6so4183051qeb.3 for ; Sat, 12 Oct 2013 08:28:11 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.49.116.210 with SMTP id jy18mr15051410qeb.65.1381591690989; Sat, 12 Oct 2013 08:28:10 -0700 (PDT) Received: by 10.49.119.37 with HTTP; Sat, 12 Oct 2013 08:28:10 -0700 (PDT) In-Reply-To: <1922770.iubCDBg3Zg@vostro.rjw.lan> References: <6334c0aed4840857944d1b267871ada4d7014d57.1381541632.git.viresh.kumar@linaro.org> <1922770.iubCDBg3Zg@vostro.rjw.lan> Date: Sat, 12 Oct 2013 20:58:10 +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.212.49 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 12/10/2013, Rafael J. Wysocki wrote: > Well, please merge it with the existing comment and use the usual format > for comments that are longer than two lines. I thought these are separate comments and so keeping them separate might be better, so that this one doesn't get deleted in case somebody is removing the other one.. and vice versa.. Anyway its fixed in attached commit now :) commit ecb9ef81b50eb5e8559f7d132ef46803c8272091 Author: Viresh Kumar Date: Sat Oct 12 07:00:01 2013 +0530 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(-) case ACPI_ADR_SPACE_FIXED_HARDWARE: >From ecb9ef81b50eb5e8559f7d132ef46803c8272091 Mon Sep 17 00:00:00 2001 Message-Id: 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..d2df543 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 */ + /* + * Current speed is unknown and not detectable by IO port. + * policy->cur wouldn't be set by core as cpufreq_driver->get() + * is NULL for this space_id and so we need to set policy->cur + * here. + */ policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); break; case ACPI_ADR_SPACE_FIXED_HARDWARE: -- 1.7.12.rc2.18.g61b472e