Skip to contentSkip to conversation

mmc: Fix partition table init regression

PATCH New Andre Przywara 6 participants 13 messages Dec 17, 2018 – Jan 10, 2019

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

cover mmc: Fix partition table init regression

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") in the 2019.01-rc1 merge window moved the partition init call to the generic DM layer, leaving every non-DM driver behind. As the result all Allwinner boards now don't read the partition table automatically anymore:
=> fatls mmc 0
** Unrecognized filesystem type **
=> fatload mmc 0 $kernel_addr_r Image-4.20-rc3
** Unrecognized filesystem type **

A quick workaround is to explicitly read the partition table, but this is still a regression, as it breaks existing scripts and workflows:
==========
=> mmc part

Partition Map for MMC device 0 -- Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     8192            30873600        00000000-01     0c

=> fatls mmc 0
852304 xen
23544320 Image-4.20-rc3

2 file(s), 0 dir(s)
==========

These two patches are the minimal version to fix this problem, by bringing the implicit part_init() call back just for non-DM MMC drivers. Patch 1 is needed to keep the H6 SPL below the size limit.

The whole SPL_LIBDISK_SUPPORT symbol is now somewhat obsolete and needs some proper fixing, but this needs more discussion and testing and is probably nothing for this release still.

Thanks,
Andre.

Andre Przywara (2):
sunxi: drop default SPL_LIBDISK_SUPPORT enablement
mmc: bring back partition init for non-DM MMC drivers

 arch/arm/Kconfig  | 1 -
 drivers/mmc/mmc.c | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.14.5
#1 lore raw

PATCH 1/2 sunxi: drop default SPL_LIBDISK_SUPPORT enablement

There is no code for using partition labels in the Allwinner SPL port. Even so the name is slightly misleading, CONFIG_SPL_LIBDISK_SUPPORT was meant to guard partition code for the SPL.

Remove the "imply" line in the Kconfig to make this obvious and avoid unneeded code inclusions, helping to keep the H6 SPL code small.

---
 arch/arm/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/arm/Kconfig +0 -1
index cb7ec58079..5e1aaf50f1 100644
@@ -874,7 +874,6 @@ config ARCH_SUNXI
 	imply PRE_CONSOLE_BUFFER
 	imply SPL_GPIO_SUPPORT
 	imply SPL_LIBCOMMON_SUPPORT
-	imply SPL_LIBDISK_SUPPORT
 	imply SPL_LIBGENERIC_SUPPORT
 	imply SPL_MMC_SUPPORT if MMC
 	imply SPL_POWER_SUPPORT
Signature · 1 line
2.14.5
#2 lore raw

PATCH 1/2 sunxi: drop default SPL_LIBDISK_SUPPORT enablement

Quoted 5 lines · Andre Przywara

There is no code for using partition labels in the Allwinner SPL port. Even so the name is slightly misleading, CONFIG_SPL_LIBDISK_SUPPORT was meant to guard partition code for the SPL.

Quoted 7 lines

Remove the "imply" line in the Kconfig to make this obvious and avoid unneeded code inclusions, helping to keep the H6 SPL code small.

---
 arch/arm/Kconfig | 1 -
 1 file changed, 1 deletion(-)
#3 lore raw

PATCH 1/2 sunxi: drop default SPL_LIBDISK_SUPPORT enablement

In reply to Andre Przywara
Quoted 9 lines · Andre Przywara

There is no code for using partition labels in the Allwinner SPL port. Even so the name is slightly misleading, CONFIG_SPL_LIBDISK_SUPPORT was meant to guard partition code for the SPL.

Remove the "imply" line in the Kconfig to make this obvious and avoid unneeded code inclusions, helping to keep the H6 SPL code small.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190109/33387f79/attachment.sig>
#4 lore raw

PATCH 2/2 mmc: bring back partition init for non-DM MMC drivers

In reply to Andre Przywara

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework.
However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information.

Bring the call back just for non-DM MMC driver to fix this regression.

---
 drivers/mmc/mmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/mmc.c +4 -0
index f5c821e308..d858127132 100644
@@ -2449,6 +2449,10 @@ static int mmc_startup(struct mmc *mmc)
 	bdesc->revision[0] = 0;
 #endif
 
+#if !defined(CONFIG_DM_MMC) && (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT))
+	part_init(bdesc);
+#endif
+
 	return 0;
 }
 
Signature · 1 line
2.14.5
#5 lore raw

PATCH 2/2 mmc: bring back partition init for non-DM MMC drivers

Quoted 8 lines · Andre Przywara

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework.
However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information.

Quoted 6 lines

Bring the call back just for non-DM MMC driver to fix this regression.

---
 drivers/mmc/mmc.c | 4 ++++
 1 file changed, 4 insertions(+)
#6 lore raw

PATCH 2/2 mmc: bring back partition init for non-DM MMC drivers

Quoted 8 lines · Simon Glass
Quoted 7 lines · Andre Przywara

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework.
However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information.

Quoted 7 lines
Quoted 6 lines

Bring the call back just for non-DM MMC driver to fix this regression.

---
 drivers/mmc/mmc.c | 4 ++++
 1 file changed, 4 insertions(+)

This also fixes MMC support on a tbs2910 board.

Thanks,
Soeren

#8 lore raw

