linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: block: correct 4KB alignment check
@ 2016-05-13  7:59 Yuan, Juntao
  2016-06-03  8:33 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Yuan, Juntao @ 2016-05-13  7:59 UTC (permalink / raw)
  To: linux-mmc@vger.kernel.org


In sectors alignment check, brq->data.blocks means sectors of the
previous mqrq since data.blocks for mqrq_cur hasn't been updated yet.
data.blocks will be updated later in mmc_blk_packed_hdr_wrq_prep or
mmc_blk_rw_rq_prep.

static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, ......
        ......
    struct mmc_blk_request *brq = &mq->mqrq_cur->brq;

Signed-off-by: Yuan Juntao <juntao.yuan@intel.com>
---
 drivers/mmc/card/block.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 3bdbe50..cc0189f 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1950,8 +1950,8 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *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)) {
+           if (mmc_large_sector(card) &&
+               !IS_ALIGNED(blk_rq_sectors(rqc), 8)) {
                pr_err("%s: Transfer size is not 4KB sector size aligned\n",
                    req->rq_disk->disk_name);
                mq_rq = mq->mqrq_cur;
--
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: block: correct 4KB alignment check
  2016-05-13  7:59 [PATCH] mmc: block: correct 4KB alignment check Yuan, Juntao
@ 2016-06-03  8:33 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2016-06-03  8:33 UTC (permalink / raw)
  To: Yuan, Juntao; +Cc: linux-mmc@vger.kernel.org

On 13 May 2016 at 09:59, Yuan, Juntao <juntao.yuan@intel.com> wrote:
>
> In sectors alignment check, brq->data.blocks means sectors of the
> previous mqrq since data.blocks for mqrq_cur hasn't been updated yet.
> data.blocks will be updated later in mmc_blk_packed_hdr_wrq_prep or
> mmc_blk_rw_rq_prep.
>
> static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, ......
>         ......
>     struct mmc_blk_request *brq = &mq->mqrq_cur->brq;
>
> Signed-off-by: Yuan Juntao <juntao.yuan@intel.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/card/block.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 3bdbe50..cc0189f 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1950,8 +1950,8 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *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)) {
> +           if (mmc_large_sector(card) &&
> +               !IS_ALIGNED(blk_rq_sectors(rqc), 8)) {
>                 pr_err("%s: Transfer size is not 4KB sector size aligned\n",
>                     req->rq_disk->disk_name);
>                 mq_rq = mq->mqrq_cur;
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-03  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13  7:59 [PATCH] mmc: block: correct 4KB alignment check Yuan, Juntao
2016-06-03  8:33 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).