From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dirk Brandewie Subject: Re: [PATCH] cpufreq: Make sure CPU is running on a freq from freq-table Date: Thu, 21 Nov 2013 09:56:32 -0800 Message-ID: <528E4950.9030507@gmail.com> References: <3577662.BKCLJdcf18@vostro.rjw.lan> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=F25rOve2nEMP/TkBRnIfFZMUGWDHJDXQX0b07owzEYg=; b=JEkBqqrs6LIMnOWuCcpSU5a+ew+KRpZ2G7V6sS1hQAAhzrLAxe/BvGN07PmUC8MqRp EbkVbc34KAlYB5x0s1/c5hGGnbuWM/Wb6lSnaFgkNerN5UIb3K9ok6jrFHmr7LBRoM+x FvAKq/64o60w9vm2cW7DGFnIXXfhqvs3sc5rG/tsxvKXIZ3bqAUtdCDM7OeYocdWMF7b W4P7Jv11gymMUdPv0ri4gQwUhFeKPJGLyCXUCMbmBc2zMa9mupmHtjMSiZfggXzhTT5L 2Tjpkb8GEwjsEeGebb5YrjWqSP+4Fak/7AdhwLZWXYUXd2/FNfnq7OCjgfXLjhRLzgSm ZEsA== In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Viresh Kumar , "Rafael J. Wysocki" Cc: Nishanth Menon , Lists linaro-kernel , Patch Tracking , "cpufreq@vger.kernel.org" , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , Shawn Guo , Sripa Bagadia On 11/21/2013 07:57 AM, Viresh Kumar wrote: > On 21 November 2013 18:41, Rafael J. Wysocki wrote: >> On Thursday, November 21, 2013 12:39:02 PM Viresh Kumar wrote: > >>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c >>> @@ -1038,6 +1038,32 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, > >>> + if (has_target()) { >>> + ret = __cpufreq_driver_target(policy, policy->cur, >>> + CPUFREQ_RELATION_L); >>> + if (ret) >>> + pr_err("%s: Unable to set frequency from table: %d\n", >>> + __func__, ret); >> >> Should we continue in that case? > > I wasn't sure. I thought maybe there are platforms which might not be > ready for transitions so early and so an error message would be fine, > as we will fail soon anyway in case there is a bug. > The scaling driver for the CPU has already loaded and its .init procedure has been called so .target better be callable. Since the scaling driver is responsible maintaining the set of valid frequencies and setting policy->cur I think it is reasonable to have the scaling driver ensure that policy->cur returned from its .init and the operating frequency are in sync and match one of the values in its frequency table. --Dirk > -- > viresh > -- > To unsubscribe from this list: send the line "unsubscribe cpufreq" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >