From patchwork Wed Nov 14 22:57:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10683339 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 4C5E914D6 for ; Wed, 14 Nov 2018 22:58:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D8EB2BD8A for ; Wed, 14 Nov 2018 22:58:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 316962BD98; Wed, 14 Nov 2018 22:58:55 +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 CA3FC2BD8A for ; Wed, 14 Nov 2018 22:58:54 +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=ePXqlS7MQ7oR8qgkmQaQCPXu4ojLCCdNrTSeCWuLPHg=; b=qPhyKN+7HL27qj BtYFoWWylqxJOm2c1ZK1oePfzzuaTlvdTNt/03qh53u9L1UmWY5KZf9DJ7iTxmaiJj7OJMz2qikb7 LgEPhIBtvjro33bisLhlJWXQbzIJrGhGppIcEzXPn4H53Lv/QnNdRef6Xs4Fwlp/u2tMgu2U0XC4h xCHaDQ7rXrRirHJB7WcwjuZOSycDB00jzTb3JS9naegZFVMhG4GW3MxHvppPzYXBXT7kPQjt4ibCO TMwnRmevByv2+aecYmda56YPeGL+L21gtLrRC3ypu0C/84xyVzPUDPpuhBcQ5WY+5CvpXVAceqqWD 9cwH2inq/cXN1+IMM4Nw==; 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 1gN47W-0000dz-7C; Wed, 14 Nov 2018 22:58:50 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN46m-00088W-NU; Wed, 14 Nov 2018 22:58:06 +0000 Received: by mail-wm1-x344.google.com with SMTP id u13-v6so16262505wmc.4; Wed, 14 Nov 2018 14:58:00 -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=CVZ5uvw2/86wt6Serx6lIpgnovwRR9rOzr4LZhzakUs=; b=q838D237yNSrJ16Jo5GXvOyCzWY0h6dPjzT8TAAOqnENilInt7Rgzx8PbCRwdBCFNZ 1WfIhM6RVjUQsMcym/TvPDUr+Lczqhbx+aiCgkxLCwkflW/0dhRtUqz+ahhkiaVEOpX2 FL9GBa56vajhsvQADxxeyNMgMbrOD4vqDz8LqmK1P4rVeceL/O4koJBqx/DK6ZMKAYYM 2PgFT3sS4tprwq11Fl0bVm/uaPKGypKQYMLhcWEPVN/arL1kGpeK3Vj9w8+CazOdMQe+ r0F0WiPVJBBlRtlxrPdjqorQ4CIDSQOiY2IQR0hXcI5li456SVHqf1/FlPJIvclY9r/K 3F+A== 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=CVZ5uvw2/86wt6Serx6lIpgnovwRR9rOzr4LZhzakUs=; b=SUuXaAxDy5M73+z1JqDmUkjjHJUYt1DNkqEluHVPHHqK2LVyXocuZDB9oK6MZOBvJz W91zIvhetPkxD6axQAKZrzAQPpMRNpVnZXvIfV9yMKGT19uHqaIo/l2iKu5DVOjbrg1S xkX7jZMyvL6JEt5Vw51FgbRgx0TMw/T7J2EgebIe8fhSaBqwwjbyAcOP14plJ3pFTK+u MLciK1y4h7ySFVAFX54pWWO5VMbnn3yOfzgQ+7i8GzfflMaKqdDnfLAQmjHf4mEaOwTK Y41AmTr4zqjAAG1rPR1632jx2JxiVw7Yn54nVTvMDPkL6Y9SQvgpW1muLwOj95bZaEb6 EKOw== X-Gm-Message-State: AGRZ1gLpUuNk9OI6bV+tAQvS6xHMhmtPuFC1HjcdWEk6hRxTjl4QkrrQ s0gJnYbbImu1tzVyr84W/n27rziO X-Google-Smtp-Source: AJdET5fO7/YSWljnTaW+mruQlXqAqxjkoELr3BtA3Q58whJchNx5/o6Vn+yRcvQ/iKviEPBiqVgqlQ== X-Received: by 2002:a1c:ac85:: with SMTP id v127mr3350283wme.62.1542236278624; Wed, 14 Nov 2018 14:57:58 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD717A100301AB549B11D5ACB.dip0.t-ipconnect.de. [2003:dc:d717:a100:301a:b549:b11d:5acb]) by smtp.googlemail.com with ESMTPSA id n7-v6sm18987784wrt.60.2018.11.14.14.57.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 14:57:57 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, jbrunet@baylibre.com, narmstrong@baylibre.com Subject: [RFC v1 7/7] clk: meson: meson8b: allow changing the CPU clock tree Date: Wed, 14 Nov 2018 23:57:25 +0100 Message-Id: <20181114225725.2821-8-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181114225725.2821-1-martin.blumenstingl@googlemail.com> References: <20181114225725.2821-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-20181114_145804_772246_454017D1 X-CRM114-Status: GOOD ( 12.41 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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,