* [PATCH] mmc: meson-gx: set max block count to 256
@ 2017-01-26 22:09 ` Heiner Kallweit
0 siblings, 0 replies; 8+ messages in thread
From: Heiner Kallweit @ 2017-01-26 22:09 UTC (permalink / raw)
To: linux-arm-kernel
So far max_blk_count isn't set what results in a default of value 8
to be used (PAGE_SIZE / block size).
Set max_blk_count to 256 as used in the uboot driver.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/mmc/host/meson-gx-mmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 3308b5b6..030425be 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -799,6 +799,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
goto free_host;
}
+ mmc->max_blk_count = 256;
mmc->ops = &meson_mmc_ops;
mmc_add_host(mmc);
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] mmc: meson-gx: set max block count to 256
@ 2017-01-26 22:09 ` Heiner Kallweit
0 siblings, 0 replies; 8+ messages in thread
From: Heiner Kallweit @ 2017-01-26 22:09 UTC (permalink / raw)
To: linus-amlogic
So far max_blk_count isn't set what results in a default of value 8
to be used (PAGE_SIZE / block size).
Set max_blk_count to 256 as used in the uboot driver.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/mmc/host/meson-gx-mmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 3308b5b6..030425be 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -799,6 +799,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
goto free_host;
}
+ mmc->max_blk_count = 256;
mmc->ops = &meson_mmc_ops;
mmc_add_host(mmc);
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] mmc: meson-gx: set max block count to 256
2017-01-26 22:09 ` Heiner Kallweit
@ 2017-01-27 18:28 ` Kevin Hilman
-1 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2017-01-27 18:28 UTC (permalink / raw)
To: linux-arm-kernel
Heiner Kallweit <hkallweit1@gmail.com> writes:
> So far max_blk_count isn't set what results in a default of value 8
> to be used (PAGE_SIZE / block size).
>
> Set max_blk_count to 256 as used in the uboot driver.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Thanks for the patch. A minor comment below:
> ---
> drivers/mmc/host/meson-gx-mmc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index 3308b5b6..030425be 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -799,6 +799,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
> goto free_host;
> }
>
> + mmc->max_blk_count = 256;
A step in the right direction, but the # blocks is actually a 9-bit
field (c.f. length field of cmd_cfg part of descriptor (bits 8:0).
So this should be more like:
/* blk count is 'length' field of cmd_cfg part of descriptor */
mmc->max_blk_count = CMD_CFG_LENGTH_MASK + 1;
I tested that change locally, so after changing that, please resend and
feel free to add:
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] mmc: meson-gx: set max block count to 256
@ 2017-01-27 18:28 ` Kevin Hilman
0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2017-01-27 18:28 UTC (permalink / raw)
To: linus-amlogic
Heiner Kallweit <hkallweit1@gmail.com> writes:
> So far max_blk_count isn't set what results in a default of value 8
> to be used (PAGE_SIZE / block size).
>
> Set max_blk_count to 256 as used in the uboot driver.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Thanks for the patch. A minor comment below:
> ---
> drivers/mmc/host/meson-gx-mmc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index 3308b5b6..030425be 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -799,6 +799,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
> goto free_host;
> }
>
> + mmc->max_blk_count = 256;
A step in the right direction, but the # blocks is actually a 9-bit
field (c.f. length field of cmd_cfg part of descriptor (bits 8:0).
So this should be more like:
/* blk count is 'length' field of cmd_cfg part of descriptor */
mmc->max_blk_count = CMD_CFG_LENGTH_MASK + 1;
I tested that change locally, so after changing that, please resend and
feel free to add:
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] mmc: meson-gx: set max block count to 256
2017-01-27 18:28 ` Kevin Hilman
@ 2017-01-28 8:18 ` Heiner Kallweit
-1 siblings, 0 replies; 8+ messages in thread
From: Heiner Kallweit @ 2017-01-28 8:18 UTC (permalink / raw)
To: linux-arm-kernel
Am 27.01.2017 um 19:28 schrieb Kevin Hilman:
> Heiner Kallweit <hkallweit1@gmail.com> writes:
>
>> So far max_blk_count isn't set what results in a default of value 8
>> to be used (PAGE_SIZE / block size).
>>
>> Set max_blk_count to 256 as used in the uboot driver.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>
> Thanks for the patch. A minor comment below:
>
>> ---
>> drivers/mmc/host/meson-gx-mmc.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
>> index 3308b5b6..030425be 100644
>> --- a/drivers/mmc/host/meson-gx-mmc.c
>> +++ b/drivers/mmc/host/meson-gx-mmc.c
>> @@ -799,6 +799,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
>> goto free_host;
>> }
>>
>> + mmc->max_blk_count = 256;
>
> A step in the right direction, but the # blocks is actually a 9-bit
> field (c.f. length field of cmd_cfg part of descriptor (bits 8:0).
>
> So this should be more like:
>
> /* blk count is 'length' field of cmd_cfg part of descriptor */
> mmc->max_blk_count = CMD_CFG_LENGTH_MASK + 1;
>
> I tested that change locally, so after changing that, please resend and
> feel free to add:
>
max_blk_count = 0 means unlimited number of blocks. Therefore I think
we have to go with: mmc->max_blk_count = CMD_CFG_LENGTH_MASK
And I figured out later that we also have to set mmc->max_req_size.
In my tests the system never read / wrote more than 8 blocks in a row,
most likely because the upper block layers use 4k blocks.
Therefore setting max_blk_count doesn't really provide a benefit but
I think it's cleaner to expose the actual chip limit.
Rgds, Heiner
> Reviewed-by: Kevin Hilman <khilman@baylibre.com>
> Tested-by: Kevin Hilman <khilman@baylibre.com>
>
> Kevin
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] mmc: meson-gx: set max block count to 256
@ 2017-01-28 8:18 ` Heiner Kallweit
0 siblings, 0 replies; 8+ messages in thread
From: Heiner Kallweit @ 2017-01-28 8:18 UTC (permalink / raw)
To: linus-amlogic
Am 27.01.2017 um 19:28 schrieb Kevin Hilman:
> Heiner Kallweit <hkallweit1@gmail.com> writes:
>
>> So far max_blk_count isn't set what results in a default of value 8
>> to be used (PAGE_SIZE / block size).
>>
>> Set max_blk_count to 256 as used in the uboot driver.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>
> Thanks for the patch. A minor comment below:
>
>> ---
>> drivers/mmc/host/meson-gx-mmc.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
>> index 3308b5b6..030425be 100644
>> --- a/drivers/mmc/host/meson-gx-mmc.c
>> +++ b/drivers/mmc/host/meson-gx-mmc.c
>> @@ -799,6 +799,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
>> goto free_host;
>> }
>>
>> + mmc->max_blk_count = 256;
>
> A step in the right direction, but the # blocks is actually a 9-bit
> field (c.f. length field of cmd_cfg part of descriptor (bits 8:0).
>
> So this should be more like:
>
> /* blk count is 'length' field of cmd_cfg part of descriptor */
> mmc->max_blk_count = CMD_CFG_LENGTH_MASK + 1;
>
> I tested that change locally, so after changing that, please resend and
> feel free to add:
>
max_blk_count = 0 means unlimited number of blocks. Therefore I think
we have to go with: mmc->max_blk_count = CMD_CFG_LENGTH_MASK
And I figured out later that we also have to set mmc->max_req_size.
In my tests the system never read / wrote more than 8 blocks in a row,
most likely because the upper block layers use 4k blocks.
Therefore setting max_blk_count doesn't really provide a benefit but
I think it's cleaner to expose the actual chip limit.
Rgds, Heiner
> Reviewed-by: Kevin Hilman <khilman@baylibre.com>
> Tested-by: Kevin Hilman <khilman@baylibre.com>
>
> Kevin
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] mmc: meson-gx: set max block count to 256
2017-01-28 8:18 ` Heiner Kallweit
@ 2017-01-30 16:53 ` Kevin Hilman
-1 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2017-01-30 16:53 UTC (permalink / raw)
To: linux-arm-kernel
Heiner Kallweit <hkallweit1@gmail.com> writes:
> Am 27.01.2017 um 19:28 schrieb Kevin Hilman:
>> Heiner Kallweit <hkallweit1@gmail.com> writes:
>>
>>> So far max_blk_count isn't set what results in a default of value 8
>>> to be used (PAGE_SIZE / block size).
>>>
>>> Set max_blk_count to 256 as used in the uboot driver.
>>>
>>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>>
>> Thanks for the patch. A minor comment below:
>>
>>> ---
>>> drivers/mmc/host/meson-gx-mmc.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
>>> index 3308b5b6..030425be 100644
>>> --- a/drivers/mmc/host/meson-gx-mmc.c
>>> +++ b/drivers/mmc/host/meson-gx-mmc.c
>>> @@ -799,6 +799,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
>>> goto free_host;
>>> }
>>>
>>> + mmc->max_blk_count = 256;
>>
>> A step in the right direction, but the # blocks is actually a 9-bit
>> field (c.f. length field of cmd_cfg part of descriptor (bits 8:0).
>>
>> So this should be more like:
>>
>> /* blk count is 'length' field of cmd_cfg part of descriptor */
>> mmc->max_blk_count = CMD_CFG_LENGTH_MASK + 1;
>>
>> I tested that change locally, so after changing that, please resend and
>> feel free to add:
>>
> max_blk_count = 0 means unlimited number of blocks. Therefore I think
> we have to go with: mmc->max_blk_count = CMD_CFG_LENGTH_MASK
Ah, yes. Good catch.
Kevin
> And I figured out later that we also have to set mmc->max_req_size.
>
> In my tests the system never read / wrote more than 8 blocks in a row,
> most likely because the upper block layers use 4k blocks.
>
> Therefore setting max_blk_count doesn't really provide a benefit but
> I think it's cleaner to expose the actual chip limit.
>
>
>> Reviewed-by: Kevin Hilman <khilman@baylibre.com>
>> Tested-by: Kevin Hilman <khilman@baylibre.com>
>>
>> Kevin
>>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] mmc: meson-gx: set max block count to 256
@ 2017-01-30 16:53 ` Kevin Hilman
0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2017-01-30 16:53 UTC (permalink / raw)
To: linus-amlogic
Heiner Kallweit <hkallweit1@gmail.com> writes:
> Am 27.01.2017 um 19:28 schrieb Kevin Hilman:
>> Heiner Kallweit <hkallweit1@gmail.com> writes:
>>
>>> So far max_blk_count isn't set what results in a default of value 8
>>> to be used (PAGE_SIZE / block size).
>>>
>>> Set max_blk_count to 256 as used in the uboot driver.
>>>
>>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>>
>> Thanks for the patch. A minor comment below:
>>
>>> ---
>>> drivers/mmc/host/meson-gx-mmc.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
>>> index 3308b5b6..030425be 100644
>>> --- a/drivers/mmc/host/meson-gx-mmc.c
>>> +++ b/drivers/mmc/host/meson-gx-mmc.c
>>> @@ -799,6 +799,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
>>> goto free_host;
>>> }
>>>
>>> + mmc->max_blk_count = 256;
>>
>> A step in the right direction, but the # blocks is actually a 9-bit
>> field (c.f. length field of cmd_cfg part of descriptor (bits 8:0).
>>
>> So this should be more like:
>>
>> /* blk count is 'length' field of cmd_cfg part of descriptor */
>> mmc->max_blk_count = CMD_CFG_LENGTH_MASK + 1;
>>
>> I tested that change locally, so after changing that, please resend and
>> feel free to add:
>>
> max_blk_count = 0 means unlimited number of blocks. Therefore I think
> we have to go with: mmc->max_blk_count = CMD_CFG_LENGTH_MASK
Ah, yes. Good catch.
Kevin
> And I figured out later that we also have to set mmc->max_req_size.
>
> In my tests the system never read / wrote more than 8 blocks in a row,
> most likely because the upper block layers use 4k blocks.
>
> Therefore setting max_blk_count doesn't really provide a benefit but
> I think it's cleaner to expose the actual chip limit.
>
>
>> Reviewed-by: Kevin Hilman <khilman@baylibre.com>
>> Tested-by: Kevin Hilman <khilman@baylibre.com>
>>
>> Kevin
>>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-01-30 16:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 22:09 [PATCH] mmc: meson-gx: set max block count to 256 Heiner Kallweit
2017-01-26 22:09 ` Heiner Kallweit
2017-01-27 18:28 ` Kevin Hilman
2017-01-27 18:28 ` Kevin Hilman
2017-01-28 8:18 ` Heiner Kallweit
2017-01-28 8:18 ` Heiner Kallweit
2017-01-30 16:53 ` Kevin Hilman
2017-01-30 16:53 ` Kevin Hilman
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.