Received: by 10.223.185.116 with SMTP id b49csp5465562wrg; Wed, 7 Mar 2018 12:13:48 -0800 (PST) X-Google-Smtp-Source: AG47ELsxbRZnhDgyY/gigR/tyo4MswKzao+Yfa9xXiCQMRRP/TMJ85H6DXbNrlJAp6CMCE81Pra/ X-Received: by 10.98.155.93 with SMTP id r90mr23936703pfd.132.1520453628566; Wed, 07 Mar 2018 12:13:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520453628; cv=none; d=google.com; s=arc-20160816; b=Ws6SbUu6vZx32fDjdc9VUojuWXgFZ+z1K/OHnNXV3mvPCX6wWryoya65B/G8KqaU9/ DajrBoN41AgrkJQ5tXNGBHsqmfWJzAB/ikyO5bB9NQSqZMAbmXROkrHIzUTMP7q6C4i1 syPg0PGmu0L4ZD8FQtVZp4Ov4jfBe3uj8S9+KQOugsvSARUh9F2Yui+nRymrGvAVS91C mi41dHk/Hmus9jI42Q5kfkImAcgHN/Be/yusYxIuhfvNJCFv73E2/eMvwsXzzLZiCnlC 5jdPtKvTsTUqqtOyiJwBt1IuNgaWzfdRX1LRUaa8jzitEeAWiLJiTudTUyE3tP+e9c86 9HLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BySxhBICl1y8gmW8BQrfUh3wzHC/P69yEmTtEdg16rc=; b=IY6S7t8n70lBrB1T0GWNSXd4PaWhioLnq9J4PgGSgcuE5MWuOxdhJK4MbTd5Th4mFt PRC90xJ/ixcVR7Cvum0uTHrkCOCpt+LwltmtqbMCZ+HkqS6nwP2ASTkmIqqlj1Aj4TwP uULTOSY420YJfZmP7GHkphWT4HdDjA5ft99SLf6CFaAa8RLIA1uANrMQdOF31oQSnUQl CdHim1NG9L0UKm/r1UqK/72zfC8AeulNCDiHTeAzauI1e+f1Uk/yqxjKY3VLbb1EYljg ut+8uRTksb5A/rar0uOPvQfOZe7+ih3O/ZVgKd9pOXu5SRRSWvHClLPIfLsaiYdHAsED Zn8g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70-v6si13562751ple.465.2018.03.07.12.13.34; Wed, 07 Mar 2018 12:13:48 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965281AbeCGTpP (ORCPT + 99 others); Wed, 7 Mar 2018 14:45:15 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44108 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965182AbeCGTpN (ORCPT ); Wed, 7 Mar 2018 14:45:13 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B8DD1F1E; Wed, 7 Mar 2018 19:45:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Viresh Kumar , "Rafael J. Wysocki" Subject: [PATCH 4.14 028/110] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Date: Wed, 7 Mar 2018 11:38:11 -0800 Message-Id: <20180307191043.342127421@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Viresh Kumar commit 0373ca74831b0f93cd4cdbf7ad3aec3c33a479a5 upstream. commit a307a1e6bc0d "cpufreq: s3c: use cpufreq_generic_init()" accidentally broke cpufreq on s3c2410 and s3c2412. These two platforms don't have a CPU frequency table and used to skip calling cpufreq_table_validate_and_show() for them. But with the above commit, we started calling it unconditionally and that will eventually fail as the frequency table pointer is NULL. Fix this by calling cpufreq_table_validate_and_show() conditionally again. Fixes: a307a1e6bc0d "cpufreq: s3c: use cpufreq_generic_init()" Cc: 3.13+ # v3.13+ Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/s3c24xx-cpufreq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c @@ -351,7 +351,13 @@ struct clk *s3c_cpufreq_clk_get(struct d static int s3c_cpufreq_init(struct cpufreq_policy *policy) { policy->clk = clk_arm; - return cpufreq_generic_init(policy, ftab, cpu_cur.info->latency); + + policy->cpuinfo.transition_latency = cpu_cur.info->latency; + + if (ftab) + return cpufreq_table_validate_and_show(policy, ftab); + + return 0; } static int __init s3c_cpufreq_initclks(void)