From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AG47ELvzw7O3QZporrQG3d3Iz8KPAsEvdJlsKl8s7xLc0Wko8W8wp1Iptt+szBAsCjn4ShdXpgN8 ARC-Seal: i=1; a=rsa-sha256; t=1520641142; cv=none; d=google.com; s=arc-20160816; b=otEuIgb0RsksgSuOy/oFni6OKxE4hoWuDHwG5sSg4Yheec2Z/GQj5ZxfJ9452AzMug jbrPxE6T6uPGvH8ZwUc1WAqpiEbWQgmkKIFH2KWtv11KENKWL2YrrJh0NT59orapMMh5 M/vPN5PqARJaH3/ugKqZkybKWA5KUM+TXbWgXGgmiTGf+vsbiY6QaZ7mzRZmPkSFq2zD IoBXa/2eWQwnk66/7xXSCcSTGMJuAQrzKq5bPSX9B1UsA2LOefRuRHJisOlcMqRWyFiu cdrxarJiqXCNBDg8g1wZK8ol4T8jzTlC2AKiQQHbZjwSQYqI/FoDn0OYT7yQYSMrXRZx 2oNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=U25QvvSvvnhyb/xTZA/78Az8qmuVtpUlFuIUQMZfeyI=; b=l94R9hOKTxeGWZ/xM4ar/qKwB/xaNlmbSix/KMN/RtOYieLwDhq8mI4L9ppf7AXmxa BnA+T0tjQB2HCUG48//pf7yx1IcOgaUwtKV7CgP/O9YodNxmC6jscVPUtXjUkyoHlIa1 xmM5p3cMcD68m+z6f+buvqzgdMh1FFVNNYsUx+dRsvgENyYFTllWnfpiQU7G25MSXAbm SVS72aNq+Z5M8ffkDLj1N39KctAbEGm7aiVUshqste5MxyF7ck7DXWIBXPe/s+mTMDfF vjYCxBY2dWN/21CtYW/21K8Fn26kEwswJlN5hmyLEkNuZeZ3Wku9iWy312+W7Ea/8YkK UMYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 185.236.200.248 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 185.236.200.248 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org 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 3.18 04/21] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Date: Fri, 9 Mar 2018 16:18:26 -0800 Message-Id: <20180310001801.309526366@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180310001801.045114869@linuxfoundation.org> References: <20180310001801.045114869@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1594507806873576777?= X-GMAIL-MSGID: =?utf-8?q?1594507806873576777?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 3.18-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 @@ -364,7 +364,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)