All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] boot: set correct block device name in set_efi_bootdev()
@ 2024-08-07  0:13 Heinrich Schuchardt
  2024-08-07  6:44 ` Mattijs Korpershoek
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Heinrich Schuchardt @ 2024-08-07  0:13 UTC (permalink / raw)
  To: Ilias Apalodimas
  Cc: Simon Glass, Shantur Rathore, Mattijs Korpershoek,
	AKASHI Takahiro, u-boot, Heinrich Schuchardt

For SATA devices the class name is 'ahci' but the block device name is
'sata'.

Use function blk_get_uclass_name() to retrieve the correct string.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 boot/bootmeth_efi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
index 39232eb2e25..6b41c0999f1 100644
--- a/boot/bootmeth_efi.c
+++ b/boot/bootmeth_efi.c
@@ -100,11 +100,10 @@ static void set_efi_bootdev(struct blk_desc *desc, struct bootflow *bflow)
 	if (last_slash)
 		*last_slash = '\0';
 
-	log_debug("setting bootdev %s, %s, %s, %p, %x\n",
-		  dev_get_uclass_name(media_dev), devnum_str, bflow->fname,
-		  bflow->buf, size);
 	dev_name = device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE ?
-		 "usb" : dev_get_uclass_name(media_dev);
+		 "usb" : blk_get_uclass_name(device_get_uclass_id(media_dev));
+	log_debug("setting bootdev %s, %s, %s, %p, %x\n",
+		  dev_name, devnum_str, bflow->fname, bflow->buf, size);
 	efi_set_bootdev(dev_name, devnum_str, bflow->fname, bflow->buf, size);
 }
 
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] boot: set correct block device name in set_efi_bootdev()
  2024-08-07  0:13 [PATCH 1/1] boot: set correct block device name in set_efi_bootdev() Heinrich Schuchardt
@ 2024-08-07  6:44 ` Mattijs Korpershoek
  2024-08-07  6:57 ` Ilias Apalodimas
  2024-08-07 14:36 ` Simon Glass
  2 siblings, 0 replies; 7+ messages in thread
From: Mattijs Korpershoek @ 2024-08-07  6:44 UTC (permalink / raw)
  To: Heinrich Schuchardt, Ilias Apalodimas
  Cc: Simon Glass, Shantur Rathore, AKASHI Takahiro, u-boot,
	Heinrich Schuchardt

Hi Heinrich,

Thank you for the patch.

On mer., août 07, 2024 at 02:13, Heinrich Schuchardt <heinrich.schuchardt@canonical.com> wrote:

