diff mbox

S5P: mmc: Resolved interrupt error during mmc_init

Message ID 1300794050-5170-1-git-send-email-chander.kashyap@linaro.org
State Accepted
Commit f69bb511455513a61c25783414240258f13f3371
Headers show

Commit Message

Chander Kashyap March 22, 2011, 11:40 a.m. UTC
Blocksize was hardcoded to 512 bytes. But the blocksize varies
depeding on various mmc subsystem commands (between 8 and 512).
This hardcoding was resulting in interrupt error during data
transfer.

It is now calculated based upon the request sent by mmc subsystem.

Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
---
 drivers/mmc/s5p_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Minkyu Kang March 24, 2011, 2:46 a.m. UTC | #1
Dear Chander Kashyap,

On 22 March 2011 20:40, Chander Kashyap <chander.kashyap@linaro.org> wrote:
> Blocksize was hardcoded to 512 bytes. But the blocksize varies
> depeding on various mmc subsystem commands (between 8 and 512).
> This hardcoding was resulting in interrupt error during data
> transfer.
>
> It is now calculated based upon the request sent by mmc subsystem.
>
> Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
> ---
>  drivers/mmc/s5p_mmc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
> index 195b5be..0323800 100644
> --- a/drivers/mmc/s5p_mmc.c
> +++ b/drivers/mmc/s5p_mmc.c
> @@ -51,7 +51,7 @@ static void mmc_prepare_data(struct mmc_host *host, struct mmc_data *data)
>        writeb(ctrl, &host->reg->hostctl);
>
>        /* We do not handle DMA boundaries, so set it to max (512 KiB) */
> -       writew((7 << 12) | (512 << 0), &host->reg->blksize);
> +       writew((7 << 12) | (data->blocksize & 0xFFF), &host->reg->blksize);
>        writew(data->blocks, &host->reg->blkcnt);
>  }
>
> --
> 1.7.1
>

applied to u-boot-samsung.

Thanks
Minkyu Kang
Raffaele Recalcati April 3, 2011, 4:39 a.m. UTC | #2
Hi Minkyu,

On Thu, Mar 24, 2011 at 3:46 AM, Minkyu Kang <promsoft@gmail.com> wrote:
> Dear Chander Kashyap,
>
> On 22 March 2011 20:40, Chander Kashyap <chander.kashyap@linaro.org> wrote:
>> Blocksize was hardcoded to 512 bytes. But the blocksize varies
>> depeding on various mmc subsystem commands (between 8 and 512).
>> This hardcoding was resulting in interrupt error during data
>> transfer.
>>
>> It is now calculated based upon the request sent by mmc subsystem.
>>
>> Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
>> ---
>>  drivers/mmc/s5p_mmc.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
>> index 195b5be..0323800 100644
>> --- a/drivers/mmc/s5p_mmc.c
>> +++ b/drivers/mmc/s5p_mmc.c
>> @@ -51,7 +51,7 @@ static void mmc_prepare_data(struct mmc_host *host, struct mmc_data *data)
>>        writeb(ctrl, &host->reg->hostctl);
>>
>>        /* We do not handle DMA boundaries, so set it to max (512 KiB) */
>> -       writew((7 << 12) | (512 << 0), &host->reg->blksize);
>> +       writew((7 << 12) | (data->blocksize & 0xFFF), &host->reg->blksize);
>>        writew(data->blocks, &host->reg->blkcnt);
>>  }
>>
>> --
>> 1.7.1
>>
>
> applied to u-boot-samsung.

I have sent some patches about mmc and reviewed one, can you please
tell me what to do mainline them?

11 mar :
[PATCH 1/3][v3] mmc: checking status after commands with R1b response
--> it has one Tested-by

[RFC 2/3][v3] mmc: SEND_OP_COND considers card capabilities (voltage)
--> it has one Tested-by
[PATCH 3/3][v3] mmc: trace added --> useful for getting information

23 mar :
[U-Boot] [PATCH] MMC may wrongly regconize 2GB eMMC as high capacity
--> I have reviewed and proposed a different, I think better and simpler, way.
There is a curious dependency between capacity and high_capacity variables.

Regards,
Raffaele
Minkyu Kang April 3, 2011, 2:49 p.m. UTC | #3
Dear Raffaele Recalcati,

On 3 April 2011 13:39, Raffaele Recalcati <lamiaposta71@gmail.com> wrote:
> Hi Minkyu,
>
> I have sent some patches about mmc and reviewed one, can you please
> tell me what to do mainline them?
>
> 11 mar :
> [PATCH 1/3][v3] mmc: checking status after commands with R1b response
> --> it has one Tested-by
>
> [RFC 2/3][v3] mmc: SEND_OP_COND considers card capabilities (voltage)
> --> it has one Tested-by
> [PATCH 3/3][v3] mmc: trace added --> useful for getting information
>
> 23 mar :
> [U-Boot] [PATCH] MMC may wrongly regconize 2GB eMMC as high capacity
> --> I have reviewed and proposed a different, I think better and simpler, way.
> There is a curious dependency between capacity and high_capacity variables.
>

I'm not a maintainer of mmc.
Please ask to Andy Fleming.

Andy,
could you please check Raffaele's patches?

Thanks
Minkyu Kang.
diff mbox

Patch

diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
index 195b5be..0323800 100644
--- a/drivers/mmc/s5p_mmc.c
+++ b/drivers/mmc/s5p_mmc.c
@@ -51,7 +51,7 @@  static void mmc_prepare_data(struct mmc_host *host, struct mmc_data *data)
 	writeb(ctrl, &host->reg->hostctl);
 
 	/* We do not handle DMA boundaries, so set it to max (512 KiB) */
-	writew((7 << 12) | (512 << 0), &host->reg->blksize);
+	writew((7 << 12) | (data->blocksize & 0xFFF), &host->reg->blksize);
 	writew(data->blocks, &host->reg->blkcnt);
 }