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: 10236875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CEC2A602DC for ; Fri, 23 Feb 2018 04:09:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C870D29163 for ; Fri, 23 Feb 2018 04:09:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD1E129271; Fri, 23 Feb 2018 04:09:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4A1CF29163 for ; Fri, 23 Feb 2018 04:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=gMuIjAL8DsRkxcrsYrJQJZza5yv3D4cQbekvXKL82K0=; b=E16 3AiYxEEopWne26h8op20/qSWp+2xzXmz6cGnPGUR2DNLBD33jclSlcPxAi1R2zQx8WUboh97pNBHj cqVl8Y5H8RQge4raSJivPoj3xf4sEaCsNEuguH11XR1gikzzXk8v3nM66E3+1PBgn4B80INiLZuoW mid2l+LW/tPtVdf6398gRetHPmiNcMExfW1kz6tmhhZiwThYEf8HLNkD3P44lGpTEyE6jnvwRPmn/ Sph/OGccMvK/28WAUGW5umqRm4eQX4jjthLrRU1Kmcp1rcWW10vAVLpQoA70myyYVetRDkxCIM/G0 +l2ZK0bfFcO9DyWLlOid2dIFUJQvyWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ep4fE-0006TH-ES; Fri, 23 Feb 2018 04:08:52 +0000 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ep4fA-0006RH-J3 for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2018 04:08:50 +0000 Received: by mail-pl0-x241.google.com with SMTP id v9-v6so2210864plp.12 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=iFDz02PCa/WxtMPedzcXlB3ObioIeleOGH+Uz6P2VJ3rjqIoBnHnxakIcYNz6biQ8x 9OUL5AHmZVyu5nalyeLnQKKqT3zKUpNo48Fm+Ah/mvZA+XDnE3UhWywp6JtfYGHLoNn0 EnbqO8KlDK/oogPT0xkNSs2BE5XKkZDhqkUprDI8nUC3/BZ/Rij8mbUcOYu1ubJECKoG aD/W6Y5q1egjwvQ103tjK2IPRxgRZZCA7UwW7K9IQkmj4u4/zRNsDqK95L+rIQQe0rqq CvyfgDcZvJ4ntQdvkVaogdzjqwN/jYr2Y6/pWAfRGOyozvwk+ZikN3g3hTZbuqmqqA1r QqQQ== X-Gm-Message-State: APf1xPC6+lSVx3zApR1UQjgo90Hr82XFfLuVh6ZncRCKwiN7k54EE6no fhxBWOIZMvB5kMS35Ip9hgWRkQ== X-Google-Smtp-Source: AH8x227eUq3NBasNYstCSJlXEp1WAve2tyVVZ2sE8RoSoAq8VLZuFe8yRDs5nQd3RXL/0vC8o1AOWg== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180222_200848_640100_A8A5122C X-CRM114-Status: GOOD ( 12.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Vincent Guittot , =?UTF-8?q?Bart=C5=82omiej=20=C5=BBo=C5=82nierkiewicz?= , Viresh Kumar , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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)