> For SATA devices the class name is 'ahci' but the block device name is
> 'sata'.
>
> Use function blk_get_uclass_name() to retrieve the correct string.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  boot/bootmeth_efi.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
> index 39232eb2e25..6b41c0999f1 100644
> --- a/boot/bootmeth_efi.c
> +++ b/boot/bootmeth_efi.c
> @@ -100,11 +100,10 @@ static void set_efi_bootdev(struct blk_desc *desc, struct bootflow *bflow)
>  	if (last_slash)
>  		*last_slash = '\0';
>  
> -	log_debug("setting bootdev %s, %s, %s, %p, %x\n",
> -		  dev_get_uclass_name(media_dev), devnum_str, bflow->fname,
> -		  bflow->buf, size);
>  	dev_name = device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE ?
> -		 "usb" : dev_get_uclass_name(media_dev);
> +		 "usb" : blk_get_uclass_name(device_get_uclass_id(media_dev));
> +	log_debug("setting bootdev %s, %s, %s, %p, %x\n",
> +		  dev_name, devnum_str, bflow->fname, bflow->buf, size);
>  	efi_set_bootdev(dev_name, devnum_str, bflow->fname, bflow->buf, size);
>  }
>  
> -- 
> 2.45.2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] boot: set correct block device name in set_efi_bootdev()
  2024-08-07  0:13 [PATCH 1/1] boot: set correct block device name in set_efi_bootdev() Heinrich Schuchardt
  2024-08-07  6:44 ` Mattijs Korpershoek
@ 2024-08-07  6:57 ` Ilias Apalodimas
  2024-08-07 14:36 ` Simon Glass
  2 siblings, 0 replies; 7+ messages in thread
From: Ilias Apalodimas @ 2024-08-07  6:57 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: Simon Glass, Shantur Rathore, Mattijs Korpershoek,
	AKASHI Takahiro, u-boot

On Wed, 7 Aug 2024 at 03:13, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> For SATA devices the class name is 'ahci' but the block device name is
> 'sata'.
>
> Use function blk_get_uclass_name() to retrieve the correct string.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  boot/bootmeth_efi.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
> index 39232eb2e25..6b41c0999f1 100644
> --- a/boot/bootmeth_efi.c
> +++ b/boot/bootmeth_efi.c
> @@ -100,11 +100,10 @@ static void set_efi_bootdev(struct blk_desc *desc, struct bootflow *bflow)
>         if (last_slash)
>                 *last_slash = '\0';
>
> -       log_debug("setting bootdev %s, %s, %s, %p, %x\n",
> -                 dev_get_uclass_name(media_dev), devnum_str, bflow->fname,
> -                 bflow->buf, size);
>         dev_name = device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE ?
> -                "usb" : dev_get_uclass_name(media_dev);
> +                "usb" : blk_get_uclass_name(device_get_uclass_id(media_dev));
> +       log_debug("setting bootdev %s, %s, %s, %p, %x\n",
> +                 dev_name, devnum_str, bflow->fname, bflow->buf, size);
>         efi_set_bootdev(dev_name, devnum_str, bflow->fname, bflow->buf, size);
>  }
>
> --
> 2.45.2
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] boot: set correct block device name in set_efi_bootdev()
  2024-08-07  0:13 [PATCH 1/1] boot: set correct block device name in set_efi_bootdev() Heinrich Schuchardt
  2024-08-07  6:44 ` Mattijs Korpershoek
  2024-08-07  6:57 ` Ilias Apalodimas
@ 2024-08-07 14:36 ` Simon Glass
  2024-08-07 14:39   ` Heinrich Schuchardt
  2 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2024-08-07 14:36 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: Ilias Apalodimas, Shantur Rathore, Mattijs Korpershoek,
	AKASHI Takahiro, u-boot

On Tue, 6 Aug 2024 at 18:13, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> For SATA devices the class name is 'ahci' but the block device name is
> 'sata'.
>
> Use function blk_get_uclass_name() to retrieve the correct string.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  boot/bootmeth_efi.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

Hmm I suppose I need to do another round to try to get rid of
blk_desc->uclass_id


> diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
> index 39232eb2e25..6b41c0999f1 100644
> --- a/boot/bootmeth_efi.c
> +++ b/boot/bootmeth_efi.c
> @@ -100,11 +100,10 @@ static void set_efi_bootdev(struct blk_desc *desc, struct bootflow *bflow)
>         if (last_slash)
>                 *last_slash = '\0';
>
> -       log_debug("setting bootdev %s, %s, %s, %p, %x\n",
> -                 dev_get_uclass_name(media_dev), devnum_str, bflow->fname,
> -                 bflow->buf, size);
>         dev_name = device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE ?
> -                "usb" : dev_get_uclass_name(media_dev);
> +                "usb" : blk_get_uclass_name(device_get_uclass_id(media_dev));
> +       log_debug("setting bootdev %s, %s, %s, %p, %x\n",
> +                 dev_name, devnum_str, bflow->fname, bflow->buf, size);
>         efi_set_bootdev(dev_name, devnum_str, bflow->fname, bflow->buf, size);
>  }
>
> --
> 2.45.2
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] boot: set correct block device name in set_efi_bootdev()
  2024-08-07 14:36 ` Simon Glass
@ 2024-08-07 14:39   ` Heinrich Schuchardt
  2024-08-07 20:52     ` Simon Glass
  0 siblings, 1 reply; 7+ messages in thread
From: Heinrich Schuchardt @ 2024-08-07 14:39 UTC (permalink / raw)
  To: Simon Glass
  Cc: Ilias Apalodimas, Shantur Rathore, Mattijs Korpershoek,
	AKASHI Takahiro, u-boot

On 07.08.24 16:36, Simon Glass wrote:
> On Tue, 6 Aug 2024 at 18:13, Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>> For SATA devices the class name is 'ahci' but the block device name is
>> 'sata'.
>>
>> Use function blk_get_uclass_name() to retrieve the correct string.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>> ---
>>   boot/bootmeth_efi.c | 7 +++----
>>   1 file changed, 3 insertions(+), 4 deletions(-)
>>
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Hmm I suppose I need to do another round to try to get rid of
> blk_desc->uclass_id

efi_set_bootdev() should take a udevice in future.

We are converting to string and later back to device before we create a 
device-path. This makes little sense.

Best regards

Heinrich

