blk: set log2blksz in blk_create_device()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 25 Oct 2019 10:15:31 +0000 (12:15 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 30 Oct 2019 16:49:40 +0000 (17:49 +0100)
The ext4 file system requires log2blksz to be set. So when setting the
block size on the block descriptor we should fill this field too.

This fixes a problem with EFI block devices providing ext4 partitions, cf.
https://lists.denx.de/pipermail/u-boot/2019-October/387702.html.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/block/blk-uclass.c

index e8f58b3f5e471b815c619a0a091fab87d5e7d762..ca8978f0e1404a437f7ed5e15a6386cf99b5aa71 100644 (file)
@@ -580,6 +580,7 @@ int blk_create_device(struct udevice *parent, const char *drv_name,
        desc = dev_get_uclass_platdata(dev);
        desc->if_type = if_type;
        desc->blksz = blksz;
+       desc->log2blksz = LOG2(desc->blksz);
        desc->lba = lba;
        desc->part_type = PART_TYPE_UNKNOWN;
        desc->bdev = dev;