From patchwork Wed Jun 13 12:20:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10462135 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 DEFC260532 for ; Wed, 13 Jun 2018 12:20:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC11F28961 for ; Wed, 13 Jun 2018 12:20:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9FBD2899B; Wed, 13 Jun 2018 12:20:42 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C8C928961 for ; Wed, 13 Jun 2018 12:20:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935274AbeFMMU1 (ORCPT ); Wed, 13 Jun 2018 08:20:27 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36719 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935404AbeFMMU0 (ORCPT ); Wed, 13 Jun 2018 08:20:26 -0400 Received: by mail-wr0-f194.google.com with SMTP id f16-v6so2544928wrm.3 for ; Wed, 13 Jun 2018 05:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=VXMObLkaRdtZ5xIrVEFfsDP8NaYCnE9HLQjsV/6p7wE=; b=MLzk5GRdof6PHZDjr5c6b42CTniqL/DAa+w+uVMEzwlS2aGOc39iyLjNAd7/ZR4VgK WDaXWDIRWOjFnmO2xrxjSgLj0a0wmXK1fcY2ufK4cF/pDRDLiUqE7fC5rSN0jFCY5igl mKNvmeBjl6Wp8rkZtWxbjCj+wwrYZy9JQyuHLU869VIQZSu4P09UNvWW0ycM8HaNukrA FjXIf802h879OQTw3v3VwX/U9CbU26/XTMfLS0JqsWwK/MKOLpjf4h5th7cENbeFZ9fu Jw0UuqoNUK+Q6RBkjR+icTntWAxniopQf4ljePEzNd52EjXWaNk+nns95dNysbdE6IYp LbUQ== 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=VXMObLkaRdtZ5xIrVEFfsDP8NaYCnE9HLQjsV/6p7wE=; b=cr+oJ2Rq+7lEAS/Sy1eWljybe24wHowz3K5RISADiDdMvp5BE6iC7zcDTHhlUxv9jr xmu8W543lvksATuVMF1IipFLV6BwpW2nG41a3lwx5T0EZhjuQ8XgtM4wkGr3G68IX9xU 8D4th18eyZESmOxyIFbWE1QKY8gdJSoSZDdLSmO8hsrARVP/8dMR/7vlg0nf5FjGX7C7 vjlHZaqvkiqbRmBZ477mIqD8dJUzh/4LaYD1D/5HnUfb9EUHbB+v3b6NbF3gglgtJg3h HPZZVk6o+Nq1VKR1LNta3YnZqlxYE8m7yFiKarhcioMHd0EI09KmxAIjhlna/Sub8L2Z LgPA== X-Gm-Message-State: APt69E1VZaXJZZ24QdNq5OSPHnVzB0ibu7oeIj1hYRZvasB31Pog+6k0 /kiE6j8aNcgYtagx3pL80/4zMCqr2b0= X-Google-Smtp-Source: ADUXVKLthqDp2dg3qYvaRvzpn43+gfXwpq4S72HAe6Oa9UcmlMS1EHbaF69pHJSz3G5UNC41f41YBA== X-Received: by 2002:adf:a6ca:: with SMTP id t68-v6mr3876410wrc.215.1528892424885; Wed, 13 Jun 2018 05:20:24 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id g11-v6sm3202829wrr.46.2018.06.13.05.20.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jun 2018 05:20:24 -0700 (PDT) From: Neil Armstrong To: jbrunet@baylibre.com, sboyd@kernel.org, mturquette@baylibre.com Cc: Neil Armstrong , linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: meson-gxbb: set fclk_div2 as CLK_IS_CRITICAL Date: Wed, 13 Jun 2018 14:20:21 +0200 Message-Id: <1528892421-12180-1-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Amlogic Meson GXBB & GXL platforms, the SCPI Cortex-M4 Co-Processor seems to be dependent on the FCLK_DIV2 to be operationnal. The issue occured since v4.17-rc1 by freezing the kernel boot when the 'schedutil' cpufreq governor was selected as default : [ 12.071837] scpi_protocol scpi: SCP Protocol 0.0 Firmware 0.0.0 version domain-0 init dvfs: 4 [ 12.087757] hctosys: unable to open rtc device (rtc0) [ 12.087907] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 12.102241] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' But when disabling the MMC driver, the boot finished but cpufreq failed to change the CPU frequency : [ 12.153045] cpufreq: __target_index: Failed to change cpu frequency: -5 A bisect between v4.16 and v4.16-rc1 gave the 05f814402d61 commit to be the first bad commit. This commit added support for the missing clock gates before the fixed PLL fixed dividers (FCLK_DIVx) and the clock framework basically disabled all the unused fixed dividers, thus disabled a critical clock path for the SCPI Co-Processor. This patch simply sets the FCLK_DIV2 gate as critical to ensure nobody can disable it. Fixes: 05f814402d61 ("clk: meson: add fdiv clock gates") Signed-off-by: Neil Armstrong Tested-by: Kevin Hilman --- drivers/clk/meson/gxbb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index b1e4d95..0e053c1 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -511,6 +511,7 @@ static struct clk_regmap gxbb_fclk_div2 = { .ops = &clk_regmap_gate_ops, .parent_names = (const char *[]){ "fclk_div2_div" }, .num_parents = 1, + .flags = CLK_IS_CRITICAL, }, };