From patchwork Tue Jun 21 13:12:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 70558 Delivered-To: patches@linaro.org Received: by 10.140.28.4 with SMTP id 4csp2011228qgy; Tue, 21 Jun 2016 06:13:18 -0700 (PDT) X-Received: by 10.25.38.206 with SMTP id m197mr5136894lfm.201.1466514798565; Tue, 21 Jun 2016 06:13:18 -0700 (PDT) Return-Path: Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com. [2a00:1450:4010:c07::22c]) by mx.google.com with ESMTPS id e186si25413889lfe.148.2016.06.21.06.13.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jun 2016 06:13:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22c as permitted sender) client-ip=2a00:1450:4010:c07::22c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22c as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22c.google.com with SMTP id l188so23029678lfe.2 for ; Tue, 21 Jun 2016 06:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ta1M+iZLkCj+EosHeNDFjISciHtbepbWeh4Bi3jmUzQ=; b=Nl1vB27+CAbYmlnH3BmRCqRCaGxzfXD67QkqI1Ge/hYg5lAaGowLZaKUP4WUgcgmMt VcdDzvdwJaxK+euEgZyxWNHtBzSOHWFDTvqroXcL6ftdHxcacTGj+tOydJJWSqQbrKee pzZzHxFzUloVN442OZ9OLrpa6qyfK87MNhKrA= 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=ta1M+iZLkCj+EosHeNDFjISciHtbepbWeh4Bi3jmUzQ=; b=Pp//zXvbEjxlp7t0JZ8T+mGxgfOrJpW0jOcIKYbeDtO4xkLStjm08eGZ6VFg9P9YJc sbmAT3rGBu5cdD37cty+a5JrIiAwmUiRFMM7lYYa7h2+F94Ov6qKQbxWBsWcHcmlzbhz 3nxHyqraBa7/bIEq/LyvPZFOMFAB3KlP05w5mltwVdTyyC79OxDzFt0KI28471zihQno LoPqFDyAcMAhSyrs5p6sHug8cVXqj9qViRfrGyik+ADTTiw/AdHV02l5le8VS5RlVTm0 6GgSuc+pE7ESA6qqTx3WO/msOuAIAAgoBDdl8DI9NnM6C3ZLV5cofkdrFyjOGMBJz8VF nLXg== X-Gm-Message-State: ALyK8tIjWio9NClc9zPr8J0KNzMIph8l28ggD/pGlgVj2iaU41bPof24DZSQnhQcZ1oZcE2+YGM= X-Received: by 10.25.32.10 with SMTP id g10mr2446499lfg.188.1466514797933; Tue, 21 Jun 2016 06:13:17 -0700 (PDT) Return-Path: Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id ze5sm4978244lbb.8.2016.06.21.06.13.15 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Jun 2016 06:13:16 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Kuninori Morimoto , Geert Uytterhoeven , Nguyen Viet Dung , Magnus Damm , Simon Horman , Baolin Wang Subject: [PATCH 5/5] mmc: sh_mmcif: Use a 10s timeout in the error recovery path Date: Tue, 21 Jun 2016 15:12:50 +0200 Message-Id: <1466514770-9462-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466514770-9462-1-git-send-email-ulf.hansson@linaro.org> References: <1466514770-9462-1-git-send-email-ulf.hansson@linaro.org> The current value means an mdelay(1) may execute up to 10000000 times, which translates to around ~2.8 hours. This is probably not what the orignal author had in mind. Let's instead use 10s, which is the same value sh_mmcif is using for other timeouts. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sh_mmcif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index bab971b..9007784 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -574,7 +574,7 @@ static int sh_mmcif_error_manage(struct sh_mmcif_host *host) if (state1 & STS1_CMDSEQ) { sh_mmcif_bitset(host, MMCIF_CE_CMD_CTRL, CMD_CTRL_BREAK); sh_mmcif_bitset(host, MMCIF_CE_CMD_CTRL, ~CMD_CTRL_BREAK); - for (timeout = 10000000; timeout; timeout--) { + for (timeout = 10000; timeout; timeout--) { if (!(sh_mmcif_readl(host->addr, MMCIF_CE_HOST_STS1) & STS1_CMDSEQ)) break;