From: akpm@linux-foundation.org Subject: [patch 109/160] mmc: at91_mci: fix timeout errors Date: Fri, 05 Mar 2010 13:43:39 -0800 Message-ID: <201003052143.o25LhdVZ029827@imap1.linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:52971 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755666Ab0CEVn6 (ORCPT ); Fri, 5 Mar 2010 16:43:58 -0500 Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: torvalds@linux-foundation.org Cc: akpm@linux-foundation.org, wolfgang.mues@auerswald.de, avictor.za@gmail.com, linux-mmc@vger.kernel.org, nicolas.ferre@atmel.com From: Wolfgang Muees Fix two timeout errors, one for slow SDHC cards and one for slow users while inserting SD cards. Signed-off-by: Wolfgang Muees Signed-off-by: Nicolas Ferre Cc: Andrew Victor Cc: Signed-off-by: Andrew Morton --- drivers/mmc/host/at91_mci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff -puN drivers/mmc/host/at91_mci.c~mmc-at91_mci-fix-timeout-errors drivers/mmc/host/at91_mci.c --- a/drivers/mmc/host/at91_mci.c~mmc-at91_mci-fix-timeout-errors +++ a/drivers/mmc/host/at91_mci.c @@ -756,7 +756,8 @@ static void at91_mci_request(struct mmc_ host->request = mrq; host->flags = 0; - mod_timer(&host->timer, jiffies + HZ); + /* more than 1s timeout needed with slow SD cards */ + mod_timer(&host->timer, jiffies + msecs_to_jiffies(2000)); at91_mci_process_next(host); } @@ -944,7 +945,8 @@ static irqreturn_t at91_mmc_det_irq(int pr_debug("****** Resetting SD-card bus width ******\n"); at91_mci_write(host, AT91_MCI_SDCR, at91_mci_read(host, AT91_MCI_SDCR) & ~AT91_MCI_SDCBUS); } - mmc_detect_change(host->mmc, msecs_to_jiffies(100)); + /* 0.5s needed because of early card detect switch firing */ + mmc_detect_change(host->mmc, msecs_to_jiffies(500)); } return IRQ_HANDLED; } _