Received: by 10.223.185.111 with SMTP id b44csp900525wrg; Fri, 9 Mar 2018 16:22:55 -0800 (PST) X-Google-Smtp-Source: AG47ELt0wV52CShaw3SQ2ApEeqkojm8ywZb7XpTkM4YISXWudMgvytqonxeDK0s+Kd3kgtTlWw7l X-Received: by 10.99.107.202 with SMTP id g193mr291124pgc.38.1520641375554; Fri, 09 Mar 2018 16:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520641375; cv=none; d=google.com; s=arc-20160816; b=w4S7T9nds+NTf+Sx5rl9Mr1E+tubqSlM0TbDhuofUou1qi8rXAGqXttd9mR0ejA0O3 gfM53O9EQ5EKlQMRO/oiN4C/bbIB3BJ0Cn3VFMfygIwV8oJo2z6KOocVhZ1RYNXrFcrz 2FILrdyJcY2H4757GTgTiVBwX6vRE1T1Y3davP9lnOD8cIAHWAUKDgnTwQuDyVwQs6rP 9/ATQ9RCbhrsfoxk4vwUsFX0tSqA9+WxpbAjclyFr0CrTYm4Pl0yUdUzYRtHTd0h82UX KNRZeccgSklv++IWEy2Rp5kaKR69/uiP2LDQf2J84iBFxWSD5T6DBUCXG9/CTv4bJ2go as3g== 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=5QhkUfOUl5E30eipyxkSbO8iXovxu8HNh3vlf86uIj4=; b=IKzK6mL56FNajLhWmsx2ECfah6n+8MgB2A70KTjWzwEenxogTZ3DUcMTBuw7N2mSKF YwzvsGlXDK2A9amEuYlhOPlf1OTTnRarmYiGJ4zJHSv6tUdAq8EkkBYESsm+rfKwiWQs igdOiISXqEzpzYBLJr/fixa51qialJTEAJyqrkmEotpXR9XIHTU+9auoQJ2luZKbNqB8 JASk2yl3jDkbbV4G8Y1z9zSKFFkMkH2AW4JobgXp2Y8VOBGpB+H2wcMZuGi+Rips2uqt BEbv/oSLKJiOpiVpOTZoHp1QwLEuIU/cdZUIHgwjSNuJ3XxQ64jwIxj+7QrjXHJMdMaV 8ueA== 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 k131si1480964pgc.361.2018.03.09.16.22.41; Fri, 09 Mar 2018 16:22:55 -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 S933630AbeCJAVL (ORCPT + 99 others); Fri, 9 Mar 2018 19:21:11 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39394 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933544AbeCJAVF (ORCPT ); Fri, 9 Mar 2018 19:21:05 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6B8C810EA; Sat, 10 Mar 2018 00:21:04 +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.9 13/65] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Date: Fri, 9 Mar 2018 16:18:13 -0800 Message-Id: <20180310001826.019666530@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180310001824.927996722@linuxfoundation.org> References: <20180310001824.927996722@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.9-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)