From patchwork Fri Feb 23 04:08:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 129326 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp158071lja; Thu, 22 Feb 2018 20:08:40 -0800 (PST) X-Google-Smtp-Source: AH8x2273uTYbl/k65wtmE8jLPH8K+R/NocokysyKzmhxNBI8VQw+c19yCKC8TqmUbejCfmXHvc0p X-Received: by 10.99.171.70 with SMTP id k6mr315064pgp.355.1519358920671; Thu, 22 Feb 2018 20:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519358920; cv=none; d=google.com; s=arc-20160816; b=qIs0nFXJ2SYdB3VHIMslHkiXDteCdo5AjnX9TFmyUhGPK0POrlNEr2U3mYLELZ3ORX yRsssYtE9kD9DvRnOu+DpKxoaBiXsgoHwZR/ae3RrNReb26I6oEWeHHomNWBkBgJvorh bokDxMvnAZKHG8OX09YPY4h9qXg62LrAzD72ncbG/ez/KYW65oX0fNU6VWrJTkROhpX2 YF0OjUt1XVVr0nxC5eQB1r4EkGEMEMDrYHhS98P6HoilT1mcbxg1Kb0lReyuKqoeDJV+ Vmw1GN8OLmT8B+UC8qnjkvqesox5EjdAxL8UVrND1q2hpCLr+gqNSd1hUuscUSHIGcgP Oz8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=iTLPLsw60FS6TuZ6w5A8R2dC5cnvBTkaySe4Zigb9a8=; b=qr97OT8AxriBchAtGe3BSbIkEICpowyPpunE/Jp4WY4aus3lGlipdtUk4/14em42b9 U/OgdKDZxCM4WusMkith4aGCqJpx1WpWaB50ZThaztB9kEw8r6FJ9WtSfWdvp+5Blr+c SE9YGCL5CSRFMXVvuFlyNb6tqoIy8PYzplN/wf5rcHOLWJf4pWQW72f9ekCjPZPD87M1 79EI1OKOIRZhTqbwOHJo66HxaDKboWiRfoY+AyPEuY6Pk2JFduZl/aE1KpGoX40xXObC GSMWNmcxkzta/qWOCHakIqs+wj4D9jx7Uc/eGkzStWxPpTAN1FO7jt3joKw3s2Yx+pSW q1FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OYRYO6q3; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si961211pgn.272.2018.02.22.20.08.40; Thu, 22 Feb 2018 20:08:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OYRYO6q3; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751436AbeBWEIj (ORCPT + 3 others); Thu, 22 Feb 2018 23:08:39 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:37870 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbeBWEIi (ORCPT ); Thu, 22 Feb 2018 23:08:38 -0500 Received: by mail-pl0-f65.google.com with SMTP id ay8so4209234plb.4 for ; Thu, 22 Feb 2018 20:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=+nKB3nvkyFOkdAsYHnA998knL/R/v24ySX3IvZlWEBg=; b=OYRYO6q3d7wNsvQvp1VlO6ADSYLD9l65gWefQ4T666ctbcZ0C3sbvA2bdHSqrBRHfH d6a3yXvVu3EgsUzery17hdS9Q8q5KNMDBsJqCr7LppVicaDGZUWAnVdafXXaAYFg+fRi qbqqRZ5uIqIkNDB4jLIAEAazordzHdj+cjwSk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+nKB3nvkyFOkdAsYHnA998knL/R/v24ySX3IvZlWEBg=; b=lyrIyTdq3chOgDE5ky537zFgg5GdTsrTXvTM2FssdHgBjGhLYP+6YGM+3wy+AhsLmX XY/SpQg2xTtyCWjDGZi5y6rff9hmLRNjy+MmJNAAxGVjwUVzBfRBismxu51mboqLKHus x1SKRwmauQeHv+rVFasQNG2iJuvGNhC7lxNv0pLC7rYe4YyiDaD+lBjd8vMwCjyOm6dG 5EDYtUe8XJd4q8fjRKngboj6JodqFKytLADOQtLo3ohaIM3kXVMSXF9Xyr5OQ2GhP0xB SCEeT6UOqE5hFUQQdeqhWYpnnsY/IvgrfVtFcJdBVASjAj2mmuA3qrXtos4m21j6iC8+ j0EQ== X-Gm-Message-State: APf1xPDEQMHIJxsQkIJR6MI3H2F1fCVv67EkPWL5EyS954J8PyCFqJPN Oemz1VKL105Pf0896UKvX6u4Dg== X-Received: by 2002:a17:902:6184:: with SMTP id u4-v6mr395236plj.390.1519358917543; Thu, 22 Feb 2018 20:08:37 -0800 (PST) Received: from localhost ([122.167.232.138]) by smtp.gmail.com with ESMTPSA id n81sm2682967pfk.152.2018.02.22.20.08.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 20:08:36 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Kukjin Kim , Krzysztof Kozlowski Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Sylwester Nawrocki , Marek Szyprowski , =?utf-8?q?Bart=C5=82omiej?= =?utf-8?b?IMW7b8WCbmllcmtpZXdpY3o=?= , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Date: Fri, 23 Feb 2018 09:38:28 +0530 Message-Id: <6b737a9c285840b4b2036fa51b692ee835664ec8.1519358505.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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. Cc: stable@vger.kernel.org # v3.13+ Fixes: a307a1e6bc0d ("cpufreq: s3c: use cpufreq_generic_init()") Signed-off-by: Viresh Kumar --- drivers/cpufreq/s3c24xx-cpufreq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.15.0.194.g9af6a3dea062 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index 7b596fa38ad2..6bebc1f9f55a 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c @@ -351,7 +351,13 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name) 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)