Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2460391imm; Thu, 7 Jun 2018 10:58:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLMdmdlEqz3tOVVtWzZcgL6qnRKrZic9Z2b2F940R7oVgGFH3p/bs1NweZ65aHDQUFjLPxM X-Received: by 2002:a17:902:aa01:: with SMTP id be1-v6mr2995981plb.296.1528394320455; Thu, 07 Jun 2018 10:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528394320; cv=none; d=google.com; s=arc-20160816; b=wbwEkup6tge2j4t7B038iBUDwbe/uSUIMKrBPiCDBO8ognQ+2fipn/pg63YQ01wmqM 5jQJpZQWUXUHhK8O/RvxEW+qZki0YLeGVaMtJZiwoeYXonMpGHxsdNIPs8N1KjmHsVw4 AZCDmuwxSw5+xCQwMrJFX7kwxHyhPsxVprMQ3kB6Kr/WL79KuILvWm/bJ4V2QWjggIzJ a9Oko7qac8rnErMFVY5w+tvmpdDZ9UL2+2cy6WsQFZYIjBPcAAChXD3NsH9jpfBTcpA5 wC/eEdcwdJju+SD3jfaJcJD9KMmLm34nEzH8vl1TMJ3/tBLUvxt9/QPn68W+C9Iww+wM CDug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=W0MNMKCVPc/JqrMapwNILqNCBLIhK+ntC+reG5fttaA=; b=l++7YYN03G4+SujqpDXAirHKlkYnlMZiZUp6TQ/MSkKA5zibCrrtfTfwabiqdzpgQw 0yifpUmzxB2qTK7RQ181X+uulsgIi2IGBWK3rSF+YVylDTDSPjgVvIT3fZuB4XmIsQBW moGoctxzepnqMpE8vBxQQLch1tbbgnIWhnSQYwh7xxj97vypX5ml6PX3JcdBpeQ2bboJ AMDUB3KJNJT6eQO4B0ugpgfMgwhvm/R099V4f/sJp1l183MqFR46XfWIGdQz1d9/5BTS x3xFCUS/d45sOFmFy8mAiceBzNEZRu95S5a2Egt9CQJPLSjzOIX0NIwgZWhcCv4pdafK faUg== 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 r63-v6si53009428plb.366.2018.06.07.10.58.26; Thu, 07 Jun 2018 10:58:40 -0700 (PDT) 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 S935094AbeFGOsc (ORCPT + 99 others); Thu, 7 Jun 2018 10:48:32 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40841 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935083AbeFGOs3 (ORCPT ); Thu, 7 Jun 2018 10:48:29 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbX-0005Zj-Ma; Thu, 07 Jun 2018 15:09:31 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbA-0003A0-Ij; Thu, 07 Jun 2018 15:09:08 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Rafael J. Wysocki" , "Viresh Kumar" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 304/410] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 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()" Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki Signed-off-by: Ben Hutchings --- 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 @@ -370,7 +370,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)