From patchwork Wed Jan 22 15:00:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 23531 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C5062218CB for ; Wed, 22 Jan 2014 15:00:33 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id kq14sf1088194pab.5 for ; Wed, 22 Jan 2014 07:00:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=PMe6unSGqA/W5odKMysIEeCqYM3gvkHzYOOrR2+v8Dw=; b=ZCznvdv3O4dAmM/hVmvPmmFK38I/neBOd1IGdJKFikAQ8OEH9D4/v8VFCtNyIoMTlc 9csSrur6fPgd7ZsXYuIMaBFA9rjbxWKqxJRynHETovfwY5vqnYeO2EvFKYzzMk8n6GU+ Rkt2EVngPZHHMqsAIXIM5lSImeKzMETYvyZgxnakEj6d5TK8A102B0DPtPpe+x28WMLu 6HqxQ3AR27mQCqVTb9sMH9+p8bVuZeUDwb+RU+an42ZktlZNzJxcvsKQwUJloLa8Yg4z JXYq17575NFLWsj+oPGcGILIE8i6IS77wQZbIahoRd04c+sJp5E5HiVFAa75tUVDmXgS JntQ== X-Gm-Message-State: ALoCoQl2/LhlSgBa5p5hQmepQoCkppcCTUj7X4tfOcSVGEkZu0xL9yyg+pPq6E8RsLe7yL0pcKLH X-Received: by 10.66.246.194 with SMTP id xy2mr711849pac.36.1390402833112; Wed, 22 Jan 2014 07:00:33 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.72 with SMTP id li8ls82213qeb.32.gmail; Wed, 22 Jan 2014 07:00:33 -0800 (PST) X-Received: by 10.220.48.194 with SMTP id s2mr166481vcf.43.1390402832972; Wed, 22 Jan 2014 07:00:32 -0800 (PST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id mj10si4698736vcb.12.2014.01.22.07.00.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 07:00:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ik5so286058vcb.9 for ; Wed, 22 Jan 2014 07:00:32 -0800 (PST) X-Received: by 10.220.159.4 with SMTP id h4mr1223896vcx.1.1390402832871; Wed, 22 Jan 2014 07:00:32 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp190305vcz; Wed, 22 Jan 2014 07:00:32 -0800 (PST) X-Received: by 10.180.188.230 with SMTP id gd6mr3673954wic.15.1390402831741; Wed, 22 Jan 2014 07:00:31 -0800 (PST) Received: from mail-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by mx.google.com with ESMTPS id ok5si7045630wic.12.2014.01.22.07.00.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 07:00:31 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.172 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=74.125.82.172; Received: by mail-we0-f172.google.com with SMTP id q58so406810wes.31 for ; Wed, 22 Jan 2014 07:00:31 -0800 (PST) X-Received: by 10.180.105.41 with SMTP id gj9mr20319907wib.28.1390402831176; Wed, 22 Jan 2014 07:00:31 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id dd3sm15401824wjb.9.2014.01.22.07.00.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 07:00:30 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Dong Aisheng , Stephen Warren , Vladimir Zapolskiy , Adrian Hunter , Ulf Hansson Subject: [PATCH 01/10] mmc: core: Rename max_discard_to to max_busy_timeout Date: Wed, 22 Jan 2014 16:00:15 +0100 Message-Id: <1390402824-9850-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1390402824-9850-1-git-send-email-ulf.hansson@linaro.org> References: <1390402824-9850-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Rename host->max_discard_to to host->max_busy_timeout, to reflect that it tells the mmc core layer about the maximum supported busy detection timeout by the host. This timeout is at the moment only applicable to erase/trim/discard commands. By the renaming we provide the option of make use of it for other commands that cares about busy detection. In other words, those commands that wants an R1B response, like for example the mmc switch command. Do note that the max_busy_timeout is supposed to be specified only by hosts supporting MMC_CAP_WAIT_WHILE_BUSY. Signed-off-by: Ulf Hansson --- drivers/mmc/core/core.c | 6 +++--- drivers/mmc/host/sdhci.c | 2 +- include/linux/mmc/host.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 098374b..a81d754 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2137,7 +2137,7 @@ static unsigned int mmc_do_calc_max_discard(struct mmc_card *card, y = 0; for (x = 1; x && x <= max_qty && max_qty - x >= qty; x <<= 1) { timeout = mmc_erase_timeout(card, arg, qty + x); - if (timeout > host->max_discard_to) + if (timeout > host->max_busy_timeout) break; if (timeout < last_timeout) break; @@ -2169,7 +2169,7 @@ unsigned int mmc_calc_max_discard(struct mmc_card *card) struct mmc_host *host = card->host; unsigned int max_discard, max_trim; - if (!host->max_discard_to) + if (!host->max_busy_timeout) return UINT_MAX; /* @@ -2189,7 +2189,7 @@ unsigned int mmc_calc_max_discard(struct mmc_card *card) max_discard = 0; } pr_debug("%s: calculated max. discard sectors %u for timeout %u ms\n", - mmc_hostname(host), max_discard, host->max_discard_to); + mmc_hostname(host), max_discard, host->max_busy_timeout); return max_discard; } EXPORT_SYMBOL(mmc_calc_max_discard); diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 9ddef47..ec57c6c 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2941,7 +2941,7 @@ int sdhci_add_host(struct sdhci_host *host) if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) host->timeout_clk = mmc->f_max / 1000; - mmc->max_discard_to = (1 << 27) / host->timeout_clk; + mmc->max_busy_timeout = (1 << 27) / host->timeout_clk; mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 99f5709..9805522 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -304,7 +304,7 @@ struct mmc_host { unsigned int max_req_size; /* maximum number of bytes in one req */ unsigned int max_blk_size; /* maximum size of one mmc block */ unsigned int max_blk_count; /* maximum number of blocks in one req */ - unsigned int max_discard_to; /* max. discard timeout in ms */ + unsigned int max_busy_timeout; /* max busy timeout in ms */ /* private data */ spinlock_t lock; /* lock for claim and bus ops */