public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
To: "Alexander F. Lent" <lx@xanderlent.com>,
	Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>,
	Oded Gabbay <ogabbay@kernel.org>,
	Jeffrey Hugo <quic_jhugo@quicinc.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>,
	Krystian Pradzynski <krystian.pradzynski@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] accel/ivpu: Add missing MODULE_FIRMWARE metadata
Date: Mon, 8 Jul 2024 09:42:56 +0200	[thread overview]
Message-ID: <832c27d0-a2ec-46df-afcd-be74b8108358@linux.intel.com> (raw)
In-Reply-To: <20240705-fix-ivpu-firmware-metadata-v1-1-704b73852d92@xanderlent.com>

Hi, thanks for the commit.

On 05.07.2024 13:14, Alexander F. Lent wrote:
> Modules that load firmware from various paths at runtime must declare
> those paths at compile time, via the MODULE_FIRMWARE macro, so that the
> firmware paths are included in the module's metadata.
> 
> The accel/ivpu driver loaded firmware but lacked this metadata,
> preventing dracut from correctly locating firmware files.
> 
> Fixes: 9ab43e95f922 ("accel/ivpu: Switch to generation based FW names")
> Fixes: 02d5b0aacd05 ("accel/ivpu: Implement firmware parsing and booting")
> Signed-off-by: Alexander F. Lent <lx@xanderlent.com>
> ---
>  drivers/accel/ivpu/ivpu_fw.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c
> index 1457300828bf..51792a00b7e3 100644
> --- a/drivers/accel/ivpu/ivpu_fw.c
> +++ b/drivers/accel/ivpu/ivpu_fw.c
> @@ -48,16 +48,26 @@ static char *ivpu_firmware;
>  module_param_named_unsafe(firmware, ivpu_firmware, charp, 0644);
>  MODULE_PARM_DESC(firmware, "NPU firmware binary in /lib/firmware/..");
>  
> +#define IVPU_FW_PATH_37XX_BIN		"vpu_37xx.bin"
> +#define IVPU_FW_PATH_37XX_V0_BIN	"intel/vpu/vpu_37xx_v0.0.bin"
> +#define IVPU_FW_PATH_40XX_BIN		"vpu_40xx.bin"
> +#define IVPU_FW_PATH_40XX_V0_BIN	"intel/vpu/vpu_40xx_v0.0.bin"
> +
>  static struct {
>  	int gen;
>  	const char *name;
>  } fw_names[] = {
> -	{ IVPU_HW_37XX, "vpu_37xx.bin" },
> -	{ IVPU_HW_37XX, "intel/vpu/vpu_37xx_v0.0.bin" },
> -	{ IVPU_HW_40XX, "vpu_40xx.bin" },
> -	{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
> +	{ IVPU_HW_37XX, IVPU_FW_PATH_37XX_BIN },
> +	{ IVPU_HW_37XX, IVPU_FW_PATH_37XX_V0_BIN },
> +	{ IVPU_HW_40XX, IVPU_FW_PATH_40XX_BIN },
> +	{ IVPU_HW_40XX, IVPU_FW_PATH_40XX_V0_BIN },
>  };
>  
> +MODULE_FIRMWARE(IVPU_FW_PATH_37XX_BIN);
> +MODULE_FIRMWARE(IVPU_FW_PATH_37XX_V0_BIN);
> +MODULE_FIRMWARE(IVPU_FW_PATH_40XX_BIN);
> +MODULE_FIRMWARE(IVPU_FW_PATH_40XX_V0_BIN);
Include only V0 variants, FW names without version are used for development and they wont be included in any distribution.
I would also skip macros and just use literal strings as macros add a lot of lines that don't increase readability.

Regards,
Jacek

      reply	other threads:[~2024-07-08  7:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 11:14 [PATCH] accel/ivpu: Add missing MODULE_FIRMWARE metadata Alexander F. Lent
2024-07-08  7:42 ` Jacek Lawrynowicz [this message]

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=832c27d0-a2ec-46df-afcd-be74b8108358@linux.intel.com \
    --to=jacek.lawrynowicz@linux.intel.com \
    --cc=andrzej.kacprowski@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krystian.pradzynski@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lx@xanderlent.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=stanislaw.gruszka@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox