From: Adrian Hunter <adrian.hunter@intel.com>
To: Jaehoon Chung <jh80.chung@samsung.com>, linux-mmc@vger.kernel.org
Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com
Subject: Re: [PATCH] mmc: queue: allocate the scatterlist with a correct value
Date: Wed, 4 May 2016 09:29:16 +0300 [thread overview]
Message-ID: <572996BC.70703@intel.com> (raw)
In-Reply-To: <1462339891-10477-1-git-send-email-jh80.chung@samsung.com>
On 04/05/16 08:31, Jaehoon Chung wrote:
> If host->max is lower than PAGE_CACHE_SIZE, it should allocate
host->max?
PAGE_CACHE_SIZE does not exist anymore. Now there is only PAGE_SIZE.
> the scatterlist with incorrect size.
Don't understand what you mean.
> To prevent illegal behavior, fixed the scatterlist size for mmc_alloc_sg().
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> drivers/mmc/card/queue.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index 6f4323c..0353f99 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -276,12 +276,14 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card,
> blk_queue_max_segments(mq->queue, host->max_segs);
So now mq->queue->limits.max_segments == host->max_segs unless it was zero.
> blk_queue_max_segment_size(mq->queue, host->max_seg_size);
>
> - mqrq_cur->sg = mmc_alloc_sg(host->max_segs, &ret);
> + mqrq_cur->sg =
> + mmc_alloc_sg(mq->queue->limits.max_segments, &ret);
So that is the same unless host->max_segs is zero.
> if (ret)
> goto cleanup_queue;
>
>
> - mqrq_prev->sg = mmc_alloc_sg(host->max_segs, &ret);
> + mqrq_prev->sg =
> + mmc_alloc_sg(mq->queue->limits.max_segments, &ret);
> if (ret)
> goto cleanup_queue;
> }
>
next prev parent reply other threads:[~2016-05-04 6:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-04 5:31 [PATCH] mmc: queue: allocate the scatterlist with a correct value Jaehoon Chung
2016-05-04 6:29 ` Adrian Hunter [this message]
2016-05-04 6:35 ` Jaehoon Chung
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=572996BC.70703@intel.com \
--to=adrian.hunter@intel.com \
--cc=jh80.chung@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@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.