From patchwork Sun Mar 24 16:43:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10867529 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 9A16A1575 for ; Sun, 24 Mar 2019 16:43:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82E072848D for ; Sun, 24 Mar 2019 16:43:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76BC329150; Sun, 24 Mar 2019 16:43:53 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 2E65F2848D for ; Sun, 24 Mar 2019 16:43:53 +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: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=NKdTLxapv/EAO1O6i2M4fMcy5QTzWpHweYXDXDf0N1A=; b=kMnzaCG2JMxg4H NS8ih8F30ahowtWozqps8mPUpHLzR7EwEb4Yec/rUs8SmgE5HMTmbOiC1+BA1ZhY6IzELzagaIJu/ mtZsAawq8QrTMTyYGo5gkseA8vjfs0TEJ86sOIybiWq20XinpnrbR0cMbAlfRDzAhCqYTOXHiZXLV 0Gtc27EjxhtaZwyetRIAEOu95rR63h/rUIrz7rsHbreItK1TN/mOWqWIsVzS+nbFg5Mfw8EnRvdWF VCm4vklUO17+fZntrl1P8WxkFzSTZ1IG8tWFIqdC1KuZXYxlTO7eGuRXpaCbJXqjRf9Q9CMpu9dMC mODoRAoz1V9caaoClmQw==; 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 1h86Du-0007Zw-FX; Sun, 24 Mar 2019 16:43:50 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h86Dn-0007Sf-M5; Sun, 24 Mar 2019 16:43:47 +0000 Received: by mail-wr1-x444.google.com with SMTP id g3so3946425wrx.9; Sun, 24 Mar 2019 09:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=w2r38gJpfFe4P7HtoACDMN8D+Ed6JJt9Nux7ChLwiuk=; b=tt9+WuWlBUcM3VoHmNt/kZywyCPpRq7NpHMDQI2bYrXvGbUwk4Jdg/p4HU6mWcnQb8 BIl099tfJO592uJMq/LbjsAy7m//DnLgHRFRWsQWMLuX8v56fXaXzVnRZqulYl7H00MX nzBRRwwYXNhUSvhVBOempMLaSSThHwum8FhF35XUWAQ6gjocFAA00Olto/DLWxP0ZPJI /2S/quGgmUSe9m7wC0dFCMEzfii9u+kebjs+FBwqfhdCC7raXKAiIkhrn5TfcZxs2mWT Tqk3AZoZ6FFd4Wrc/BtuP8K+gSPNkhIIJYZW7s7YS+eI21NBHnWJAER9JqSV6LXB6lEX hmEw== 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=w2r38gJpfFe4P7HtoACDMN8D+Ed6JJt9Nux7ChLwiuk=; b=nQqo/85DCc6v41ip0TV/YisebphZ4CX9q8FsGeJAFp9roruu5Gwan5vxNO/rW4dMQX ElVtNv6OdjDM7PY8r3rbTHAZFHrLWuvwZHDRlkZdJJ05qRnMwEo2H3RZbZzaEfaMDsxj CRWcX537pvZVoVKW76/Utkt5+mC5CmO3Am8mFrV4MdXd71gxgEWbrxgpLDWYU3fy8q3p oGa8D2t8nR24e90JqbGuPjzDdzq+NHkJvyX+fPAtnX8V1F6v0renVmR9IHWl6rOUTWwT is02cQ8yJrK4BHsUDprkzGSoccHQza6gBazAPzL3/shnXHlFZBKpKJ5cOzp3I3n6pQoG FRlQ== X-Gm-Message-State: APjAAAUKsI01bs7joLzI1h249RTcQTx2HSOoDQVJQpj1iHoCRvC+yePs HGxDooKLjKGxG/uXNeJq6AI= X-Google-Smtp-Source: APXvYqxi7MrEGPvI0xo3HHvxXE+5nclfglXNSMkgiW0axjGrWnZa8Vm3ska1+I89HKUOFX6JXH12bA== X-Received: by 2002:adf:fbd2:: with SMTP id d18mr12858946wrs.55.1553445817321; Sun, 24 Mar 2019 09:43:37 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD7399900428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:dc:d739:9900:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id v16sm19042461wru.76.2019.03.24.09.43.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 09:43:36 -0700 (PDT) From: Martin Blumenstingl To: narmstrong@baylibre.com, jbrunet@baylibre.com, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH 0/1] clk: meson: fix PLL rate rounding Date: Sun, 24 Mar 2019 17:43:26 +0100 Message-Id: <20190324164327.22590-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190324_094343_732810_A97D2E4E X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. 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 Hi Jerome, can you please look at this small fix? I discovered that my Odroid-C1 wasn't booting anymore. My other Meson8m2 board was using fine. While investigating this I found that it hangs while setting the sys_pll_dco rate. This is important because unlike Odroid-C1 my Meson8m2 board has a fixed regulator (and thus always runs at a fixed CPU speed). It always hanged while trying to set a CPU frequency of 312MHz. This can be achieved with: 24MHz (xtal) * 52 (m) / 1 (n) / 4 (sys_pll) However, my added debug logging showed that it was trying to set an M value of 51, resulting in an output frequency of 306MHz. My debug logs showed that meson_clk_get_pll_settings() considers 1248MHz (which is the rate requested for sys_pll_dco for a CPU frequency of 312MHz) "worse" than 1224MHz. I'm not sure exactly why the bug caused the board to hang, but my patch fixes it. Please apply this to v5.1-rc as I believe the Odroid-C1 on kernelci also suffers from this issue. Martin Blumenstingl (1): clk: meson: pll: fix rounding and setting a rate that matches precisely drivers/clk/meson/clk-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)