Received: by 10.223.185.111 with SMTP id b44csp920385wrg; Fri, 9 Mar 2018 16:54:18 -0800 (PST) X-Google-Smtp-Source: AG47ELskIfheg67iSRPqqMEvfQF1NzlRl86JuPHf6+7lXYyupHOJBFbv5UGzxBL6N0xTWYgPvuFt X-Received: by 10.98.150.212 with SMTP id s81mr395263pfk.100.1520643258358; Fri, 09 Mar 2018 16:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520643258; cv=none; d=google.com; s=arc-20160816; b=Rx9Rh5pEMcnyristPUtvWyoYfbGutXh9h2YeV+hBOy6MrgAhuv1OMKRZKm/T8eZZoT 5GfeF1ObLA9hjp1udbIgt6Up5U+NGMjcJhak+DmS+uvvry8u+HaW73hscWloM6H9omOj InFQtQHHuDG5PSXjVq94yurNQOlD8Uh1mEqasDOCY289Lj390BgvNoYc+klTj/oEjpRW 9ROvijPrFqMy2PSlH7TDqcjBbIaMBeMpbkUjL99QTBxNvQuQUq9vnSDTnvH+UmBlhOkO 1+gtKKMsV3dRdbNbb/2ZEv1pQVXYUGvg2szoEqoXlTPm3FFGrVPTYbw5mvqKV4QtaHzq aiwQ== 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=U25QvvSvvnhyb/xTZA/78Az8qmuVtpUlFuIUQMZfeyI=; b=oyjrM+mqCvpbnQ4R2+QIqBD27oisOsGYWIm/yET8XhZ8wGiQAJrOnPVgsFgxnipWOa ayqQ8Yyd/yRJ8fAo3ya525a8yBU9Hg4i05qPkviPnF1CGoczLfgUda/WhQMq9iVVJ2Gw sR7jqBjfEBg5onlJgmf4Tb0h+S/nVz5dVjLPmToT4zaW+WqJy3HjEamnDUPYrrWOf0t3 S4oD5ndhunHBGShIBLpv5poBiei+Tlw9XtjeHKxUPpDXHg1OyKVlD+8AzvHFEHa7zmVU dsfwQjhJK1eZikFc+Y5MU35tyOQRa/9PflF7wLJLE580IZPIt9oweVfQ8k4J58/6Ap9U Cvmw== 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 u7si1511685pgq.796.2018.03.09.16.54.04; Fri, 09 Mar 2018 16:54:18 -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 S932871AbeCJATD (ORCPT + 99 others); Fri, 9 Mar 2018 19:19:03 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38490 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932847AbeCJATB (ORCPT ); Fri, 9 Mar 2018 19:19:01 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C9711E6A; Sat, 10 Mar 2018 00:19:00 +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 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)