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: 9201045 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 F3F41607D3 for ; Mon, 27 Jun 2016 17:42:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8BEB28597 for ; Mon, 27 Jun 2016 17:42:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC9DB285AB; Mon, 27 Jun 2016 17:42:19 +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 6B5C728597 for ; Mon, 27 Jun 2016 17:42:19 +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 1bHaWh-0005a0-H6; Mon, 27 Jun 2016 17:40:51 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHaW9-00049p-FW for linux-arm-kernel@lists.infradead.org; Mon, 27 Jun 2016 17:40:18 +0000 Received: by mail-pa0-x230.google.com with SMTP id b13so61044083pat.0 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=QdPqY9p/kT0W7i0UERLz4EJZ2kija0iyXZ5k0ovRL9rxdLGNWy+Uvpi1N50WkCtUbp tatsTfewx6BNeALzzN/pWlO+p/K0ElRvFBLvM4snjWmEZDvB3soYO+8mPZQsPaJ0+3t4 vS3I+ZvCsE6H4JQC8pklGba/oe+nedKAw9010eyCKXXqph97JvK6g92BS5DwNaM92ND4 4mnAstO3NFmme/JORmrVMhcl23pn1PI1KRUFhaKIdFB/tIQ7Dc9reRkz+YRQOrzvZhzw cSrXSRwuAzvCtdatqYebKLd4jpO84lBgJr9pRDqnOoB+aSvAvWDzNbRgDiEKVSPrCB4B T8sQ== X-Gm-Message-State: ALyK8tIlKQ5md8rgVtwEIjUQG0HEYaofSKcHbc+DIDqZpYeK5RgQb5X2bHx+eFw6bZT8s3+F 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_792719_95999CCE X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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);