From: Jaehoon Chung <jh80.chung@samsung.com>
To: Yuvaraj Kumar C D <yuvaraj.cd@gmail.com>,
grundler@chromium.org, linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, jh80.chung@samsung.com,
cjb@laptop.org, tgih.jun@samsung.com, linux-mmc@vger.kernel.org,
sonnyrao@chromium.org, kgene.kim@samsung.com, joshi@samsung.com
Cc: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>,
t.figa@samsung.com, Alim Akhtar <alim.akhtar@samsung.com>
Subject: Re: [PATCH] mmc: dw_mmc: Fix the max_blk_count in IDMAC
Date: Mon, 24 Mar 2014 13:06:55 +0900 [thread overview]
Message-ID: <532FAF5F.1020906@samsung.com> (raw)
In-Reply-To: <1395633218-23766-1-git-send-email-yuvaraj.cd@samsung.com>
Hi,
Did you know that Seungwon has sent the patch "[PATCH 1/7] mmc: dw_mmc: fix the max_blk_count in IDMAC"?
I think this patch looks like same, isn't it?
Plz check it.
Best Regards,
Jaehoon Chung
On 03/24/2014 12:53 PM, Yuvaraj Kumar C D wrote:
> From: Alim Akhtar <alim.akhtar@samsung.com>
>
> max_blk_count is currently set incorrectly, and the correct value can
> be determined by looking at the maximum number of bytes which can be
> transferred and the block size. We use the maximum block size to
> determine the minimum number of blocks that the controller should
> support. It could probably do more with a smaller block size but this
> value should be sufficient for good performance.
>
> This improves sequential performance by 82% on write and 6% read on
> one particular device.
>
> TEST= with this patch
> time dd if=/dev/zero of=/usr/local/100 bs=1M count=100 conv=fdatasync
> 100+0 records in
> 100+0 records out
> 104857600 bytes (105 MB) copied, 2.62541 s, 39.9 MB/s
>
> real 0m2.638s
> user 0m0.000s
> sys 0m0.645s
>
> without this patch:
> time dd if=/dev/zero of=/usr/local/100 bs=1M count=100 conv=fdatasync
> 100+0 records in
> 100+0 records out
> 104857600 bytes (105 MB) copied, 3.25873 s, 32.2 MB/s
>
> real 0m3.265s
> user 0m0.005s
> sys 0m0.690s
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
> Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
> ---
> drivers/mmc/host/dw_mmc.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 0c56faa..2fc4030 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2213,10 +2213,24 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> /* Useful defaults if platform data is unset. */
> #ifdef CONFIG_MMC_DW_IDMAC
> mmc->max_segs = host->ring_size;
> +
> + /* the BLKSIZ register is 16-bits wide */
> mmc->max_blk_size = 65536;
> - mmc->max_blk_count = host->ring_size;
> +
> + /*
> + * This value is calculated by taking the size of the
> + * 32-bit BYTCNT (byte count) register and dividing by the
> + * BLKSIZ (block size) register. This is the minimum number
> + * of blocks which could be handled.
> + */
> + mmc->max_blk_count = 0xFFFF;
> mmc->max_seg_size = 0x1000;
> - mmc->max_req_size = mmc->max_seg_size * mmc->max_blk_count;
> + /*
> + * Maximum request size should be total number of descriptors
> + * times the maximum amount of data each can reference
> + */
> +
> + mmc->max_req_size = mmc->max_seg_size * mmc->max_segs;
> #else
> mmc->max_segs = 64;
> mmc->max_blk_size = 65536; /* BLKSIZ is 16 bits */
>
WARNING: multiple messages have this Message-ID (diff)
From: jh80.chung@samsung.com (Jaehoon Chung)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: dw_mmc: Fix the max_blk_count in IDMAC
Date: Mon, 24 Mar 2014 13:06:55 +0900 [thread overview]
Message-ID: <532FAF5F.1020906@samsung.com> (raw)
In-Reply-To: <1395633218-23766-1-git-send-email-yuvaraj.cd@samsung.com>
Hi,
Did you know that Seungwon has sent the patch "[PATCH 1/7] mmc: dw_mmc: fix the max_blk_count in IDMAC"?
I think this patch looks like same, isn't it?
Plz check it.
Best Regards,
Jaehoon Chung
On 03/24/2014 12:53 PM, Yuvaraj Kumar C D wrote:
> From: Alim Akhtar <alim.akhtar@samsung.com>
>
> max_blk_count is currently set incorrectly, and the correct value can
> be determined by looking at the maximum number of bytes which can be
> transferred and the block size. We use the maximum block size to
> determine the minimum number of blocks that the controller should
> support. It could probably do more with a smaller block size but this
> value should be sufficient for good performance.
>
> This improves sequential performance by 82% on write and 6% read on
> one particular device.
>
> TEST= with this patch
> time dd if=/dev/zero of=/usr/local/100 bs=1M count=100 conv=fdatasync
> 100+0 records in
> 100+0 records out
> 104857600 bytes (105 MB) copied, 2.62541 s, 39.9 MB/s
>
> real 0m2.638s
> user 0m0.000s
> sys 0m0.645s
>
> without this patch:
> time dd if=/dev/zero of=/usr/local/100 bs=1M count=100 conv=fdatasync
> 100+0 records in
> 100+0 records out
> 104857600 bytes (105 MB) copied, 3.25873 s, 32.2 MB/s
>
> real 0m3.265s
> user 0m0.005s
> sys 0m0.690s
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
> Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
> ---
> drivers/mmc/host/dw_mmc.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 0c56faa..2fc4030 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2213,10 +2213,24 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> /* Useful defaults if platform data is unset. */
> #ifdef CONFIG_MMC_DW_IDMAC
> mmc->max_segs = host->ring_size;
> +
> + /* the BLKSIZ register is 16-bits wide */
> mmc->max_blk_size = 65536;
> - mmc->max_blk_count = host->ring_size;
> +
> + /*
> + * This value is calculated by taking the size of the
> + * 32-bit BYTCNT (byte count) register and dividing by the
> + * BLKSIZ (block size) register. This is the minimum number
> + * of blocks which could be handled.
> + */
> + mmc->max_blk_count = 0xFFFF;
> mmc->max_seg_size = 0x1000;
> - mmc->max_req_size = mmc->max_seg_size * mmc->max_blk_count;
> + /*
> + * Maximum request size should be total number of descriptors
> + * times the maximum amount of data each can reference
> + */
> +
> + mmc->max_req_size = mmc->max_seg_size * mmc->max_segs;
> #else
> mmc->max_segs = 64;
> mmc->max_blk_size = 65536; /* BLKSIZ is 16 bits */
>
next prev parent reply other threads:[~2014-03-24 4:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 3:53 [PATCH] mmc: dw_mmc: Fix the max_blk_count in IDMAC Yuvaraj Kumar C D
2014-03-24 3:53 ` Yuvaraj Kumar C D
2014-03-24 4:06 ` Jaehoon Chung [this message]
2014-03-24 4:06 ` Jaehoon Chung
2014-03-24 4:34 ` Yuvaraj Kumar
2014-03-24 4:34 ` Yuvaraj Kumar
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=532FAF5F.1020906@samsung.com \
--to=jh80.chung@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=cjb@laptop.org \
--cc=grundler@chromium.org \
--cc=joshi@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=sonnyrao@chromium.org \
--cc=t.figa@samsung.com \
--cc=tgih.jun@samsung.com \
--cc=yuvaraj.cd@gmail.com \
--cc=yuvaraj.cd@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.