Skip to contentSkip to conversation

imx: spl_imx_romapi: fixes

PATCH In review Marcel Ziswiler 6 participants 17 messages Oct 26, 2023 – Nov 20, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover imx: spl_imx_romapi: fixes

From: Marcel Ziswiler <[email protected]>

The first patch is a trivial spelling fix in comments. The second fixes a recent regression that only manifests in the eMMC fast boot mode case which does actually also use streaming rather than seekable.

Thanks go to Rasmus who helped me debug this and suggested the fix.

@Stefano: This one is also still missing [1]. Thanks!

[1] https://lore.kernel.org/all/[email protected]

Marcel Ziswiler (2):
imx: spl_imx_romapi: fix comment about stream(usb) download failure
imx: spl_imx_romapi: fix emmc fast boot mode case

 arch/arm/mach-imx/spl_imx_romapi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.36.1
#1 lore raw

PATCH 1/2 imx: spl_imx_romapi: fix comment about stream(usb) download failure

From: Marcel Ziswiler <[email protected]>

Fix comment about Stream(USB) download failure.

Fixes 1cbebc786276 ("imx: add rom api support")

---

 arch/arm/mach-imx/spl_imx_romapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-imx/spl_imx_romapi.c +2 -2
index 93d48e56aca..cb220869b50 100644
@@ -285,7 +285,7 @@ static int spl_romapi_load_image_stream(struct spl_image_info *spl_image,
 		ret = rom_api_download_image(p, 0, pg);
 
 		if (ret != ROM_API_OKAY) {
-			puts("Steam(USB) download failure\n");
+			puts("Stream(USB) download failure\n");
 			return -1;
 		}
 
@@ -305,7 +305,7 @@ static int spl_romapi_load_image_stream(struct spl_image_info *spl_image,
 		ret = rom_api_download_image(p, 0, pg);
 
 		if (ret != ROM_API_OKAY) {
-			puts("Steam(USB) download failure\n");
+			puts("Stream(USB) download failure\n");
 			return -1;
 		}
 
Signature · 1 line
2.36.1
#4 lore raw

PATCH 2/2 imx: spl_imx_romapi: fix emmc fast boot mode case

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size")

---

 arch/arm/mach-imx/spl_imx_romapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/spl_imx_romapi.c +1 -1
index cb220869b50..5eb5a3d3c4a 100644
@@ -162,7 +162,7 @@ static ulong spl_romapi_read_stream(struct spl_load_info *load, ulong sector,
 			return 0;
 		}
 
-		ss->end = end;
+		ss->end += bytes;
 	}
 
 	memcpy(buf, (void *)(sector), count);
Signature · 1 line
2.36.1
Acked-by on v1 2/2
#5 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Quoted 12 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Quoted 3 lines
Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size")

Thanks for reporting and fixing this, and sorry for the trouble.

#6 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Quoted 13 lines · Rasmus Villemoes
Quoted 12 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Quoted 8 lines
Quoted 3 lines
Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size")

Thanks for reporting and fixing this, and sorry for the trouble.

And thanks for all your work - I will apply this fix soon.

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#7 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Hi Stefano

Quoted 19 lines · Stefano Babic
Quoted 18 lines · Rasmus Villemoes
Quoted 16 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT

size")

Quoted 6 lines
Quoted 4 lines

Thanks for reporting and fixing this, and sorry for the trouble.

And thanks for all your work - I will apply this fix soon.

Any news on applying this fix? Note that master still stays broken as of today.

Quoted 2 lines

Regards,
Stefano

Cheers

Marcel

#8 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Hi Tom

Quoted 22 lines · Marcel Ziswiler

Hi Stefano

Quoted 19 lines · Stefano Babic
Quoted 18 lines · Rasmus Villemoes
Quoted 16 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT

size")

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Thanks for reporting and fixing this, and sorry for the trouble.

And thanks for all your work - I will apply this fix soon.

Any news on applying this fix? Note that master still stays broken as of today.

And two weeks later still broken!

Anyway, I feel i.MX maintainership seems rather stalled at times most of the time. I don't want to criticise anybody knowing how busy our trade can get. However, if it helps the cause Toradex would be ready to step up. Let me know what you think. Thanks!

Quoted 2 lines
Quoted 2 lines

Regards,
Stefano

Cheers

Marcel

#9 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Quoted 27 lines · Marcel Ziswiler

Hi Tom

Quoted 24 lines · Marcel Ziswiler

Hi Stefano

Quoted 21 lines · Stefano Babic
Quoted 20 lines · Rasmus Villemoes
Quoted 12 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Quoted 4 lines
Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT

size")

Thanks for reporting and fixing this, and sorry for the trouble.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

And thanks for all your work - I will apply this fix soon.

Any news on applying this fix? Note that master still stays broken as of today.

And two weeks later still broken!

I've put this in my not to forget queue for the next -rc.

Quoted 3 lines

Anyway, I feel i.MX maintainership seems rather stalled at times most of the time. I don't want to criticise anybody knowing how busy our trade can get. However, if it helps the cause Toradex would be ready to step up. Let me know what you think. Thanks!

I would be happy to see an additional custodian for the imx tree, if that's agreeable with Stefano.

Signature · 1 line
Tom
#10 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Hi Tom, Marcel,

Quoted 37 lines · Tom Rini
Quoted 27 lines · Marcel Ziswiler

Hi Tom

Quoted 24 lines · Marcel Ziswiler

Hi Stefano

Quoted 21 lines · Stefano Babic
Quoted 20 lines · Rasmus Villemoes
Quoted 12 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Quoted 4 lines
Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT

size")

Thanks for reporting and fixing this, and sorry for the trouble.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

And thanks for all your work - I will apply this fix soon.

Any news on applying this fix? Note that master still stays broken as of today.

And two weeks later still broken!

Quoted 8 lines

I've put this in my not to forget queue for the next -rc.

Quoted 3 lines

Anyway, I feel i.MX maintainership seems rather stalled at times most of the time. I don't want to criticise anybody knowing how busy our trade can get. However, if it helps the cause Toradex would be ready to step up. Let me know what you think. Thanks!

I would be happy to see an additional custodian for the imx tree, if that's agreeable with Stefano.

I have rather less time for U-Boot and it won't be better in the near future. Fabio is co-maintainer and he has accepted to take over the repository and go on maintaining u-boot-imx. Just let him some time to be confident with patchwork and CI.

Thanks,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#11 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Quoted 46 lines · Stefano Babic

Hi Tom, Marcel,

Quoted 43 lines · Tom Rini
Quoted 27 lines · Marcel Ziswiler

Hi Tom

Quoted 24 lines · Marcel Ziswiler

Hi Stefano

Quoted 21 lines · Stefano Babic
Quoted 20 lines · Rasmus Villemoes
Quoted 12 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Quoted 4 lines
Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT

size")

Thanks for reporting and fixing this, and sorry for the trouble.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

And thanks for all your work - I will apply this fix soon.

Any news on applying this fix? Note that master still stays broken as of today.

And two weeks later still broken!

I've put this in my not to forget queue for the next -rc.

Quoted 3 lines

Anyway, I feel i.MX maintainership seems rather stalled at times most of the time. I don't want to criticise anybody knowing how busy our trade can get. However, if it helps the cause Toradex would be ready to step up. Let me know what you think. Thanks!

Quoted 7 lines
Quoted 2 lines

I would be happy to see an additional custodian for the imx tree, if that's agreeable with Stefano.

I have rather less time for U-Boot and it won't be better in the near future. Fabio is co-maintainer and he has accepted to take over the repository and go on maintaining u-boot-imx. Just let him some time to be confident with patchwork and CI.

OK. Fabio, please send me your patchwork username off-list and I'll get you added and you can start managing patches there. I've started using some of the b4 + patchwork integration just recently and it's very nice.

Signature · 1 line
Tom
reviewer
#12 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Hi Tom,

Quoted 3 lines · Tom Rini

OK. Fabio, please send me your patchwork username off-list and I'll get you added and you can start managing patches there. I've started using some of the b4 + patchwork integration just recently and it's very nice.

In the meantime, could you pleas directly apply this series from Marcel?

Thanks

#13 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Quoted 9 lines · Fabio Estevam

Hi Tom,

Quoted 3 lines · Tom Rini

OK. Fabio, please send me your patchwork username off-list and I'll get you added and you can start managing patches there. I've started using some of the b4 + patchwork integration just recently and it's very nice.

In the meantime, could you pleas directly apply this series from Marcel?

I've put it in my list for before the next -rc.

Signature · 1 line
Tom
reviewer Reviewed-by on v1 2/2
#14 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

In reply to Marcel Ziswiler
Quoted 13 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Quoted 2 lines
Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size")

Thanks for testing mainline U-Boot and fixing it:

#15 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

In reply to Marcel Ziswiler
Quoted 12 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Quoted 4 lines
Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#16 lore raw

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

Quoted 14 lines · Tom Rini
Quoted 12 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This fixes a regression in the eMMC fast boot mode case where the buffer was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor the current read, rounds that up to the ss->pagesize [which is a no-op in the USB download case because that has ->pagesize==1], fetches that many bytes, but then recorded the original upper bound as the new end of the valid data. However, this did not take into account the rounding up to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Quoted 6 lines
Quoted 4 lines
Fixes 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size")

Applied to u-boot/master, thanks!

Finally our weekly master/upstream CI is passing on all i.MX 8M Plus SKUs again!

Thanks!

Cheers

Marcel