Received: by 10.223.185.111 with SMTP id b44csp915501wrg; Fri, 9 Mar 2018 16:46:19 -0800 (PST) X-Google-Smtp-Source: AG47ELtg36gcLEnYdWNnypYkJsrOxwfJJEp6bdYKlMNxFS5DN/3ZottJ1ziciHuNP30JY0YUv2dC X-Received: by 2002:a17:902:6987:: with SMTP id l7-v6mr396007plk.14.1520642779628; Fri, 09 Mar 2018 16:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520642779; cv=none; d=google.com; s=arc-20160816; b=bWmHhzY5PhNFyU7Vc441MJBtiOg4T40LHXEqSQFzWl4p8T96qLhCMP+4xTK4eTJoJa UY3IdgapAVRL65PqKLMqotd5F4UnJNn+EMuaLswWtml+RJp6uwnoQmH8nR5/q2zLAUOj 7lrYZkunLw7IjT6E7hA5Pzri8sZyLJ8qMRW7VrKmh8TVCrWhcwTDtef2klbkyiqgpa0P M5NulL0QkqfWgaV7/BZlofeZ5xQ2DLQJTrv6mhGXOWvDsd4rJI1W0l7HljjCx7sv82LY gyDFUCYQGe3XF/JlxE3SLbbx23lB7o97ferxU3NfDVDv7WDicL+NsSALJEMMauyJ26CM QtIA== 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=D3XyiAOKJBKBBZeBb8KNfuRzWgfJySYGMMDdm5/dUiM=; b=jID4RIQLys92eldD5IwvEd/cblvckmggDiBRYFflIrlvJL/CGwjfU/5MUq3/e6edkw SCKc5/J1SheGx+IP3Gy/yCgWHBGL3KCUAAgZ7Tv8aiQ6bi1jZITgCrM4VpFoKV+lnWnW 9WqBZjahEH5R52xAQE3iA1zC/Z5gcwHDM9VbM4tZss/+0d2oWGa7bfhMyR35rXU2GarK yUdlQvjyXz9UeFm3JKFsT/BDFk4dL3Hmr7t1qCxBg4DFXlP1ZMudA86slS+x8Ap3k2yr OL2x12ciJg4kXYYAFAH4L0EQ71/l5Axf+WDE6Ye1AakRijx0hS5Q4JBUUk0Z2Hp9jyl5 FNjg== 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 u64si1516873pgc.295.2018.03.09.16.46.05; Fri, 09 Mar 2018 16:46:19 -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 S933399AbeCJAUX (ORCPT + 99 others); Fri, 9 Mar 2018 19:20:23 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39060 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933378AbeCJAUT (ORCPT ); Fri, 9 Mar 2018 19:20:19 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7811BF4D; Sat, 10 Mar 2018 00:20: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.4 06/36] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Date: Fri, 9 Mar 2018 16:18:22 -0800 Message-Id: <20180310001807.545539995@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180310001807.213987241@linuxfoundation.org> References: <20180310001807.213987241@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.4-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)