Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2869036imm; Mon, 16 Jul 2018 16:04:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpejTBKwta3k1wGHR8Jwikm1+eY2u7+fLGbogkLxJXTnXOY6yuvsA4VfyRQ6ZeCUprFWl038 X-Received: by 2002:a62:1f8c:: with SMTP id l12-v6mr20123437pfj.143.1531782244122; Mon, 16 Jul 2018 16:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531782244; cv=none; d=google.com; s=arc-20160816; b=bQLZr+0VlIV/cnDt7RalyUSH9GTzeVnzVeSMkxeYr23wRWa4MenwK5bDB3eLGm8d74 2xU6Q54wMGm6xmrTDeYdGNkB8jtSPJVk+/spPKUbEDRlzgutWlu9zUeYyWu+gH30OlSB AjeZ4lPt96B7SJ6rwSNAk3mTEap5F2Pp7SLw3kTyGH7xpkSo5nX+lAGeLSMnZKyWgWtq nW/atssKmaxZTQfv3AgEAgMJb4rFYz8cW7Y+5j/I+Oi1OeRMgJiAPlXd2jaBzIFoaFvk UHMMfvV3sHeVRKY0bRV92BVu20kiVCI60t4AEGMbaq/LyUVeGzlWGEqypSEV4SLq4itV u1GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=+wOpV4fqMfulJL94yGwph5KH7V/fTx9ABJUvCl4zr4w=; b=htSYB/0XferyFP6/Vw3V7gelpmU7jS3J9GjDs9p0Qh7r274ky0KbfUIto1s07x+tzH QBQ6HbNW9wFAK0rYvus0u4yMOCZ8HLsSOYGX70CqhP7IeFKcnEk97FKkgqI0H67SP4Hp FhUxgTtOzVjUPIohM5W8OHT7IlbX+Uyr9ez4tOVSCxJc4VeI0hDMsvQBdC8vhXxKE4wt 2IIm+RAyn3zcjutXVybSPvuQxp6jtIoyvJ+9mqCfylk2yQF3PEdQA5+hBT06N1XiWHcM T+tJYpe7114fDvcRH2LOh05eyN1nS+6k3adZ6Y34foNkDw97KIhdqTVzXj3RprgzRl3H moaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=liGrlXNO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14-v6si5877460pfa.44.2018.07.16.16.03.48; Mon, 16 Jul 2018 16:04:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=liGrlXNO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729825AbeGPXcq (ORCPT + 99 others); Mon, 16 Jul 2018 19:32:46 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:45953 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729613AbeGPXcq (ORCPT ); Mon, 16 Jul 2018 19:32:46 -0400 Received: by mail-lj1-f193.google.com with SMTP id q5-v6so31357191ljh.12 for ; Mon, 16 Jul 2018 16:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+wOpV4fqMfulJL94yGwph5KH7V/fTx9ABJUvCl4zr4w=; b=liGrlXNOZhhF6RjFa0x5dMLyC7lDk8rJNzg2KWJaeh2nW0ots5gKg8I8D7aL3fkri/ PujKBuZ3bml1wpT7o8sWbw+l6dhNL7R9VM/vBOW1QWbdX4cMjaQJWyOMMzDMRc3HV2ec HpL3pWULi90mMjWUJwP6/Gqk4dsLGhdJDzDovwOlkfKmKxOphxUnnrPmGhOY+pYbR9Sn TJLqNAno20OJEv46+DYu3+ZA2ogYeSyem7EcTPCsDVx6nEaEbEguYBrEg9iGJbMCmIHa pfLjPXwy/tAdjCNNDDtRxJ7UaLLO8ySlXukYI2hp2fnp/5gmDeXLe4bNmaiHlAux2apz p3ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+wOpV4fqMfulJL94yGwph5KH7V/fTx9ABJUvCl4zr4w=; b=XR9NskMIOgTT+GPVi/CjSUrvuFtwLt4IR26Ym1i1ExePCaAPxte1XP75FRLzP6WaA0 1NCrMIKmEmDqsn6GDnSRwgXDn7kIDTpwKmelFuuPfcaSsioC2h9t5rdNyfAefPpdYnYW iDhFlELu7H8Cy1h/6znHtcFYEcdw/sP1EmwWnYquEE3a0bOtmlzefzvbNzzzijcGOB7N CUpbWm2RNMUq6xd9r/Q+QPtugZ2n4WuTpi+D5KB1SkBcbWwSaIuwfn3pCcZRZ5MLBs40 5HYTemgI9njWmWLUY3sPs6DIpr1eVtqOKLGXZxIsICmQ6/nlqw1Yj8t4Mw0VgyjPedCu vfSw== X-Gm-Message-State: AOUpUlEfTztYtAJHAHLCAJLMWdy2ovvtaHS+FrKeRjFgSXi7abUCKahJ 1JcotrQ4QyOKDgI2LGJhUkdv2dsSpuqrbE+qnLGhDQ== X-Received: by 2002:a2e:540d:: with SMTP id i13-v6mr10865685ljb.51.1531782190211; Mon, 16 Jul 2018 16:03:10 -0700 (PDT) MIME-Version: 1.0 References: <1531418745-19742-1-git-send-email-tdas@codeaurora.org> <1531418745-19742-3-git-send-email-tdas@codeaurora.org> In-Reply-To: <1531418745-19742-3-git-send-email-tdas@codeaurora.org> From: Evan Green Date: Mon, 16 Jul 2018 16:02:33 -0700 Message-ID: Subject: Re: [PATCH v5 2/2] cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver To: tdas@codeaurora.org Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, sboyd@kernel.org, Rajendra Nayak , anischal@codeaurora.org, devicetree@vger.kernel.org, robh@kernel.org, Saravana Kannan , amit.kucheria@linaro.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Taniya, On Thu, Jul 12, 2018 at 11:06 AM Taniya Das wrote: > > The CPUfreq HW present in some QCOM chipsets offloads the steps necessary > for changing the frequency of CPUs. The driver implements the cpufreq > driver interface for this hardware engine. > > Signed-off-by: Saravana Kannan > Signed-off-by: Taniya Das > --- > drivers/cpufreq/Kconfig.arm | 10 ++ > drivers/cpufreq/Makefile | 1 + > drivers/cpufreq/qcom-cpufreq-hw.c | 344 ++++++++++++++++++++++++++++++++++++++ > 3 files changed, 355 insertions(+) > create mode 100644 drivers/cpufreq/qcom-cpufreq-hw.c > ... > diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c > new file mode 100644 > index 0000000..fa25a95 > --- /dev/null > +++ b/drivers/cpufreq/qcom-cpufreq-hw.c ... > +static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) > +{ > + struct cpufreq_qcom *c; > + > + c = qcom_freq_domain_map[policy->cpu]; > + if (!c) { > + pr_err("No scaling support for CPU%d\n", policy->cpu); > + return -ENODEV; > + } > + > + cpumask_copy(policy->cpus, &c->related_cpus); > + > + policy->fast_switch_possible = true; > + policy->freq_table = c->table; > + policy->driver_data = c; > + > + return 0; I haven't looked at this driver in detail, but I have tested it. Instead of the line above, I needed: return cpufreq_table_validate_and_show(policy, c->table); Without this the framework thinks that the min and max frequencies are zero, and then you get a warning about an invalid table. I also removed "policy->freq_table = c->table", since validate_and_show does this. -Evan