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: 9201039 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 DAD86607D3 for ; Mon, 27 Jun 2016 17:41:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF9A428597 for ; Mon, 27 Jun 2016 17:41:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4296285AB; Mon, 27 Jun 2016 17:41:13 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53BCA28597 for ; Mon, 27 Jun 2016 17:41:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbcF0RkW (ORCPT ); Mon, 27 Jun 2016 13:40:22 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35725 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751932AbcF0Rj5 (ORCPT ); Mon, 27 Jun 2016 13:39:57 -0400 Received: by mail-pa0-f44.google.com with SMTP id hl6so60933057pac.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=Ak1A2E1aP0EJFXlWmRw53a+ajTB/iazXlx3qiobuvPoxKQkrFQZbpv4hftpoSaLIrm d/Ov4wvhpxNew7RbqxSSPMbQoVcmeKC2qvOzIvD9gpxyfbQoTfDPf+iO17ZXCUKOyrcW T3/0azh5OEbU3FC0pjzgmHSO91vo4LHRqpk3Eu8tNm+k1XLwu6dcKlIZ+TnLtv8RY8fO HJlHAE1eMpL2b5+H/e0iIaYHkQ04NNmHwUfMcOfO1JVqgqFeR9RxRwdOg8VE6P2dqblD bzF2MNMORyNt7KA3L+eZFKAvVgWiJku31zZANzDLWfOodo0uE7SuN2IovY6ML9JvEDrH q54Q== X-Gm-Message-State: ALyK8tLzojhJVrSq6fu6lqRCrSy4nPxJP8SODbJo6Rzk1GRT5YN2H7ozscNQm9DiYNMaCXJf 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 Cc: shawn.lin@rock-chips.com, linux-rockchip@lists.infradead.org, linux-mmc@vger.kernel.org, briannorris@chromium.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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);