Received: by 10.223.185.116 with SMTP id b49csp5494492wrg; Wed, 7 Mar 2018 12:46:07 -0800 (PST) X-Google-Smtp-Source: AG47ELv/qa/i4g9fD7nvXb5UAu7K5asWwVocZ67KPUleW7+7vyD71eXdISIQvNyGvIf9oMAiNJfv X-Received: by 2002:a17:902:3183:: with SMTP id x3-v6mr21500882plb.383.1520455567671; Wed, 07 Mar 2018 12:46:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520455567; cv=none; d=google.com; s=arc-20160816; b=MsQYQXCwu9fvf3Z1HDdFceB7ee4cMKR6Vx9MxCBqkf66ZgRC4LpkjEHW8wnVxVanNG odpB/MFMugCR7FrkeC7aKvP7KusK1tHcUKH2Y/jRgBeulwFUWZujElB5coRCkka+Ysgd IVeOt6u1rm69a0GZfvxwtOI+JEXLrReoBF506btD4cM+JPeq9h3aKi5JMavKAZGyn0z8 8MBfmFmKvWEJ3M7U6JmWcP/XMMtad+wJthMteevMAFejBCXIc4HS/7ftimzo3kiwREU7 4lXi+eLvfbCOY8aP3LOVB5wcrsaGiA4carugaAsrmO1SURvD599hqft1PM/lv45ei+gU a9kg== 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=CXaV149gnGzeMVLrLv6osJAtFA6skdVpgLgbg6489uA=; b=x+IpaxFrtX5yZr4Hwe1wFOJb5lmTwe0VEcriy9rHQZbu0UgrWvu2PrbdQ3G5xAZKAD qpcPgc21gP/POx4EaL006b2n2NQuxDMzJ4QOrCDndYgATaavpjMwCw8VyvMd5ZloFz9w Q1H0XmjKMa1a7Cj8jk66Wvtl2TVtwmCOmrSBQudKiyCijA7K4KBWKCnExpMM+oSyQJ8u hPG+J66DUCzEiDDrZ8GvRtP5/6GQwjSYBCHwN5dkgEuDBesO+zNngEarUYdutx3TP0fT /c4wgwAlrX0eBiUrQPafItCS3woFbpM6rmKUBATEv/2IsrLZsDsQfnH50waEHh/EEjkC nezQ== 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 h7si4905217pgs.235.2018.03.07.12.45.52; Wed, 07 Mar 2018 12:46:07 -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 S964844AbeCGUol (ORCPT + 99 others); Wed, 7 Mar 2018 15:44:41 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41000 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934564AbeCGTlT (ORCPT ); Wed, 7 Mar 2018 14:41:19 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9D835FF8; Wed, 7 Mar 2018 19:41:18 +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.15 033/122] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Date: Wed, 7 Mar 2018 11:37:25 -0800 Message-Id: <20180307191733.984904057@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191729.190879024@linuxfoundation.org> References: <20180307191729.190879024@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.15-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)