> 
> 
>> diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
>> index 39232eb2e25..6b41c0999f1 100644
>> --- a/boot/bootmeth_efi.c
>> +++ b/boot/bootmeth_efi.c
>> @@ -100,11 +100,10 @@ static void set_efi_bootdev(struct blk_desc *desc, struct bootflow *bflow)
>>          if (last_slash)
>>                  *last_slash = '\0';
>>
>> -       log_debug("setting bootdev %s, %s, %s, %p, %x\n",
>> -                 dev_get_uclass_name(media_dev), devnum_str, bflow->fname,
>> -                 bflow->buf, size);
>>          dev_name = device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE ?
>> -                "usb" : dev_get_uclass_name(media_dev);
>> +                "usb" : blk_get_uclass_name(device_get_uclass_id(media_dev));
>> +       log_debug("setting bootdev %s, %s, %s, %p, %x\n",
>> +                 dev_name, devnum_str, bflow->fname, bflow->buf, size);
>>          efi_set_bootdev(dev_name, devnum_str, bflow->fname, bflow->buf, size);
>>   }
>>
>> --
>> 2.45.2
>>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] boot: set correct block device name in set_efi_bootdev()
  2024-08-07 14:39   ` Heinrich Schuchardt
@ 2024-08-07 20:52     ` Simon Glass
  2024-08-08 18:43       ` Simon Glass
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2024-08-07 20:52 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: Ilias Apalodimas, Shantur Rathore, Mattijs Korpershoek,
	AKASHI Takahiro, u-boot

Hi Heinrich,

On Wed, 7 Aug 2024 at 08:39, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> On 07.08.24 16:36, Simon Glass wrote:
> > On Tue, 6 Aug 2024 at 18:13, Heinrich Schuchardt
> > <heinrich.schuchardt@canonical.com> wrote:
> >>
> >> For SATA devices the class name is 'ahci' but the block device name is
> >> 'sata'.
> >>
> >> Use function blk_get_uclass_name() to retrieve the correct string.
> >>
> >> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> >> ---
> >>   boot/bootmeth_efi.c | 7 +++----
> >>   1 file changed, 3 insertions(+), 4 deletions(-)
> >>
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > Hmm I suppose I need to do another round to try to get rid of
> > blk_desc->uclass_id
>
> efi_set_bootdev() should take a udevice in future.
>
> We are converting to string and later back to device before we create a
> device-path. This makes little sense.

Yes indeed. I've added it to my list.

Regards,
Simon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] boot: set correct block device name in set_efi_bootdev()
  2024-08-07 20:52     ` Simon Glass
@ 2024-08-08 18:43       ` Simon Glass
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2024-08-08 18:43 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: Ilias Apalodimas, Shantur Rathore, Mattijs Korpershoek,
	AKASHI Takahiro, u-boot

Hi Heinrich,

On Wed, 7 Aug 2024 at 14:52, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Heinrich,
>
> On Wed, 7 Aug 2024 at 08:39, Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
> >
> > On 07.08.24 16:36, Simon Glass wrote:
> > > On Tue, 6 Aug 2024 at 18:13, Heinrich Schuchardt
> > > <heinrich.schuchardt@canonical.com> wrote:
> > >>
> > >> For SATA devices the class name is 'ahci' but the block device name is
> > >> 'sata'.
> > >>
> > >> Use function blk_get_uclass_name() to retrieve the correct string.
> > >>
> > >> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> > >> ---
> > >>   boot/bootmeth_efi.c | 7 +++----
> > >>   1 file changed, 3 insertions(+), 4 deletions(-)
> > >>
> > >
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > >
> > > Hmm I suppose I need to do another round to try to get rid of
> > > blk_desc->uclass_id
> >
> > efi_set_bootdev() should take a udevice in future.
> >
> > We are converting to string and later back to device before we create a
> > device-path. This makes little sense.
>
> Yes indeed. I've added it to my list.

But sadly, we still have code for ~DM_BLK so that has to happen first,
so I've taken it off my list. I tried to send a series to remove old
I2C stuff, but it is still pending.

Regards,
Simon

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-08 18:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07  0:13 [PATCH 1/1] boot: set correct block device name in set_efi_bootdev() Heinrich Schuchardt
2024-08-07  6:44 ` Mattijs Korpershoek
2024-08-07  6:57 ` Ilias Apalodimas
2024-08-07 14:36 ` Simon Glass
2024-08-07 14:39   ` Heinrich Schuchardt
2024-08-07 20:52     ` Simon Glass
2024-08-08 18:43       ` Simon Glass

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.