From patchwork Thu May 31 10:37:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 137351 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp6421858lji; Thu, 31 May 2018 03:38:00 -0700 (PDT) X-Received: by 2002:a2e:5591:: with SMTP id g17-v6mr5023787lje.4.1527763080823; Thu, 31 May 2018 03:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527763080; cv=none; d=google.com; s=arc-20160816; b=bFWGYVPVm1l7865vedifETJUv0yFb3xzXRncl2mJKkiCmxH7QOZc0PcEe+rHpwA0sH +yG62WuumjJBeNG95aITdyJZloQbmXHXoGtDn9dQG94nOXhywpaefU6eRM05e4tmB3g1 KCOzmY7Fm8QID3GucpUm7dOH1kzD+PuhkVF2LwD+yDFjlNr8jJY660Fc3g1qp8/fiyHT zxKtr5DiiKCxrNu3ka2Sox269fU1WUjcQ1TKz/h3HGg6G8ukVAo7YmP9hp18j73xgyjf XWeUUmH8ftyge6494kcb/YYTSDRosfxh+8jZ/3TFao4e+YPUaxQMc0pJb54rcMdrfcGm zX+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=lWxWCdTQ1sxz6NqJixUJ3ANeyk3R1SpRzYZYaj6DZ8I=; b=lPOx+5EXY9h2WF5i2RaTar81M9Vb4v+yW6eJsdIbJnpqDgLTdBQJF5qDJk4VXhPG0u 8OU/tunb9yIs0x57OyfpTfftoYGTGO6pHq1NsXWvDh9DAq6mpICCIaO9Tl0kh79gWfBA UaU9Rp+KhuZtZJ2qZZBDvscWRt/ZnssIkqKRakfxdH3lsryrvD3DEnPHc7qhFSpEa7oF qQxr0lxwtXNuS9FhjvfyWFLXAiejAMA3rhIzu3vB7JLBp4y3eSSPG9KvwR4fbKAFqiCq MK9eviZhC2w7KEOE8qFuWdPWCoeUZONFn5WAp3YYM+lsxUip9I6xWMhGdQ8mT31Be41u b7Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NruM0cO1; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g11-v6sor8079130lfg.72.2018.05.31.03.38.00 for (Google Transport Security); Thu, 31 May 2018 03:38:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NruM0cO1; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=lWxWCdTQ1sxz6NqJixUJ3ANeyk3R1SpRzYZYaj6DZ8I=; b=NruM0cO1aduBmTZSVMLhb4lu230xkcL0g4K80E74hiC1yACbpfhHpLpBlH3bjNv5E5 9M2BHEiJ74UZdcyjWyhbqLUFZOCU48qt3Pad+4GREurarEP6ow0bVrcOz7hOOX/c8aGZ furzgzY6Xhd2uU0LIsJNUMQFAE+JGoByjJqVA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lWxWCdTQ1sxz6NqJixUJ3ANeyk3R1SpRzYZYaj6DZ8I=; b=KErFZIhXlfNFgcc5U8EtX9Xf00v2LhnyxSMnDySXr4gmVcuBWXU8TcAG5rMVod1SrQ 1G9baRW9VxezR3WDKBs/u/mybu9FMRhqX7jaVLNzZQZGp35I26sG2rilyVJSXFMtpiOS LOTII+ieXLoUkixkuvE0ythJKfm/5Ihu6tU0J1QjgreKcP1qZuovgnBz2eCwMI3j2hK1 a+HoC+8fY/X69wtXsnDQpiZ/Q6i0NorQ8AwtaNCu32cMmaXEfacLvl6HvmRKMBhfCKIN EO66cclu9l8Xqvf6TVPzm4Na+8VpLM/WHHl3eMoDFWXCnjbWrcJq5BL0FOZwx7ztfmY1 +JiQ== X-Gm-Message-State: ALKqPwdE1EGUyw+d+BNNK4eNuKLrH2fe7xTs0WDxGySKj9riaHNim9Kb sUQnXu35YRhfBF631s/+CJmzILo4 X-Google-Smtp-Source: ADUXVKL8g+6WL4y6xqIXi39DZl5OSqREFz72C6KrV9MhTAdFvejTCHRhx+QwFE+0r/rmJeDDKMaokA== X-Received: by 2002:a19:2885:: with SMTP id o127-v6mr3893487lfo.28.1527763080630; Thu, 31 May 2018 03:38:00 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id l10-v6sm7501427lja.62.2018.05.31.03.37.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 03:38:00 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Damien Thebault Subject: [PATCH 1/2] mmc: mvsdio: Respect card busy time out from mmc core Date: Thu, 31 May 2018 12:37:52 +0200 Message-Id: <20180531103752.2620-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.0 Instead of using a hardcoded timeout of 5 * HZ jiffies, let's respect the command busy timeout provided by the mmc core. This make the used timeout more reliable. Cc: Damien Thebault Signed-off-by: Ulf Hansson --- drivers/mmc/host/mvsdio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.0 diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 210247b3d11a..4c70829cffd7 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -143,6 +143,7 @@ static void mvsd_request(struct mmc_host *mmc, struct mmc_request *mrq) struct mmc_command *cmd = mrq->cmd; u32 cmdreg = 0, xfer = 0, intr = 0; unsigned long flags; + unsigned int timeout; BUG_ON(host->mrq != NULL); host->mrq = mrq; @@ -234,7 +235,8 @@ static void mvsd_request(struct mmc_host *mmc, struct mmc_request *mrq) mvsd_write(MVSD_NOR_INTR_EN, host->intr_en); mvsd_write(MVSD_ERR_INTR_EN, 0xffff); - mod_timer(&host->timer, jiffies + 5 * HZ); + timeout = cmd->busy_timeout ? cmd->busy_timeout : 5000; + mod_timer(&host->timer, jiffies + msecs_to_jiffies(timeout)); spin_unlock_irqrestore(&host->lock, flags); }