mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mmc: fix calculation of Max Enhanced Area
@ 2023-03-23 13:42 Schoyswohl, Roland
  2023-03-24 12:21 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Schoyswohl, Roland @ 2023-03-23 13:42 UTC (permalink / raw)
  To: barebox

According extcsd documentation, the HC_ERASE_GRP_SIZE must be multiplied by
HC_ERASE_GRP_SIZE and not added.

Signed-off-by: Roland Schoyswohl roland.schoyswohl@ife-doors.com
---
commands/mmc_extcsd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c
index 7ae068348d..f67c48404a 100644
--- a/commands/mmc_extcsd.c
+++ b/commands/mmc_extcsd.c
@@ -1427,7 +1427,7 @@ static int print_field(u8 *reg, int index)

            case EXT_CSD_MAX_ENH_SIZE_MULT:
                       tmp = get_field_val(EXT_CSD_HC_WP_GRP_SIZE, 0, 0xFF);
-                      tmp = tmp + get_field_val(EXT_CSD_HC_ERASE_GRP_SIZE, 0, 0xFF);
+                      tmp = tmp * get_field_val(EXT_CSD_HC_ERASE_GRP_SIZE, 0, 0xFF);
                       tmp64 *= tmp;
                       tmp64 *= SZ_512K;
                       printf("\tMax Enhanced Area: %llu B\n", tmp64);
--
2.25.1


Knorr-Bremse GmbH
FN 38565p, LG Wr. Neustadt

This transmission is intended solely for the addressee and contains confidential information.
If you are not the intended recipient, please immediately inform the sender and delete the message and any attachments from your system.
Furthermore, please do not copy the message or disclose the contents to anyone unless agreed otherwise. To the extent permitted by law we shall in no way be liable for any damages, whatever their nature, arising out of transmission failures, viruses, external influence, delays and the like.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: fix calculation of Max Enhanced Area
  2023-03-23 13:42 [PATCH] mmc: fix calculation of Max Enhanced Area Schoyswohl, Roland
@ 2023-03-24 12:21 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-03-24 12:21 UTC (permalink / raw)
  To: Schoyswohl, Roland; +Cc: barebox

Hi Roland,

On Thu, Mar 23, 2023 at 01:42:46PM +0000, Schoyswohl, Roland wrote:
> According extcsd documentation, the HC_ERASE_GRP_SIZE must be multiplied by
> HC_ERASE_GRP_SIZE and not added.
> 
> Signed-off-by: Roland Schoyswohl roland.schoyswohl@ife-doors.com
> ---
> commands/mmc_extcsd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Your patch has tabs converted to whitespaces so doesn't apply. I fixed
this up manually this time.

Sascha

> 
> diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c
> index 7ae068348d..f67c48404a 100644
> --- a/commands/mmc_extcsd.c
> +++ b/commands/mmc_extcsd.c
> @@ -1427,7 +1427,7 @@ static int print_field(u8 *reg, int index)
> 
>             case EXT_CSD_MAX_ENH_SIZE_MULT:
>                        tmp = get_field_val(EXT_CSD_HC_WP_GRP_SIZE, 0, 0xFF);
> -                      tmp = tmp + get_field_val(EXT_CSD_HC_ERASE_GRP_SIZE, 0, 0xFF);
> +                      tmp = tmp * get_field_val(EXT_CSD_HC_ERASE_GRP_SIZE, 0, 0xFF);
>                        tmp64 *= tmp;
>                        tmp64 *= SZ_512K;
>                        printf("\tMax Enhanced Area: %llu B\n", tmp64);
> --
> 2.25.1
> 
> 
> Knorr-Bremse GmbH
> FN 38565p, LG Wr. Neustadt
> 
> This transmission is intended solely for the addressee and contains confidential information.
> If you are not the intended recipient, please immediately inform the sender and delete the message and any attachments from your system.
> Furthermore, please do not copy the message or disclose the contents to anyone unless agreed otherwise. To the extent permitted by law we shall in no way be liable for any damages, whatever their nature, arising out of transmission failures, viruses, external influence, delays and the like.
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-24 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 13:42 [PATCH] mmc: fix calculation of Max Enhanced Area Schoyswohl, Roland
2023-03-24 12:21 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox