Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2398687imu; Thu, 24 Jan 2019 12:05:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN5nFYtSPLHG80b5oTTs9mTJoXunS99gFtd/xTkHvNg4yfk8uINpe7Ia3uLZJi+pKNgArsKQ X-Received: by 2002:a17:902:1745:: with SMTP id i63mr7719301pli.145.1548360328476; Thu, 24 Jan 2019 12:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548360328; cv=none; d=google.com; s=arc-20160816; b=utLGybuN8P+55aUxpzZuZY/I0BPu04bRqQLhvQvVQ2Ryxwzs70xP/n3uGhIW95xuKD 9svuBARz3hNsd128l0KiLuNnpS5usWC7G7fBtZKBFZZTBdg+p/+v5MOuC0DblyWbzJNe L4BinJe7FvdyAsaZjNLJ01AadWHFjZv49222cQyjkdnn3HhEGphJF/AcWRAyJfqaUaUy 8vBK5nZRC1W8hxqGykfU+SYej/5H88pszvj4ADfVuLXausiKzQ5dJ+uLOTBl61qrH+lm FaiqxP5RnOAkmJ10b5bdd+VwQwUHLL8N6PO9CtIW1VPPzuIWYQBjAYnQFudj4x5teiZ7 HL9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ydovYP1h5Os+VZYIm1w31yznQ1Zn/juAapillVJapNI=; b=L/IAxcClrZrfLeJRnncsXF19/VfL677aCWTMQUJptXB9KgImOu8gpJFkKNtyvr3LCH Lj//52agQgOblo7SlZ70veroqMvH0EEaiMc71rza0zJ4yB23qR4VMS1uAHvFY9fAJu6e aJMSmMZKp5v7Q8eZJhlyNbxV1OsvtyLPD4AXpDLfgteShnb8GxeuyqJlp95d+Zdg9e1g 1fSCOr297wHc+6t6hZ7iXoVnk5bqw3I8k5Km1dQaNg4Z430d2Dl9xH+RvqkQGAZk8mw+ +f7VjbHsyd3jgY4Tbw6HPTFZsxuO2HbvdGe7syNE/+I5hKr+ahd01yNObFx9VaOVC+wa f3ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JqzB9Zir; 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 a32si23745008pla.168.2019.01.24.12.05.12; Thu, 24 Jan 2019 12:05:28 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=JqzB9Zir; 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 S1730937AbfAXUDt (ORCPT + 99 others); Thu, 24 Jan 2019 15:03:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:59974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731764AbfAXTcF (ORCPT ); Thu, 24 Jan 2019 14:32:05 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 77FEF218E2; Thu, 24 Jan 2019 19:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548358324; bh=qHO8VbVtvlq6+W9xEsqXp6zo7M0aSbGXJ01TUiK71Gw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JqzB9ZirNDQlQOPj9vzo1nw9fiSUh4zOzerem/IgtmUllwvrffX/ziLgI6ZRuqMQd JcyCFORkxIU9Xh4Hf7Z+lReZqIG65q+nQPFUEU0CGCwTZ/zvZD6IiwVqcrBiB5L3Vp 7I9U0fLK1AIuLkWsOfZssbbwsqICC9q2gbMpUvmg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lucas Stach , Dong Aisheng , Stephen Boyd , Sasha Levin Subject: [PATCH 4.14 31/63] clk: imx6q: reset exclusive gates on init Date: Thu, 24 Jan 2019 20:20:20 +0100 Message-Id: <20190124190158.660296633@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190124190155.176570028@linuxfoundation.org> References: <20190124190155.176570028@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit f7542d817733f461258fd3a47d77da35b2d9fc81 ] The exclusive gates may be set up in the wrong way by software running before the clock driver comes up. In that case the exclusive setup is locked in its initial state, as the complementary function can't be activated without disabling the initial setup first. To avoid this lock situation, reset the exclusive gates to the off state and allow the kernel to provide the proper setup. Signed-off-by: Lucas Stach Reviewed-by: Dong Aisheng Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/imx/clk-imx6q.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c index 8d518ad5dc13..8eb93eb2f857 100644 --- a/drivers/clk/imx/clk-imx6q.c +++ b/drivers/clk/imx/clk-imx6q.c @@ -515,8 +515,12 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) * lvds1_gate and lvds2_gate are pseudo-gates. Both can be * independently configured as clock inputs or outputs. We treat * the "output_enable" bit as a gate, even though it's really just - * enabling clock output. + * enabling clock output. Initially the gate bits are cleared, as + * otherwise the exclusive configuration gets locked in the setup done + * by software running before the clock driver, with no way to change + * it. */ + writel(readl(base + 0x160) & ~0x3c00, base + 0x160); clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate_exclusive("lvds1_gate", "lvds1_sel", base + 0x160, 10, BIT(12)); clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate_exclusive("lvds2_gate", "lvds2_sel", base + 0x160, 11, BIT(13)); -- 2.19.1