From patchwork Sun Jan 31 17:04:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Chmiel?= X-Patchwork-Id: 12057689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E402C433DB for ; Sun, 31 Jan 2021 17:05:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C742464E27 for ; Sun, 31 Jan 2021 17:05:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C742464E27 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=aKUkXbfXTq9q5knrxk8NMSPnb3y/7eDIave2GMoynTY=; b=vhRTJKUEbrDJFA69FrrOHmXIM2 9hnCZHI4oYq5u7TLj0o0tExrz71naqV9ZeR61u5ZEQbVIaAzggTyTDG7RwO98KYMZ5Cc9V5goQcqu fd4Z0ug2bgFJS4fTlUerDPu6A/741TiJhLk1PCDa2ZPO1NAfY+NPw91RzAtmp+40s31NlaSyeAvwE yAFEvOP5yPmndfQ/JR4Oc48LqOqEnXO+wZrCLQoTJEp9eFVrWlwlf5lLq8Nn72+7o1yFscWyZALV0 BN88jyUDkBaGw6A06G/c5XJz+oS38uNbt6kTQKpH8QkBQDdLCfFppmR+fRwGeHYauJu/PmRBaoAJR FpMWRsOQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6G9T-00015O-Ra; Sun, 31 Jan 2021 17:04:43 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6G9R-00014l-Ke for linux-arm-kernel@lists.infradead.org; Sun, 31 Jan 2021 17:04:42 +0000 Received: by mail-lj1-x22e.google.com with SMTP id l12so16615578ljc.3 for ; Sun, 31 Jan 2021 09:04:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pout1TBkszTxgf8qkPhOLyU23vQTAYXb5Jlkak39aW8=; b=n1MrBokRaILzWg3sgrkJb+c2bJPsYDm7sLFs6BIgXDZ5C+SooI6J77dP4Yv4zDM1Uv 2IyIITrNiu33//cMItwSki2zKdYqG+ClN2oivygX4qSMWc1U6frUAG6VE2xS4hVPNRA1 /0nZcQSUrRAeJuSVBpJGBcn+MTWTqypCQwAJpFDQzPFGJGSQJhDG02puKQgACOtUiU3k 6Y6C2k58qwCj7xoXzCt3cDORvReQAMZktst1vKmRSDWLlJl3VtNEs9sX8E94P8MRjDob f3DOw3vZSUoWIm1QIENqFhqn+N8k4uOyvl0al5flzzNQhASpao2WWnpRDG0DARZfs/6M h0ew== 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:mime-version :content-transfer-encoding; bh=Pout1TBkszTxgf8qkPhOLyU23vQTAYXb5Jlkak39aW8=; b=dWz8E1gX4KJMtUX6rWUWNPwoxrEUgKGympKsuXPhBwyoAbOqBmLzC+FH39uiZMLmzx JPGp8VGhHhVbbs/J6J93ftXX3POHPtHqAaU3nhWFzzcpSYABYSAwe+KvQMC74qj0lFXJ sQLqm0nYSKTYlg9jHAPzhgxw98hgnYk3wvy7pBB+72AF0RAXelwRHPn9qH+A5g9y3etX E/8dZyoHf8A8I8ro/GayRKPMPYnUXlggadWlbZYxlTaBV334th5+1SteSw65waftklOO aDg+vBLtM3RdrwYzNmoZH/WgufGh51pWnqddKPLLzZ0roqok7bcGCDLO3wfXwJB8DTVz atmA== X-Gm-Message-State: AOAM532MZyoQzMpl4xOaCMnZrfU99cID8QS4sIGvHYkPE/rM8HpiqIEu GrhaujMcq4Q2HyzNBPwq7dQjSCy4OxM= X-Google-Smtp-Source: ABdhPJz5g2byGbIwo8CoEWLxGmEwOuF3f0p5ils6TcTu58CDNSk8iGQGsAYM/afkHi+PSoTD3dIq/w== X-Received: by 2002:a2e:888d:: with SMTP id k13mr7955858lji.399.1612112679277; Sun, 31 Jan 2021 09:04:39 -0800 (PST) Received: from localhost.localdomain ([2a02:a315:5445:5300:fe74:d14a:9551:6fb0]) by smtp.googlemail.com with ESMTPSA id d24sm2707763lfc.225.2021.01.31.09.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jan 2021 09:04:38 -0800 (PST) From: =?utf-8?q?Pawe=C5=82_Chmiel?= To: kgene@kernel.org, krzk@kernel.org, mturquette@baylibre.com, sboyd@kernel.org Subject: [PATCH v3] clk: exynos7: Keep aclk_fsys1_200 enabled Date: Sun, 31 Jan 2021 18:04:28 +0100 Message-Id: <20210131170428.3290-1-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210131_120441_723994_AEEE109F X-CRM114-Status: GOOD ( 16.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, tomasz.figa@gmail.com, linux-kernel@vger.kernel.org, cw00.choi@samsung.com, s.nawrocki@samsung.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?q?Pawe=C5=82_Chmiel?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This clock must be always enabled to allow access to any registers in fsys1 CMU. Until proper solution based on runtime PM is applied (similar to what was done for Exynos5433), fix this by calling clk_prepare_enable() directly from clock provider driver. It was observed on Samsung Galaxy S6 device (based on Exynos7420), where UFS module is probed before pmic used to power that device. In this case defer probe was happening and that clock was disabled by UFS driver, causing whole boot to hang on next CMU access. Signed-off-by: Paweł Chmiel Acked-by: Chanwoo Choi Acked-by: Sylwester Nawrocki --- Changes from v2: - Avoid __clk_lookup() call when enabling clock Changes from v1: - Instead of marking clock as critical, enable it manually in driver. --- drivers/clk/samsung/clk-exynos7.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/clk/samsung/clk-exynos7.c b/drivers/clk/samsung/clk-exynos7.c index c1ff715e960c..24d3fc5c5d0f 100644 --- a/drivers/clk/samsung/clk-exynos7.c +++ b/drivers/clk/samsung/clk-exynos7.c @@ -6,6 +6,7 @@ #include #include +#include #include "clk.h" #include @@ -570,7 +571,18 @@ static const struct samsung_cmu_info top1_cmu_info __initconst = { static void __init exynos7_clk_top1_init(struct device_node *np) { - samsung_cmu_register_one(np, &top1_cmu_info); + struct samsung_clk_provider *ctx; + struct clk_hw **hws; + + ctx = samsung_cmu_register_one(np, &top1_cmu_info); + if (!ctx) + return; + hws = ctx->clk_data.hws; + + /* + * Keep top FSYS1 aclk enabled permanently. It's required for CMU register access. + */ + clk_prepare_enable(hws[CLK_ACLK_FSYS1_200]->clk); } CLK_OF_DECLARE(exynos7_clk_top1, "samsung,exynos7-clock-top1",