[PATCH 1/2] nvme: Fix error code and log to indicate busy

Simon Glass sjg at chromium.org
Sat Dec 2 19:26:40 CET 2023


On Wed, 22 Nov 2023 at 16:52, Moritz Fischer <moritzf at google.com> wrote:
>
> Return -EBUSY if controller is found busy rather than -ENOMEM

-ENODEV ?

> and update the error message accordingly.
>
> Fixes: 982388eaa991 ("nvme: Add NVM Express driver support")
> Signed-off-by: Moritz Fischer <moritzf at google.com>
> ---
>  drivers/nvme/nvme.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


>
> diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
> index c39cd41aa3..ec45f831a3 100644
> --- a/drivers/nvme/nvme.c
> +++ b/drivers/nvme/nvme.c
> @@ -835,8 +835,8 @@ int nvme_init(struct udevice *udev)
>         ndev->udev = udev;
>         INIT_LIST_HEAD(&ndev->namespaces);
>         if (readl(&ndev->bar->csts) == -1) {
> -               ret = -ENODEV;
> -               printf("Error: %s: Out of memory!\n", udev->name);
> +               ret = -EBUSY;
> +               printf("Error: %s: Controller not ready!\n", udev->name);
>                 goto free_nvme;
>         }
>
> --
> 2.43.0.rc1.413.gea7ed67945-goog
>


More information about the U-Boot mailing list