From patchwork Fri Apr 3 18:13:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 6159501 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 755EB9F350 for ; Fri, 3 Apr 2015 18:14:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 942A1203B0 for ; Fri, 3 Apr 2015 18:14:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6CC3202F0 for ; Fri, 3 Apr 2015 18:14:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ye66Y-0004tN-Hr; Fri, 03 Apr 2015 18:14:06 +0000 Received: from mail-ig0-x22d.google.com ([2607:f8b0:4001:c05::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ye66S-0004gJ-HF for linux-rockchip@lists.infradead.org; Fri, 03 Apr 2015 18:14:01 +0000 Received: by ignm3 with SMTP id m3so68790386ign.0 for ; Fri, 03 Apr 2015 11:13:38 -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; bh=sgH/dr3Oxrhm11AiNjS6qCQeXLmwRUhx5rx16G+W+Ck=; b=fH+wTm0K3BQlgaaq3mB8ab0RZp/RFsv/i4C2mCzpKq70rcnJNklGkACJQL7YZnNigU 450EobMfS+vfV010fxI5Dc4Otq1jGI+l0S24yw7MAypIAZaW+LZgcR8VToj1A1XroCOg 7Luh3bA345kGvKFrGhwodNhO+9/8BIhzyoFdA= 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; bh=sgH/dr3Oxrhm11AiNjS6qCQeXLmwRUhx5rx16G+W+Ck=; b=R1iSxdWHyfvm5Pjp5CTLf/Jb+0vYl+gSfErMISCUkSarBcrQakrknNZWNw1+9IP7mU u6qHz6bV9nLV/npn1sZVGxZ1YMOLgjYXcW0VIcW+SZ0i/gZBsHlhNbSzQ6gBAoobx9KX /RQCKTeAumEHwVzkOfkPAXhGEwa9rPNlElz+sh7nV2fQbBAkA8E+D9ZakQhHMP1drDvO DhqJTxIP7t2ZHw+ORawOX46aw+WKlkxPB+vT3KDBiO9U8v/Ojk3j7yswjhz5zXCAFLrl bJiApf8R5TCpyXbZECScZkVojNICTgOBCQLUxZL4Lgbuoewb4ypWdFW2KtnDwBfneH2K tUVA== X-Gm-Message-State: ALoCoQl+QvRKRvZt7+74MGXG1qWDclbC4Io9ZSZYsBac/SONo5QtXbbZlJS6lpcCU/qqIyIU7nDT X-Received: by 10.50.28.8 with SMTP id x8mr6479711igg.19.1428084818099; Fri, 03 Apr 2015 11:13:38 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id 37sm2321629ioj.0.2015.04.03.11.13.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Apr 2015 11:13:37 -0700 (PDT) From: Doug Anderson To: Jaehoon Chung , Seungwon Jeon , Ulf Hansson Subject: [PATCH 1/3] mmc: dw_mmc: Increase cmd11 timeout to 500ms Date: Fri, 3 Apr 2015 11:13:05 -0700 Message-Id: <1428084787-8710-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150403_111400_664004_CC1C43EF X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: Addy Ke , Heiko Stuebner , Andrew Bresticker , linux-mmc@vger.kernel.org, Doug Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Alim Akhtar , Sonny Rao , javier.martinez@collabora.co.uk, Alexandru Stan X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Designware databook claims that cmd11 should be finished in 2ms, but my testing showed that not to be the case in some situations. I've seen cmd11 timeouts of up to 130ms (!) during reboot tests. Let's bump the timeout way up so that we're absolutely sure. CMD11 is only sent during card insertion, so this extra timeout shouldn't be terrible. Fixes: 5c935165da79 ("mmc: dw_mmc: Add a timeout for sending CMD11") Signed-off-by: Doug Anderson --- drivers/mmc/host/dw_mmc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 3883fe6..339a929 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1023,11 +1023,13 @@ static void __dw_mci_start_request(struct dw_mci *host, if (cmd->opcode == SD_SWITCH_VOLTAGE) { /* - * Databook says to fail after 2ms w/ no response; give an - * extra jiffy just in case we're about to roll over. + * Databook says to fail after 2ms w/ no response, but evidence + * shows that sometimes the cmd11 interrupt takes over 130ms. + * We'll set to 500ms, plus an extra jiffy just in case jiffies + * is just about to roll over. */ mod_timer(&host->cmd11_timer, - jiffies + msecs_to_jiffies(2) + 1); + jiffies + msecs_to_jiffies(500) + 1); } if (mrq->stop)