From patchwork Mon Jun 27 17:39:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 9201037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9BC7B607D3 for ; Mon, 27 Jun 2016 17:41:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F33C28597 for ; Mon, 27 Jun 2016 17:41:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83C9F285AB; Mon, 27 Jun 2016 17:41:00 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 06E4828597 for ; Mon, 27 Jun 2016 17:41:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHaWp-0005gW-KL; Mon, 27 Jun 2016 17:40:59 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHaW9-00049o-Ff for linux-rockchip@lists.infradead.org; Mon, 27 Jun 2016 17:40:19 +0000 Received: by mail-pa0-x22b.google.com with SMTP id hl6so60933055pac.2 for ; Mon, 27 Jun 2016 10:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kJPau6GvnWtPBwOeGGhxR60c8hYy8Qyjhri9tI8MIrk=; b=IqYWM6tcdXqwTV0uuymwKPOEjHAUDb3S7BlwUUlUCpHAhbLd7b3ft9EhktE/4xlkEr j/9HUwksss36aL9nunyNUsS3D+M+dcuFIj+WzN4xVCEC3MQs8et/EcUUvKX+CAWijSh5 e75UcasNskjd5AyCNkdM5y7ZnuCOl1swNW66E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kJPau6GvnWtPBwOeGGhxR60c8hYy8Qyjhri9tI8MIrk=; b=B2ssOobjT3YAXfN8kD9HFP3KEBb/AlZJO0wKe+XvGFc94/0AeZelog040+uJr6+8h6 Gj/DlumGmTyxQLvu2IDkpg8pl6C2KpEcbZnRP8DuI845BCNs++WU3oal9oz2K2Stnp1U 912aO6BWWQZ5micuuwtQRO2xcIqnEhPLhHcB+X7aYPiCh6h365sYAdpQPbXm++SK2FGN gdwVyaV6r07uwCKxdfWxKp91UNfPhjX4DuS1tScSKwqifqq0Cs7h0CiuVB2eZHCePjpW M9YZzsrmKLx1CFQfpPp2FjNgzOz7ApsTwgNvqM5IX1rtcxG6yFjVM4SThQDhE6A3IOeP ZSbw== X-Gm-Message-State: ALyK8tLNk2HFhCIUB7GXT2SA+RusZE66TFrLroxDHLW1/eMFbDKs5tt+DXAtkfcsW25UfUUf X-Received: by 10.67.15.72 with SMTP id fm8mr36237368pad.50.1467049196701; Mon, 27 Jun 2016 10:39:56 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id z29sm1120552pff.0.2016.06.27.10.39.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Jun 2016 10:39:56 -0700 (PDT) From: Douglas Anderson To: Heiko Stuebner , ulf.hansson@linaro.org, kishon@ti.com Subject: [PATCH 3/3] phy: rockchip-emmc: Wait even longer for the DLL to lock Date: Mon, 27 Jun 2016 10:39:27 -0700 Message-Id: <1467049167-14628-4-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1467049167-14628-1-git-send-email-dianders@chromium.org> References: <1467049167-14628-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160627_104017_791310_2F053EC6 X-CRM114-Status: GOOD ( 12.03 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shawn.lin@rock-chips.com, briannorris@chromium.org, linux-mmc@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Two times out of 2000 reboots I ran into the error message "rockchip_emmc_phy_power: dllrdy timeout". Presumably there is some corner case where the DLL just takes a little longer to timeout. Let's give it even more time to handle these corner cases. Signed-off-by: Douglas Anderson Acked-by: Kishon Vijay Abraham I --- drivers/phy/phy-rockchip-emmc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/phy/phy-rockchip-emmc.c b/drivers/phy/phy-rockchip-emmc.c index a2aa6aca7dec..fd57345ffed2 100644 --- a/drivers/phy/phy-rockchip-emmc.c +++ b/drivers/phy/phy-rockchip-emmc.c @@ -206,8 +206,18 @@ static int rockchip_emmc_phy_power(struct phy *phy, bool on_off) * per the math: 10.2 us * (50000000 Hz / 100000 Hz) => 5.1 ms * Hopefully we won't be running at 100 kHz, but we should still make * sure we wait long enough. + * + * NOTE: There appear to be corner cases where the DLL seems to take + * extra long to lock for reasons that aren't understood. In some + * extreme cases we've seen it take up to over 10ms (!). We'll be + * generous and give it 50ms. We still busy wait here because: + * - In most cases it should be super fast. + * - This is not called lots during normal operation so it shouldn't + * be a power or performance problem to busy wait. We expect it + * only at boot / resume. In both cases, eMMC is probably on the + * critical path so busy waiting a little extra time should be OK. */ - timeout = jiffies + msecs_to_jiffies(10); + timeout = jiffies + msecs_to_jiffies(50); do { udelay(1);