From: Jaehoon Chung <jh80.chung@samsung.com>
To: Shawn Guo <shawn.guo@freescale.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
Chris Ball <cjb@laptop.org>, Per Forlin <per.forlin@linaro.org>,
will.newton@imgtec.com, Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH] dw_mmc: add support for pre_req and post_req
Date: Mon, 18 Apr 2011 13:55:11 +0900 [thread overview]
Message-ID: <4DABC42F.30405@samsung.com> (raw)
In-Reply-To: <20110416161634.GB17935@S2100-06.ap.freescale.net>
Hi Shawn..
Shawn Guo wrote:
> Hi Jaehoon,
>
> On Thu, Apr 07, 2011 at 05:04:52PM +0900, Jaehoon Chung wrote:
> [...]
>> +static unsigned int dw_mci_pre_dma_transfer(struct dw_mci *host,
>> + struct mmc_data *data, struct dw_mci_next *next)
>> +{
>> + unsigned int sg_len;
>> +
>> + BUG_ON(next && data->host_cookie);
>> + BUG_ON(!next && data->host_cookie &&
>> + data->host_cookie != host->next_data.cookie);
>> +
>> + if (!next && data->host_cookie &&
>> + data->host_cookie != host->next_data.cookie) {
>> + data->host_cookie = 0;
>> + }
>> +
> I'm unsure if the 'if' statement makes any sense here, since the
> exactly same conditions have been caught by the BUG_ON just above
> it.
>
You're right..i'll modify this..
>> + if (next ||
>> + (!next && data->host_cookie != host->next_data.cookie)) {
>> + sg_len = dma_map_sg(&host->pdev->dev, data->sg,
>> + data->sg_len, ((data->flags & MMC_DATA_WRITE)
>> + ? DMA_TO_DEVICE : DMA_FROM_DEVICE));
>> + } else {
>> + sg_len = host->next_data.sg_len;
>> + host->next_data.sg_len = 0;
>> + }
>> +
>> + if (sg_len == 0)
>> + return -EINVAL;
>> +
>> + if (next) {
>> + next->sg_len = sg_len;
>> + data->host_cookie = ++next->cookie < 0 ? 1 : next->cookie;
>> + } else
>> + data->sg_len = sg_len;
>> +
>> + return sg_len;
>> +}
>> +
> Function dw_mci_pre_dma_transfer() returns non-zero value anyway,
> either -EINVAL or sg_len ...
>
Sorry,, i didn't understand this your comments..
> [...]
>> +static void dw_mci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq,
>> + bool is_first_req)
>> +{
>> + struct dw_mci_slot *slot = mmc_priv(mmc);
>> + struct mmc_data *data = mrq->data;
>> +
>> + if (!data)
>> + return;
>> +
>> + BUG_ON(mrq->data->host_cookie);
>> +
>> + if (slot->host->use_dma) {
>> + if (dw_mci_pre_dma_transfer(slot->host, mrq->data,
>> + &slot->host->next_data))
>> + mrq->data->host_cookie = 0;
> ... while it steps back to old blocking way by setting
> data->host_cookie 0 when dw_mci_pre_dma_transfer returns non-zero.
>
> Per my understanding, it means the non-blocking optimization will
> always get bypassed anyway, so I doubt the patch can really gain
> performance improvement. Did you get the chance to measure?
>
Actually, i didn't get performance improvement, but didn't fully affect by CPU_FREQ.
Somebody get performance improvement?
Regards,
Jaehoon Chung
next prev parent reply other threads:[~2011-04-18 4:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 8:04 [PATCH] dw_mmc: add support for pre_req and post_req Jaehoon Chung
2011-04-16 16:16 ` Shawn Guo
2011-04-18 4:55 ` Jaehoon Chung [this message]
2011-04-18 5:10 ` Shawn Guo
2011-04-18 5:10 ` 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=4DABC42F.30405@samsung.com \
--to=jh80.chung@samsung.com \
--cc=cjb@laptop.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=per.forlin@linaro.org \
--cc=shawn.guo@freescale.com \
--cc=will.newton@imgtec.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.