From: "Subhash Jadavani" <subhashj@codeaurora.org>
To: 'Saugata Das' <saugata.das@stericsson.com>, linux-mmc@vger.kernel.org
Cc: patches@linaro.org, saugata.das@linaro.org,
arnd.bergmann@linaro.org, venkat@linaro.org, lporzio@micron.com,
linkinjeon@gmail.com
Subject: RE: [PATCH v2 1/2] [MMC-4.5] Disable emulation
Date: Thu, 17 May 2012 17:13:24 +0530 [thread overview]
Message-ID: <000601cd3422$4733c540$d59b4fc0$@codeaurora.org> (raw)
In-Reply-To: <1337252542-25795-1-git-send-email-saugata.das@stericsson.com>
Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Regards,
Subhash
> -----Original Message-----
> From: Saugata Das [mailto:saugata.das@stericsson.com]
> Sent: Thursday, May 17, 2012 4:32 PM
> To: linux-mmc@vger.kernel.org
> Cc: patches@linaro.org; saugata.das@linaro.org; subhashj@codeaurora.org;
> arnd.bergmann@linaro.org; venkat@linaro.org; lporzio@micron.com;
> linkinjeon@gmail.com
> Subject: [PATCH v2 1/2] [MMC-4.5] Disable emulation
>
> From: Saugata Das <saugata.das@linaro.org>
>
> This patch adds the support for large sector size of 4KB by disabling
> emulation.
> This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
> mmc_blk_alloc_req.
>
> In order to use this patch for 4KB sector size, ensure that
> USE_NATIVE_SECTOR is enabled, partition table is 4KB sector size aligned
and
> file system block and sector size are 4KB multiples.
>
> Signed-off-by: Saugata Das <saugata.das@linaro.org>
>
> changes in v2:
> Updated description, added pr_err based on review feedback
> ---
> drivers/mmc/card/block.c | 18 ++++++++++++++++--
> drivers/mmc/core/mmc.c | 2 ++
> 2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index
> 91cda75..d628c5d 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1284,7 +1284,7 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue
> *mq, struct request *rqc)
> int ret = 1, disable_multi = 0, retry = 0, type;
> enum mmc_blk_status status;
> struct mmc_queue_req *mq_rq;
> - struct request *req;
> + struct request *req = rqc;
> struct mmc_async_req *areq;
>
> if (!rqc && !mq->mqrq_prev->req)
> @@ -1292,6 +1292,16 @@ static int mmc_blk_issue_rw_rq(struct
> mmc_queue *mq, struct request *rqc)
>
> do {
> if (rqc) {
> + /*
> + * When 4KB native sector is enabled, only 8 blocks
> + * multiple read or write is allowed
> + */
> + if ((brq->data.blocks & 0x07) &&
> + (card->ext_csd.data_sector_size == 4096)) {
> + pr_err("%s: Transfer size is not 4KB sector
> size aligned\n",
> + req->rq_disk->disk_name);
> + goto cmd_abort;
> + }
> mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq);
> areq = &mq->mqrq_cur->mmc_active;
> } else
> @@ -1539,7 +1549,11 @@ static struct mmc_blk_data
> *mmc_blk_alloc_req(struct mmc_card *card,
> snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
> "mmcblk%d%s", md->name_idx, subname ? subname : "");
>
> - blk_queue_logical_block_size(md->queue.queue, 512);
> + if (mmc_card_mmc(card))
> + blk_queue_logical_block_size(md->queue.queue,
> + card->ext_csd.data_sector_size);
> + else
> + blk_queue_logical_block_size(md->queue.queue, 512);
> set_capacity(md->disk, size);
>
> if (mmc_host_cmd23(card->host)) {
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index
> 7268c26..11444c6 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -516,6 +516,8 @@ static int mmc_read_ext_csd(struct mmc_card *card,
> u8 *ext_csd)
> } else {
> card->ext_csd.data_tag_unit_size = 0;
> }
> + } else {
> + card->ext_csd.data_sector_size = 512;
> }
>
> out:
> --
> 1.7.4.3
next prev parent reply other threads:[~2012-05-17 11:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-17 11:02 [PATCH v2 1/2] [MMC-4.5] Disable emulation Saugata Das
2012-05-17 11:02 ` [PATCH v2 2/2] [MMC-4.5] [MMC UTIL] " Saugata Das
2012-05-17 11:37 ` Subhash Jadavani
2012-05-17 13:41 ` Chris Ball
2012-05-17 11:09 ` [PATCH v2 1/2] [MMC-4.5] " Namjae Jeon
2012-05-17 11:43 ` Subhash Jadavani [this message]
2012-05-17 13:15 ` Saugata Das
2012-05-17 13:38 ` Chris Ball
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='000601cd3422$4733c540$d59b4fc0$@codeaurora.org' \
--to=subhashj@codeaurora.org \
--cc=arnd.bergmann@linaro.org \
--cc=linkinjeon@gmail.com \
--cc=linux-mmc@vger.kernel.org \
--cc=lporzio@micron.com \
--cc=patches@linaro.org \
--cc=saugata.das@linaro.org \
--cc=saugata.das@stericsson.com \
--cc=venkat@linaro.org \
/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.