From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] efi_driver: set block size for EFI block device
Date: Fri, 25 Oct 2019 13:34:05 +0900 [thread overview]
Message-ID: <20191025043404.GH10448@linaro.org> (raw)
In-Reply-To: <20191024204900.30188-1-xypron.glpk@gmx.de>
On Thu, Oct 24, 2019 at 08:49:00PM +0000, Heinrich Schuchardt wrote:
> Copy the block size from the block IO protocol to the U-Boot block device
> descriptor. This information is used by the ext4 file system driver.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> lib/efi_driver/efi_block_device.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c
> index cf02341931..9de526a95b 100644
> --- a/lib/efi_driver/efi_block_device.c
> +++ b/lib/efi_driver/efi_block_device.c
> @@ -137,6 +137,7 @@ static int efi_bl_bind(efi_handle_t handle, void *interface)
> struct efi_block_io *io = interface;
> int disks;
> struct efi_blk_platdata *platdata;
> + struct blk_desc *desc;
>
> EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io);
>
> @@ -174,6 +175,11 @@ static int efi_bl_bind(efi_handle_t handle, void *interface)
> return ret;
> EFI_PRINT("%s: block device '%s' created\n", __func__, bdev->name);
>
> + /* Set block size */
> + desc = dev_get_uclass_platdata(bdev);
> + desc->blksz = io->media->block_size;
> + desc->log2blksz = LOG2(desc->blksz);
I don't think that this is the best place to put them.
Better to initialise log2blksz in blk_create_device().
-Takahiro Akashi
> /* Create handles for the partions of the block device */
> disks = efi_bl_bind_partitions(handle, bdev);
> EFI_PRINT("Found %d partitions\n", disks);
> --
> 2.20.1
>
next prev parent reply other threads:[~2019-10-25 4:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 20:49 [U-Boot] [PATCH 1/1] efi_driver: set block size for EFI block device Heinrich Schuchardt
2019-10-25 4:34 ` AKASHI Takahiro [this message]
2019-10-25 6:37 ` Heinrich Schuchardt
2019-10-25 6:54 ` AKASHI Takahiro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191025043404.GH10448@linaro.org \
--to=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox