diff mbox

[v2] mmc: meson-gx: set max block count

Message ID 0309625d-e24b-13e1-bba7-ada6b5a202c1@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Heiner Kallweit Jan. 28, 2017, 8:25 a.m. UTC
So far max_blk_count isn't set what results in a default of value 8
to be used (PAGE_SIZE / block size).

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v2:
- block length field has 9 bits, so set max_blk_count to 2^9-1 = 511
- in addition set max_req_size because max_blk_count is also limited
  by max_req_size / block_size
---
 drivers/mmc/host/meson-gx-mmc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kevin Hilman Jan. 30, 2017, 4:58 p.m. UTC | #1
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).

This describes the problem...
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> v2:
> - block length field has 9 bits, so set max_blk_count to 2^9-1 = 511
> - in addition set max_req_size because max_blk_count is also limited
>   by max_req_size / block_size

... and this part describes the fix, so should also be in the changelog.

with an updated changelog, feel free to add:

Acked-by: Kevin Hilman <khilman@baylibre.com>

Kevin

> ---
>  drivers/mmc/host/meson-gx-mmc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index 83361f1f..d4d174ed 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -810,6 +810,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
>  		goto free_host;
>  	}
>  
> +	mmc->max_blk_count = CMD_CFG_LENGTH_MASK;
> +	mmc->max_req_size = mmc->max_blk_count * mmc->max_blk_size;
>  	mmc->ops = &meson_mmc_ops;
>  	mmc_add_host(mmc);
diff mbox

Patch

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 83361f1f..d4d174ed 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -810,6 +810,8 @@  static int meson_mmc_probe(struct platform_device *pdev)
 		goto free_host;
 	}
 
+	mmc->max_blk_count = CMD_CFG_LENGTH_MASK;
+	mmc->max_req_size = mmc->max_blk_count * mmc->max_blk_size;
 	mmc->ops = &meson_mmc_ops;
 	mmc_add_host(mmc);