PATCH 2/2 mmc: bring back partition init for non-DM MMC drivers

In reply to Andre Przywara
Quoted 21 lines · Andre Przywara

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework.
However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information.

Bring the call back just for non-DM MMC driver to fix this regression.

---
 drivers/mmc/mmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/mmc.c +0 -0
index f5c821e308..d858127132 100644

drivers/mmc/mmc.c static int mmc_startup(struct mmc *mmc) · line 2457

Quoted 9 lines
drivers/mmc/mmc.c +4 -0
@@ -2449,6 +2449,10 @@ static int mmc_startup(struct mmc *mmc)
 	bdesc->revision[0] = 0;
 #endif
 
+#if !defined(CONFIG_DM_MMC) && (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT))
+	part_init(bdesc);
+#endif
+
 	return 0;
 }

So, this pushes pine_h64 over the limit:
https://travis-ci.org/trini/u-boot/jobs/477078336

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190108/cef95939/attachment.sig>
#9 lore raw

PATCH 2/2 mmc: bring back partition init for non-DM MMC drivers

Quoted 26 lines · Tom Rini
Quoted 24 lines · Andre Przywara

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework.
However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information.

Bring the call back just for non-DM MMC driver to fix this regression.

---
 drivers/mmc/mmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/mmc.c +0 -0
index f5c821e308..d858127132 100644
@@ -2449,6 +2449,10 @@ static int mmc_startup(struct mmc *mmc)
 	bdesc->revision[0] = 0;
 #endif
 
Quoted 9 lines

drivers/mmc/mmc.c static int mmc_startup(struct mmc *mmc) · line 2457

Quoted 6 lines
drivers/mmc/mmc.c +4 -0
+#if !defined(CONFIG_DM_MMC) && (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT))
+	part_init(bdesc);
+#endif
+
 	return 0;
 }

So, this pushes pine_h64 over the limit:
https://travis-ci.org/trini/u-boot/jobs/477078336

It seems you are missing patch 1/2?
https://lists.denx.de/pipermail/u-boot/2018-December/352283.html
(sunxi: drop default SPL_LIBDISK_SUPPORT enablement)

I put this one in for exactly this reason.

I have some other cleanups which reduce the H6 SPL size by 2K, will send them out shortly.

Cheers,
Andre.

#10 lore raw

PATCH 2/2 mmc: bring back partition init for non-DM MMC drivers

Quoted 37 lines · André Przywara
Quoted 26 lines · Tom Rini
Quoted 24 lines · Andre Przywara

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework.
However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information.

Bring the call back just for non-DM MMC driver to fix this regression.

---
 drivers/mmc/mmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/mmc.c +0 -0
index f5c821e308..d858127132 100644
@@ -2449,6 +2449,10 @@ static int mmc_startup(struct mmc *mmc)
 	bdesc->revision[0] = 0;
 #endif
 
Quoted 9 lines

drivers/mmc/mmc.c static int mmc_startup(struct mmc *mmc) · line 2457

Quoted 6 lines
drivers/mmc/mmc.c +4 -0
+#if !defined(CONFIG_DM_MMC) && (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT))
+	part_init(bdesc);
+#endif
+
 	return 0;
 }

So, this pushes pine_h64 over the limit:
https://travis-ci.org/trini/u-boot/jobs/477078336

Quoted 8 lines

It seems you are missing patch 1/2?
https://lists.denx.de/pipermail/u-boot/2018-December/352283.html
(sunxi: drop default SPL_LIBDISK_SUPPORT enablement)

I put this one in for exactly this reason.

I have some other cleanups which reduce the H6 SPL size by 2K, will send them out shortly.

Thanks, I don't know why I thought that was in already.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190109/6c858c62/attachment.sig>
#11 lore raw

PATCH 2/2 mmc: bring back partition init for non-DM MMC drivers

In reply to Andre Przywara
Quoted 7 lines · Andre Przywara

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework.
However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information.

Quoted 5 lines

Bring the call back just for non-DM MMC driver to fix this regression.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190109/b56b140d/attachment.sig>
#12 lore raw

cover mmc: Fix partition table init regression

In reply to Andre Przywara
Quoted 26 lines · Andre Przywara

Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") in the 2019.01-rc1 merge window moved the partition init call to the generic DM layer, leaving every non-DM driver behind. As the result all Allwinner boards now don't read the partition table automatically anymore:
=> fatls mmc 0
** Unrecognized filesystem type **
=> fatload mmc 0 $kernel_addr_r Image-4.20-rc3
** Unrecognized filesystem type **

A quick workaround is to explicitly read the partition table, but this is still a regression, as it breaks existing scripts and workflows:
==========
=> mmc part

Partition Map for MMC device 0 -- Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     8192            30873600        00000000-01     0c

=> fatls mmc 0
852304 xen
23544320 Image-4.20-rc3

2 file(s), 0 dir(s)
==========

Quoted 7 lines

These two patches are the minimal version to fix this problem, by bringing the implicit part_init() call back just for non-DM MMC drivers. Patch 1 is needed to keep the H6 SPL below the size limit.

The whole SPL_LIBDISK_SUPPORT symbol is now somewhat obsolete and needs some proper fixing, but this needs more discussion and testing and is probably nothing for this release still.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181217/fd92fdb6/attachment.sig>