diff mbox series

[v3] accel/ivpu: Add missing MODULE_FIRMWARE metadata

Message ID 20240709-fix-ivpu-firmware-metadata-v3-1-55f70bba055b@xanderlent.com (mailing list archive)
State New, archived
Headers show
Series [v3] accel/ivpu: Add missing MODULE_FIRMWARE metadata | expand

Commit Message

Alexander F. Lent July 9, 2024, 11:54 a.m. UTC
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 loads firmware but lacks this metadata,
preventing dracut from correctly locating firmware files. Fix it.

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>
---
Hi Jacek,

Thanks for catching the error, and for the more succinct comment.
Please find v3 attached.
---
Changes in v3:
- Simplify comment, per review.
- Fix typo in 40xx firmware path, per review.
- Link to v2: https://lore.kernel.org/r/20240708-fix-ivpu-firmware-metadata-v2-1-78b953172026@xanderlent.com

Changes in v2:
- Only annotate the module with the production firmware paths, per review.
- Drop macros for de-duping firmware fileames, just use string literals, per review.
- Link to v1: https://lore.kernel.org/r/20240705-fix-ivpu-firmware-metadata-v1-1-704b73852d92@xanderlent.com
---
 drivers/accel/ivpu/ivpu_fw.c | 4 ++++
 1 file changed, 4 insertions(+)


---
base-commit: 22a40d14b572deb80c0648557f4bd502d7e83826
change-id: 20240704-fix-ivpu-firmware-metadata-3d02bd60768d

Best regards,

Comments

Jacek Lawrynowicz July 10, 2024, 10:23 a.m. UTC | #1
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>

