From patchwork Thu Nov 15 22:40:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10685213 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CE2E109C for ; Thu, 15 Nov 2018 22:43:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B7B62C1DD for ; Thu, 15 Nov 2018 22:43:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FD6D2C200; Thu, 15 Nov 2018 22:43:39 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable 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 32FDB2C244 for ; Thu, 15 Nov 2018 22:43:39 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=ic/G77A6H0vNyU0xFaacGF+u361xflQn/Xb8VDZ96Bs=; b=h5I2M4E7yEfzZe bC0W1Ulq3ZuCTLx8StAk3Zzm9MWcTLThWWnBT1qq/19UuG1C+Jsjuoywf6mJjzJNg4zl/k+neYXxX P+Gw/bNAHsseblwU9X73Ui2xgQ03YQOf4QrrCrZ9szjQ1sCV7QjMMnhuGJdJi1L4Tqm2dq7ePbeA/ R2+OqHZ9YGKkddvCz2NGzzMYNKhcl3bRLr8hsjVJXqnFZKJzAD3iZwKqbMyzlQlWVydjClepXpsCP +QVqpEdEYx8eEhdK7zlfEywjo7VyqGt9xJEIz4ptU19yd8Uil9I2MwiIpeT3PjuaR+Qv8mxB6/tW8 /B/bVndkAj8jSL6mD/aA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNQME-0003GR-PH; Thu, 15 Nov 2018 22:43:30 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNQKL-0001Ov-HK; Thu, 15 Nov 2018 22:41:35 +0000 Received: by mail-wr1-x443.google.com with SMTP id v18-v6so22894620wrt.8; Thu, 15 Nov 2018 14:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JvGZTbDWv4lGUG5na7L9lqIQ6L4IllGuR7w0yW3E6tM=; b=oQxAiuhuTC19CmRlMCwooBbPO2w9P3XOaYYQh7Zz/A+hOni6DBJ/8AyWZlnofgQ2OH DifB9Z17WK1WhwNOreLQyDUZ4sPyQuGIzsDtxG1VUKg/Hbc0R6CO07h44gAmF59Z/65I zize5Nhz0jfXBnReE7dKkxYkGCnXQCr8PNYVDdjipAzsqGeOv5AnuM7IiE0/2+PHd3/C yXpRKQ7EpR+3e9yqmwYfyCff6JEzPtZU++cMnoqkTpWx3tUv0qXSaDEEaFwvtdLIolhr PxeX7WpZT7gbXdyGMW8PN8o3oKlPS3W8y4l1b0xmqkS4Ch3q2V2YEg/idBpWom+8Yhlm v18Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=JvGZTbDWv4lGUG5na7L9lqIQ6L4IllGuR7w0yW3E6tM=; b=B1KXBxMpFR59IjCaHQgi+N58ZnXZsAsscxhgVpepbAc1FQTSZY/OqO5M2odm0VXicF F4AmQXeaw+K4uS/zkHwiZX7kbaS6OZdsF2NziVQKeFRPvNtqJnaBA/6l+FF8QXgEO9n4 TPR8kySNVHXIl7UgPnlg1mDob8ldv1RQOooxjhO/np+MnNoYX4Q+E0NpsL90BJHNmNRv KdjoE236JrBSk7whD0LObyvbeeUkkwo/0DD2qjPiEUEdfRKAUnfTKidUA6RTNbJJPTY3 teIAlkJnOY4re2WpAPjmoNk68l9ilpBLXw0N/lmJW6LxqrZK4Jp+2e8dKG/8jcsKJVOq dW7A== X-Gm-Message-State: AA+aEWbEfrcGkIjtCbmxVNyG0Zell6hjx5gu5AkX9pcmzlKKqvsRMvNL JjrMm2ukl5vFYycp5c6mCPz3dbpl X-Google-Smtp-Source: AFSGD/XNFfL2ZMvD06MV6no/EWJzMZwwmDO+jWIos7isur5U5l3sgy1sEnxUzws07S16dDsNLCPnrQ== X-Received: by 2002:a5d:4c42:: with SMTP id n2-v6mr1698860wrt.298.1542321682553; Thu, 15 Nov 2018 14:41:22 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD717A100B85ACE585A885C51.dip0.t-ipconnect.de. [2003:dc:d717:a100:b85a:ce58:5a88:5c51]) by smtp.googlemail.com with ESMTPSA id x12sm2076388wmc.37.2018.11.15.14.41.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Nov 2018 14:41:21 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, jbrunet@baylibre.com, narmstrong@baylibre.com Subject: [PATCH v2 6/6] clk: meson: meson8b: allow changing the CPU clock tree Date: Thu, 15 Nov 2018 23:40:48 +0100 Message-Id: <20181115224048.13511-7-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115224048.13511-1-martin.blumenstingl@googlemail.com> References: <20181115224048.13511-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181115_144133_593077_3F92EBB7 X-CRM114-Status: GOOD ( 13.06 ) 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: sboyd@kernel.org, Martin Blumenstingl , mturquette@baylibre.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Currently all clocks in the CPU clock tree are marked as read-only (using the corresponding _ro_ clk_ops). This was correct since changing the clock tree could cause the system to lock up. Switch all clocks to their corresponding clk_ops variant which is not read-only to allow changing the CPU clock tree since the bug which locked up the system is now fixed (by switching the CPU clock temporary to run off XTAL while changing the CPU clock tree). Signed-off-by: Martin Blumenstingl Reviewed-by: Jerome Brunet --- drivers/clk/meson/meson8b.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index c06a1a7faa4c..b3bdc7e05441 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -203,7 +203,7 @@ static struct clk_regmap meson8b_sys_pll_dco = { }, .hw.init = &(struct clk_init_data){ .name = "sys_pll_dco", - .ops = &meson_clk_pll_ro_ops, + .ops = &meson_clk_pll_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, }, @@ -218,7 +218,7 @@ static struct clk_regmap meson8b_sys_pll = { }, .hw.init = &(struct clk_init_data){ .name = "sys_pll", - .ops = &clk_regmap_divider_ro_ops, + .ops = &clk_regmap_divider_ops, .parent_names = (const char *[]){ "sys_pll_dco" }, .num_parents = 1, .flags = CLK_SET_RATE_PARENT, @@ -552,7 +552,7 @@ static struct clk_regmap meson8b_cpu_in_sel = { }, .hw.init = &(struct clk_init_data){ .name = "cpu_in_sel", - .ops = &clk_regmap_mux_ro_ops, + .ops = &clk_regmap_mux_ops, .parent_names = (const char *[]){ "xtal", "sys_pll" }, .num_parents = 2, .flags = (CLK_SET_RATE_PARENT | @@ -606,7 +606,7 @@ static struct clk_regmap meson8b_cpu_scale_div = { }, .hw.init = &(struct clk_init_data){ .name = "cpu_scale_div", - .ops = &clk_regmap_divider_ro_ops, + .ops = &clk_regmap_divider_ops, .parent_names = (const char *[]){ "cpu_in_sel" }, .num_parents = 1, .flags = CLK_SET_RATE_PARENT, @@ -623,7 +623,7 @@ static struct clk_regmap meson8b_cpu_scale_out_sel = { }, .hw.init = &(struct clk_init_data){ .name = "cpu_scale_out_sel", - .ops = &clk_regmap_mux_ro_ops, + .ops = &clk_regmap_mux_ops, /* * NOTE: We are skipping the parent with value 0x2 (which is * "cpu_div3") because it results in a duty cycle of 33% which @@ -646,7 +646,7 @@ static struct clk_regmap meson8b_cpu_clk = { }, .hw.init = &(struct clk_init_data){ .name = "cpu_clk", - .ops = &clk_regmap_mux_ro_ops, + .ops = &clk_regmap_mux_ops, .parent_names = (const char *[]){ "xtal", "cpu_scale_out_sel" }, .num_parents = 2,