All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wachowski, Karol" <karol.wachowski@linux.intel.com>
To: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>,
	dri-devel@lists.freedesktop.org
Cc: oded.gabbay@gmail.com, jeff.hugo@oss.qualcomm.com,
	lizhi.hou@amd.com, dawid.osuchowski@linux.intel.com
Subject: Re: [PATCH] accel/ivpu: Load firmware on cold boot
Date: Wed, 14 Oct 2026 13:07:18 +0200	[thread overview]
Message-ID: <b5b65d68-ab34-4589-b40b-6cf59d0c8d48@linux.intel.com> (raw)
In-Reply-To: <20261014101545.3298558-1-andrzej.kacprowski@linux.intel.com>

On 14-Oct-26 12:15, Andrzej Kacprowski wrote:
> Load the firmware image immediately before each cold boot
> instead of during probe or cold-boot preparation.
> This moves image loading to a single call site
> and aligns code for future driver changes.
> 
> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>

Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>

> ---
>   drivers/accel/ivpu/ivpu_drv.c | 8 ++++++++
>   drivers/accel/ivpu/ivpu_fw.c  | 5 ++---
>   drivers/accel/ivpu/ivpu_fw.h  | 2 +-
>   drivers/accel/ivpu/ivpu_pm.c  | 1 -
>   4 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
> index ada18a36caef..61149b7c30c2 100644
> --- a/drivers/accel/ivpu/ivpu_drv.c
> +++ b/drivers/accel/ivpu/ivpu_drv.c
> @@ -520,6 +520,14 @@ int ivpu_boot(struct ivpu_device *vdev)
>   	ivpu_fw_boot_params_setup(vdev, ivpu_bo_vaddr(vdev->fw->mem_bp));
>   	vdev->fw->last_boot_mode = vdev->fw->next_boot_mode;
>   
> +	if (!ivpu_fw_is_warm_boot(vdev)) {
> +		ret = ivpu_fw_load(vdev);
> +		if (ret) {
> +			ivpu_err(vdev, "Failed to load the firmware: %d\n", ret);
> +			return ret;
> +		}
> +	}
> +
>   	ret = ivpu_hw_boot_fw(vdev);
>   	if (ret) {
>   		ivpu_err(vdev, "Failed to start the firmware: %d\n", ret);
> diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c
> index 71ac0a861935..96f5be23a867 100644
> --- a/drivers/accel/ivpu/ivpu_fw.c
> +++ b/drivers/accel/ivpu/ivpu_fw.c
> @@ -473,8 +473,6 @@ int ivpu_fw_init(struct ivpu_device *vdev)
>   	if (ret)
>   		goto err_fw_release;
>   
> -	ivpu_fw_load(vdev);
> -
>   	return 0;
>   
>   err_fw_release:
> @@ -488,7 +486,7 @@ void ivpu_fw_fini(struct ivpu_device *vdev)
>   	ivpu_fw_release(vdev);
>   }
>   
> -void ivpu_fw_load(struct ivpu_device *vdev)
> +int ivpu_fw_load(struct ivpu_device *vdev)
>   {
>   	struct ivpu_fw_info *fw = vdev->fw;
>   	u64 image_end_offset = fw->image_load_offset + fw->image_size;
> @@ -505,6 +503,7 @@ void ivpu_fw_load(struct ivpu_device *vdev)
>   	}
>   
>   	wmb(); /* Flush WC buffers after writing fw->mem */
> +	return 0;
>   }
>   
>   static void ivpu_fw_boot_params_print(struct ivpu_device *vdev, struct vpu_boot_params *boot_params)
> diff --git a/drivers/accel/ivpu/ivpu_fw.h b/drivers/accel/ivpu/ivpu_fw.h
> index e7045b47dfaf..45a705431f22 100644
> --- a/drivers/accel/ivpu/ivpu_fw.h
> +++ b/drivers/accel/ivpu/ivpu_fw.h
> @@ -55,7 +55,7 @@ struct ivpu_fw_info {
>   bool ivpu_is_within_range(u64 addr, size_t size, struct ivpu_addr_range *range);
>   int ivpu_fw_init(struct ivpu_device *vdev);
>   void ivpu_fw_fini(struct ivpu_device *vdev);
> -void ivpu_fw_load(struct ivpu_device *vdev);
> +int ivpu_fw_load(struct ivpu_device *vdev);
>   void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params *boot_params);
>   
>   static inline bool ivpu_fw_is_warm_boot(struct ivpu_device *vdev)
> diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c
> index c1ce8329790e..cd4eff72f76c 100644
> --- a/drivers/accel/ivpu/ivpu_pm.c
> +++ b/drivers/accel/ivpu/ivpu_pm.c
> @@ -46,7 +46,6 @@ static void ivpu_pm_prepare_cold_boot(struct ivpu_device *vdev)
>   	ivpu_cmdq_reset_all_contexts(vdev);
>   	ivpu_ipc_reset(vdev);
>   	ivpu_fw_log_reset(vdev);
> -	ivpu_fw_load(vdev);
>   	fw->last_heartbeat = 0;
>   
>   	ivpu_dbg(vdev, FW_BOOT, "Cold boot entry point 0x%llx", vdev->fw->cold_boot_entry_point);


  reply	other threads:[~2026-10-14 11:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 10:15 [PATCH] accel/ivpu: Load firmware on cold boot Andrzej Kacprowski
2026-10-14 11:07 ` Wachowski, Karol [this message]
2026-10-14 19:57 ` Jeff Hugo

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=b5b65d68-ab34-4589-b40b-6cf59d0c8d48@linux.intel.com \
    --to=karol.wachowski@linux.intel.com \
    --cc=andrzej.kacprowski@linux.intel.com \
    --cc=dawid.osuchowski@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jeff.hugo@oss.qualcomm.com \
    --cc=lizhi.hou@amd.com \
    --cc=oded.gabbay@gmail.com \
    /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.