All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: DooHyun Hwang <dh0421.hwang@samsung.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, ulf.hansson@linaro.org,
	robh+dt@kernel.org, axboe@kernel.dk, satyat@google.com,
	ebiggers@google.com, gustavoars@kernel.org
Cc: grant.jung@samsung.com, jt77.jang@samsung.com,
	junwoo80.lee@samsung.com, jangsub.yi@samsung.com,
	sh043.lee@samsung.com, cw9316.lee@samsung.com,
	sh8267.baek@samsung.com, wkon.kim@samsung.com
Subject: Re: [PATCH 2/2] mmc: core: Add no single read retries
Date: Wed, 17 Feb 2021 07:46:54 +0200	[thread overview]
Message-ID: <4035139d-7850-8460-f069-06fc61d13039@intel.com> (raw)
In-Reply-To: <20210217052239.13780-3-dh0421.hwang@samsung.com>

On 17/02/21 7:22 am, DooHyun Hwang wrote:
> This makes to handle read errors faster by not retrying
> multiple block read(CMD18) errors with single block reads(CMD17).
> 
> On some bad SD Cards that have problem with read operations,
> it is not helpful to retry multiple block read errors with
> several single block reads, and it is delayed to treat read
> operations as I/O error as much as retrying single block reads.

If the issue is that it takes too long, then maybe it would be better to get
mmc_blk_read_single() to give up after a certain amount of time.

> 
> Signed-off-by: DooHyun Hwang <dh0421.hwang@samsung.com>
> ---
>  drivers/mmc/core/block.c | 3 ++-
>  drivers/mmc/core/host.c  | 6 ++++++
>  include/linux/mmc/host.h | 3 +++
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index d666e24fbe0e..e25aaf8fca34 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -1809,7 +1809,8 @@ static void mmc_blk_mq_rw_recovery(struct mmc_queue *mq, struct request *req)
>  
>  	/* FIXME: Missing single sector read for large sector size */
>  	if (!mmc_large_sector(card) && rq_data_dir(req) == READ &&
> -	    brq->data.blocks > 1) {
> +	    brq->data.blocks > 1 &&
> +	    !card->host->no_single_read_retry) {
>  		/* Read one sector at a time */
>  		mmc_blk_read_single(mq, req);
>  		return;
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 9b89a91b6b47..3bf5b2fc111b 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -352,6 +352,12 @@ int mmc_of_parse(struct mmc_host *host)
>  	if (device_property_read_bool(dev, "no-mmc"))
>  		host->caps2 |= MMC_CAP2_NO_MMC;
>  
> +	if (device_property_read_bool(dev, "no-single-read-retry")) {
> +		dev_info(host->parent,
> +			"Single block read retrying is not supported\n");
> +		host->no_single_read_retry = true;
> +	}
> +
>  	/* Must be after "non-removable" check */
>  	if (device_property_read_u32(dev, "fixed-emmc-driver-type", &drv_type) == 0) {
>  		if (host->caps & MMC_CAP_NONREMOVABLE)
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 26a3c7bc29ae..faec55035a63 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -502,6 +502,9 @@ struct mmc_host {
>  	/* Host Software Queue support */
>  	bool			hsq_enabled;
>  
> +	/* Do not retry multi block read as single block read */
> +	bool			no_single_read_retry;
> +
>  	unsigned long		private[] ____cacheline_aligned;
>  };
>  
> 


  reply	other threads:[~2021-02-17  5:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210217053519epcas1p4204253d3af8e1c6d2a5c3acb73eb877f@epcas1p4.samsung.com>
2021-02-17  5:22 ` [PATCH 0/2] mmc: core: add a new property DooHyun Hwang
     [not found]   ` <CGME20210217053520epcas1p1af462836bd9fc690d99baed0b122d6fd@epcas1p1.samsung.com>
2021-02-17  5:22     ` [PATCH 1/2] dt-bindings: mmc: Add no-single-read-retry property DooHyun Hwang
     [not found]   ` <CGME20210217053521epcas1p2aa80cae5d52f30c8c8882f44abe8045c@epcas1p2.samsung.com>
2021-02-17  5:22     ` [PATCH 2/2] mmc: core: Add no single read retries DooHyun Hwang
2021-02-17  5:46       ` Adrian Hunter [this message]
2021-02-17  6:00         ` Adrian Hunter
2021-02-17  8:46           ` DooHyun Hwang
2021-03-01  8:23             ` Ulf Hansson
2021-02-17  5:19 [PATCH 0/2] mmc: core: add a new property DooHyun Hwang
     [not found] ` <CGME20210217053242epcas1p426e4bdc44270bb6b98eb18f33e66023d@epcas1p4.samsung.com>
2021-02-17  5:19   ` [PATCH 2/2] mmc: core: Add no single read retries DooHyun Hwang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4035139d-7850-8460-f069-06fc61d13039@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=axboe@kernel.dk \
    --cc=cw9316.lee@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dh0421.hwang@samsung.com \
    --cc=ebiggers@google.com \
    --cc=grant.jung@samsung.com \
    --cc=gustavoars@kernel.org \
    --cc=jangsub.yi@samsung.com \
    --cc=jt77.jang@samsung.com \
    --cc=junwoo80.lee@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=satyat@google.com \
    --cc=sh043.lee@samsung.com \
    --cc=sh8267.baek@samsung.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wkon.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.