]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
mmc: emmc and hw partitions partition table id bugfix.
authorErik Tideman <erik.tideman@faltcom.se>
Mon, 11 Jan 2016 13:39:07 +0000 (13:39 +0000)
committerTom Rini <trini@konsulko.com>
Wed, 20 Jan 2016 15:19:19 +0000 (10:19 -0500)
On bootup the emmc's hw partition is always set to 0 and the partition
table is read from it. When switching to another hw partition the
partition table's id is not updated but instead the old one from
hw partition 0 is used. If there is no partition table on hw partition 0
then the code will terminate and return error even if the desired hw
partition contains a perfectly fine partition table. This fix updates
the partition table struct to correspond to the specified hw partition
before testing if the partition table is valid or not.

Signed-off-by: Erik Tideman <erik.tideman@faltcom.se>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Squash the patch that corrected whitespace in the original into
this one, wrap with HAVE_BLOCK_DEVICE test]
Signed-off-by: Tom Rini <trini@konsulko.com>
disk/part.c

index 909712e5011932dfe9acfff008ca58e145ade1f2..1935b28841011268cf6451594120a6e126f09d16 100644 (file)
@@ -493,6 +493,16 @@ int get_device(const char *ifname, const char *dev_hwpart_str,
                goto cleanup;
        }
 
+#ifdef HAVE_BLOCK_DEVICE
+       /*
+        * Updates the partition table for the specified hw partition.
+        * Does not need to be done for hwpart 0 since it is default and
+        * already loaded.
+        */
+       if(hwpart != 0)
+               init_part(*dev_desc);
+#endif
+
 cleanup:
        free(dup_str);
        return dev;