From: zhangfei <zhangfei.gao@linaro.org>
To: Jaehoon Chung <jh80.chung@samsung.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, Fei Wang <w.f@huawei.com>,
CPGS <cpgs@samsung.com>
Subject: Re: [PATCH] mmc: dw_mmc: init desc in dw_mci_idmac_init
Date: Thu, 30 Apr 2015 16:37:27 +0800 [thread overview]
Message-ID: <5541E9C7.4010804@linaro.org> (raw)
In-Reply-To: <5541E13F.2070908@samsung.com>
On 04/30/2015 04:01 PM, Jaehoon Chung wrote:
> Hi.
>
> On 04/29/2015 10:31 PM, Zhangfei Gao wrote:
>> Set 0 to des1 in 32bit case.
>> Otherwise the random value of des1 will be used in
>> dw_mci_translate_sglist: IDMAC_64ADDR_SET_BUFFER1_SIZE(desc, length)
>
> I'm not understanding this comment.
> how does it use the IDMAC_64ADDR_SET_BUFFER1_SIZE(desc, length)?
p->des1 contains random value, coming from dmam_alloc_coherent in
dw_mci_init_dma
In dw_mci_translate_sglist -> IDMAC_SET_BUFFER1_SIZE(desc, length);
#define IDMAC_SET_BUFFER1_SIZE(d, s) \
((d)->des1 = ((d)->des1 & 0x03ffe000) | ((s) & 0x1fff))
The random value will be set to des1 as well as length, causing
unexpected behavior.
So des1 need to be init to 0.
While des0, des2, des3 are set in dw_mci_idmac_init and
dw_mci_translate_sglist.
Thanks
>
> Best Regards,
> Jaehoon Chung
>>
>> Signed-off-by: Fei Wang <w.f@huawei.com>
>> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>> ---
>> drivers/mmc/host/dw_mmc.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 241454f..488a8af 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -589,9 +589,11 @@ static int dw_mci_idmac_init(struct dw_mci *host)
>> host->ring_size = PAGE_SIZE / sizeof(struct idmac_desc);
>>
>> /* Forward link the descriptor list */
>> - for (i = 0, p = host->sg_cpu; i < host->ring_size - 1; i++, p++)
>> + for (i = 0, p = host->sg_cpu; i < host->ring_size - 1; i++, p++) {
>> p->des3 = cpu_to_le32(host->sg_dma +
>> (sizeof(struct idmac_desc) * (i + 1)));
>> + p->des1 = 0;
>> + }
>>
>> /* Set the last descriptor as the end-of-ring descriptor */
>> p->des3 = cpu_to_le32(host->sg_dma);
>>
>
next prev parent reply other threads:[~2015-04-30 8:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-29 13:31 [PATCH] mmc: dw_mmc: init desc in dw_mci_idmac_init Zhangfei Gao
2015-04-30 8:01 ` Jaehoon Chung
2015-04-30 8:37 ` zhangfei [this message]
[not found] ` <CAELcNGSWV_EVECekLcnP=x992XO8=164bUcA=P=G28Ee0J6myg@mail.gmail.com>
2015-04-30 14:13 ` Zhangfei Gao
2015-04-30 14:16 ` Zhangfei Gao
2015-05-04 0:07 ` 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=5541E9C7.4010804@linaro.org \
--to=zhangfei.gao@linaro.org \
--cc=cpgs@samsung.com \
--cc=jh80.chung@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=w.f@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox