All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] efi_loader: disk: Fix CONFIG_BLK breakage
Date: Wed, 10 Aug 2016 15:02:39 +0200	[thread overview]
Message-ID: <57AB25EF.3090804@suse.de> (raw)
In-Reply-To: <CAPnjgZ3vMn=0wTKR-STaA2KKkvMtn8Gyg3y-pT5ZcbUq527Vrw@mail.gmail.com>

On 08/10/2016 02:56 PM, Simon Glass wrote:
> +Tom
>
> Hi Alex,
>
> On 10 August 2016 at 01:47, Alexander Graf <agraf@suse.de> wrote:
>>> On 08 Aug 2016, at 23:44, Simon Glass <sjg@chromium.org> wrote:
>>>
>>> Hi Alexander,
>>>
>>> On 5 August 2016 at 06:49, Alexander Graf <agraf@suse.de> wrote:
>>>> When using CONFIG_BLK, there were 2 issues:
>>>>
>>>>   1) The name we generate the device with has to match the
>>>>      name we set in efi_set_bootdev()
>>>>
>>>>   2) The device we pass into our block functions was wrong,
>>>>      we should not rediscover it but just use the already known
>>>>      pointer.
>>>>
>>>> This patch fixes both issues.
>>>>
>>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>>> ---
>>>> cmd/bootefi.c             | 23 ++++++++++++++++++-----
>>>> lib/efi_loader/efi_disk.c | 18 +++++++++++-------
>>>> 2 files changed, 29 insertions(+), 12 deletions(-)
>>>>
> [...]
>
>>>> diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
>>>> index c434c92..e00a747 100644
>>>> --- a/lib/efi_loader/efi_disk.c
>>>> +++ b/lib/efi_loader/efi_disk.c
>>>> @@ -31,6 +31,8 @@ struct efi_disk_obj {
>>>>         struct efi_device_path_file_path *dp;
>>>>         /* Offset into disk for simple partitions */
>>>>         lbaint_t offset;
>>>> +       /* Internal block device */
>>>> +       const struct blk_desc *desc;
>>> Rather than storing this, can you store the udevice?
>> I could, but then I would diverge between the CONFIG_BLK and non-CONFIG_BLK path again, which would turn the code into an #ifdef mess (read: hard to maintain), because the whole device creation path relies on struct blk_desc * today and doesn?t pass the udevice anywhere.
>>
>> Do you feel strongly about this? To give you an idea how messy it gets, the diff is below.
> Actually I'd like to make this feature depend on CONFIG_BLK. If we add
> new features that don't use driver model, and then use the legacy data
> structures such that converting to driver model becomes harder, we'll
> never be done.
>
> I did mention this at the beginning and it seems to have come to pass.
>
> In order of preference from my side:
>
> 1. Make EFI_LOADER depend on BLK

If we make EFI_LOADER depend on BLK, doesn't that break all systems that 
need storage that isn't converted to device model today? Like the SATA 
breakage on Xilinx systems, just at a much bigger scale?


Alex

  reply	other threads:[~2016-08-10 13:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05 12:49 [U-Boot] [PATCH] efi_loader: disk: Fix CONFIG_BLK breakage Alexander Graf
2016-08-08 21:44 ` Simon Glass
2016-08-10  1:43   ` Tom Rini
2016-08-10  7:47   ` Alexander Graf
2016-08-10 12:56     ` Simon Glass
2016-08-10 13:02       ` Alexander Graf [this message]
2016-08-10 13:16         ` Simon Glass
2016-08-10 13:25           ` Alexander Graf
2016-08-10 13:33             ` Simon Glass
2016-08-10 13:41               ` Alexander Graf
2016-08-10 13:47                 ` Simon Glass
2016-08-10 16:25             ` Tom Rini
2016-08-10 19:01               ` Alexander Graf
2016-08-12 17:20                 ` Simon Glass
2016-08-12 18:19                   ` Alexander Graf
2016-08-19 18:14                     ` Tom Rini
2016-08-22  4:22                       ` Alexander Graf
2016-08-22 15:56                         ` Tom Rini
2016-08-10  0:46 ` [U-Boot] " Tom Rini

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=57AB25EF.3090804@suse.de \
    --to=agraf@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.