On 09.07.2024 13:54, 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 loads firmware but lacks this metadata,
> preventing dracut from correctly locating firmware files. Fix it.
> 
> 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>
> ---
> Hi Jacek,
> 
> Thanks for catching the error, and for the more succinct comment.
> Please find v3 attached.
> ---
> Changes in v3:
> - Simplify comment, per review.
> - Fix typo in 40xx firmware path, per review.
> - Link to v2: https://lore.kernel.org/r/20240708-fix-ivpu-firmware-metadata-v2-1-78b953172026@xanderlent.com
> 
> Changes in v2:
> - Only annotate the module with the production firmware paths, per review.
> - Drop macros for de-duping firmware fileames, just use string literals, per review.
> - Link to v1: https://lore.kernel.org/r/20240705-fix-ivpu-firmware-metadata-v1-1-704b73852d92@xanderlent.com
> ---
>  drivers/accel/ivpu/ivpu_fw.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c
> index 1457300828bf..ef717802a3c8 100644
> --- a/drivers/accel/ivpu/ivpu_fw.c
> +++ b/drivers/accel/ivpu/ivpu_fw.c
> @@ -58,6 +58,10 @@ static struct {
>  	{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
>  };
>  
> +/* Production fw_names from the table above */
> +MODULE_FIRMWARE("intel/vpu/vpu_37xx_v0.0.bin");
> +MODULE_FIRMWARE("intel/vpu/vpu_40xx_v0.0.bin");
> +
>  static int ivpu_fw_request(struct ivpu_device *vdev)
>  {
>  	int ret = -ENOENT;
> 
> ---
> base-commit: 22a40d14b572deb80c0648557f4bd502d7e83826
> change-id: 20240704-fix-ivpu-firmware-metadata-3d02bd60768d
> 
> Best regards,
Daniel Vetter July 15, 2024, 8:41 a.m. UTC | #2
On Wed, Jul 10, 2024 at 12:23:06PM +0200, Jacek Lawrynowicz wrote:
> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>

I'm assuming you'll also apply this one?
-Sima

> 
> On 09.07.2024 13:54, 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 loads firmware but lacks this metadata,
> > preventing dracut from correctly locating firmware files. Fix it.
> > 
> > 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>
> > ---
> > Hi Jacek,
> > 
> > Thanks for catching the error, and for the more succinct comment.
> > Please find v3 attached.
> > ---
> > Changes in v3:
> > - Simplify comment, per review.
> > - Fix typo in 40xx firmware path, per review.
> > - Link to v2: https://lore.kernel.org/r/20240708-fix-ivpu-firmware-metadata-v2-1-78b953172026@xanderlent.com
> > 
> > Changes in v2:
> > - Only annotate the module with the production firmware paths, per review.
> > - Drop macros for de-duping firmware fileames, just use string literals, per review.
> > - Link to v1: https://lore.kernel.org/r/20240705-fix-ivpu-firmware-metadata-v1-1-704b73852d92@xanderlent.com
> > ---
> >  drivers/accel/ivpu/ivpu_fw.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c
> > index 1457300828bf..ef717802a3c8 100644
> > --- a/drivers/accel/ivpu/ivpu_fw.c
> > +++ b/drivers/accel/ivpu/ivpu_fw.c
> > @@ -58,6 +58,10 @@ static struct {
> >  	{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
> >  };
> >  
> > +/* Production fw_names from the table above */
> > +MODULE_FIRMWARE("intel/vpu/vpu_37xx_v0.0.bin");
> > +MODULE_FIRMWARE("intel/vpu/vpu_40xx_v0.0.bin");
> > +
> >  static int ivpu_fw_request(struct ivpu_device *vdev)
> >  {
> >  	int ret = -ENOENT;
> > 
> > ---
> > base-commit: 22a40d14b572deb80c0648557f4bd502d7e83826
> > change-id: 20240704-fix-ivpu-firmware-metadata-3d02bd60768d
> > 
> > Best regards,
Jacek Lawrynowicz July 15, 2024, 8:52 a.m. UTC | #3
Hi,

On 15.07.2024 10:41, Daniel Vetter wrote:
> On Wed, Jul 10, 2024 at 12:23:06PM +0200, Jacek Lawrynowicz wrote:
>> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> 
> I'm assuming you'll also apply this one?
> -Sima

Sure

>> On 09.07.2024 13:54, 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 loads firmware but lacks this metadata,
>>> preventing dracut from correctly locating firmware files. Fix it.
>>>
>>> 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>
>>> ---
>>> Hi Jacek,
>>>
>>> Thanks for catching the error, and for the more succinct comment.
>>> Please find v3 attached.
>>> ---
>>> Changes in v3:
>>> - Simplify comment, per review.
>>> - Fix typo in 40xx firmware path, per review.
>>> - Link to v2: https://lore.kernel.org/r/20240708-fix-ivpu-firmware-metadata-v2-1-78b953172026@xanderlent.com
>>>
>>> Changes in v2:
>>> - Only annotate the module with the production firmware paths, per review.
>>> - Drop macros for de-duping firmware fileames, just use string literals, per review.
>>> - Link to v1: https://lore.kernel.org/r/20240705-fix-ivpu-firmware-metadata-v1-1-704b73852d92@xanderlent.com
>>> ---
>>>  drivers/accel/ivpu/ivpu_fw.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c
>>> index 1457300828bf..ef717802a3c8 100644
>>> --- a/drivers/accel/ivpu/ivpu_fw.c
>>> +++ b/drivers/accel/ivpu/ivpu_fw.c
>>> @@ -58,6 +58,10 @@ static struct {
>>>  	{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
>>>  };
>>>  
>>> +/* Production fw_names from the table above */
>>> +MODULE_FIRMWARE("intel/vpu/vpu_37xx_v0.0.bin");
>>> +MODULE_FIRMWARE("intel/vpu/vpu_40xx_v0.0.bin");
>>> +
>>>  static int ivpu_fw_request(struct ivpu_device *vdev)
>>>  {
>>>  	int ret = -ENOENT;
>>>
>>> ---
>>> base-commit: 22a40d14b572deb80c0648557f4bd502d7e83826
>>> change-id: 20240704-fix-ivpu-firmware-metadata-3d02bd60768d
>>>
>>> Best regards,
>
Jacek Lawrynowicz July 15, 2024, 9:32 a.m. UTC | #4
Applied to drm-misc-next

On 09.07.2024 13:54, 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 loads firmware but lacks this metadata,
> preventing dracut from correctly locating firmware files. Fix it.
> 
> 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>
> ---
> Hi Jacek,
> 
> Thanks for catching the error, and for the more succinct comment.
> Please find v3 attached.
> ---
> Changes in v3:
> - Simplify comment, per review.
> - Fix typo in 40xx firmware path, per review.
> - Link to v2: https://lore.kernel.org/r/20240708-fix-ivpu-firmware-metadata-v2-1-78b953172026@xanderlent.com
> 
> Changes in v2:
> - Only annotate the module with the production firmware paths, per review.
> - Drop macros for de-duping firmware fileames, just use string literals, per review.
> - Link to v1: https://lore.kernel.org/r/20240705-fix-ivpu-firmware-metadata-v1-1-704b73852d92@xanderlent.com
> ---
>  drivers/accel/ivpu/ivpu_fw.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c
> index 1457300828bf..ef717802a3c8 100644
> --- a/drivers/accel/ivpu/ivpu_fw.c
> +++ b/drivers/accel/ivpu/ivpu_fw.c
> @@ -58,6 +58,10 @@ static struct {
>  	{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
>  };
>  
> +/* Production fw_names from the table above */
> +MODULE_FIRMWARE("intel/vpu/vpu_37xx_v0.0.bin");
> +MODULE_FIRMWARE("intel/vpu/vpu_40xx_v0.0.bin");
> +
>  static int ivpu_fw_request(struct ivpu_device *vdev)
>  {
>  	int ret = -ENOENT;
> 
> ---
> base-commit: 22a40d14b572deb80c0648557f4bd502d7e83826
> change-id: 20240704-fix-ivpu-firmware-metadata-3d02bd60768d
> 
> Best regards,
diff mbox series

Patch

diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c
index 1457300828bf..ef717802a3c8 100644
--- a/drivers/accel/ivpu/ivpu_fw.c
+++ b/drivers/accel/ivpu/ivpu_fw.c
@@ -58,6 +58,10 @@  static struct {
 	{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
 };
 
+/* Production fw_names from the table above */
+MODULE_FIRMWARE("intel/vpu/vpu_37xx_v0.0.bin");
+MODULE_FIRMWARE("intel/vpu/vpu_40xx_v0.0.bin");
+
 static int ivpu_fw_request(struct ivpu_device *vdev)
 {
 	int ret = -ENOENT;