From patchwork Tue May 7 08:14:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Belisko Marek X-Patchwork-Id: 2532381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 367B63FC5A for ; Tue, 7 May 2013 08:15:41 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZd3g-0006ma-8F; Tue, 07 May 2013 08:15:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZd3d-00065Y-Dd; Tue, 07 May 2013 08:15:33 +0000 Received: from mail-ee0-f53.google.com ([74.125.83.53]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZd3a-00064m-1m for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2013 08:15:30 +0000 Received: by mail-ee0-f53.google.com with SMTP id d49so143826eek.40 for ; Tue, 07 May 2013 01:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=jYRV520wetUy3HixA4K9xHtvVX4g9btbP3Hr894PY30=; b=YgWAw8r9uEaqM2hk0/37ef3oeAk/tVtlZ0N02HTpZU2+O42Zk8R0L44roid53viXJw Wi+XgbjHWHm0Fuglw5/024Pe/Fe5ZjX6fFswqYhSJE/VsifmCdCRmzmdiLRCGnr33L9Z U9+ZaYZjxzAZjsmqc1uZDDUwcydX4LvXHjWQSQx4lDMlv9LgDCBxh/MB4CYJDCDfBDh9 ZgvW1lFYTWrJTxRR6FADutLBROo9IXJ3vN8m5OYpkiBzzf6hgwd0/O89M20XFOkQ7g2J EHKOmYmeBJkvKzj3erUXMYFZDGYvYCvQVjwWeFlXz+Pnra/zv2Zet/lCJMg67h+DffHa /dfQ== X-Received: by 10.14.179.133 with SMTP id h5mr2808372eem.34.1367914507652; Tue, 07 May 2013 01:15:07 -0700 (PDT) Received: from localhost.localdomain (81.89.61.168.vnet.sk. [81.89.61.168]) by mx.google.com with ESMTPSA id bj12sm37697575eeb.8.2013.05.07.01.15.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 01:15:06 -0700 (PDT) From: Marek Belisko To: mturquette@linaro.org Subject: [PATCH 1/2] clk: si5351: Fix msynth_recalc_rate return value when fOUT is 0. Date: Tue, 7 May 2013 10:14:50 +0200 Message-Id: <1367914491-17445-1-git-send-email-marek.belisko@streamunlimited.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130507_041530_203482_5C168FA9 X-CRM114-Status: GOOD ( 13.52 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (marek.belisko[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.53 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Marek Belisko , daniel@zonque.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sebastian.hesselbarth@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When p3 is eual to 0 then result for fOUT is 0. In that case we should return 0 not parent_rate; This issue was causing deadlock in si5351 chip when user set_rate for ms0->clk0 and then set_rate for ms1->clk1 (both ms sourced from plla). After that clk1 was 0 and it wasn't possible to enable it again (try also manually with i2cset commands). Only power cycle helps. Signed-off-by: Marek Belisko Acked-by: Sebastian Hesselbarth --- drivers/clk/clk-si5351.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c index fc215ce..a8fc0f4 100644 --- a/drivers/clk/clk-si5351.c +++ b/drivers/clk/clk-si5351.c @@ -607,7 +607,7 @@ static unsigned long si5351_msynth_recalc_rate(struct clk_hw *hw, si5351_read_parameters(hwdata->drvdata, reg, &hwdata->params); if (hwdata->params.p3 == 0) - return parent_rate; + return 0; /* * multisync0-5: fOUT = (128 * P3 * fIN) / (P1*P3 + P2 + 512*P3)