diff mbox series

accel/amdxdna: Add MODULE_FIRMWARE() declarations

Message ID 20250204174031.3425762-1-superm1@kernel.org (mailing list archive)
State New
Headers show
Series accel/amdxdna: Add MODULE_FIRMWARE() declarations | expand

Commit Message

Mario Limonciello Feb. 4, 2025, 5:40 p.m. UTC
From: Mario Limonciello <mario.limonciello@amd.com>

Initramfs building tools such as dracut will look for a MODULE_FIRMWARE()
declaration to determine which firmware to include in the initramfs
when a driver is included in the initramfs.

As amdxdna doesn't declare any firmware this causes the driver to fail
to load with -ENOENT when in the initramfs.  Add the missing declaration
for possible firmware.

Reported-by: Renjith Pananchikkal <Renjith.Pananchikkal@amd.com>
Suggested-by: Alexander Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/accel/amdxdna/amdxdna_pci_drv.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Lizhi Hou Feb. 4, 2025, 5:46 p.m. UTC | #1
On 2/4/25 09:40, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> Initramfs building tools such as dracut will look for a MODULE_FIRMWARE()
> declaration to determine which firmware to include in the initramfs
> when a driver is included in the initramfs.
>
> As amdxdna doesn't declare any firmware this causes the driver to fail
> to load with -ENOENT when in the initramfs.  Add the missing declaration
> for possible firmware.
>
> Reported-by: Renjith Pananchikkal <Renjith.Pananchikkal@amd.com>
> Suggested-by: Alexander Deucher <Alexander.Deucher@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/accel/amdxdna/amdxdna_pci_drv.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c
> index 97d4a032171f1..f5b8497cf5ad6 100644
> --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c
> +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c
> @@ -21,6 +21,11 @@
>   
>   #define AMDXDNA_AUTOSUSPEND_DELAY	5000 /* milliseconds */
>   
> +MODULE_FIRMWARE("amdnpu/1502_00/npu.sbin");
> +MODULE_FIRMWARE("amdnpu/17f0_10/npu.sbin");
> +MODULE_FIRMWARE("amdnpu/17f0_11/npu.sbin");
> +MODULE_FIRMWARE("amdnpu/17f0_20/npu.sbin");
> +
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
>   /*
>    * Bind the driver base on (vendor_id, device_id) pair and later use the
>    * (device_id, rev_id) pair as a key to select the devices. The devices with
Mario Limonciello Feb. 4, 2025, 6:15 p.m. UTC | #2
On 2/4/2025 11:46, Lizhi Hou wrote:
> 
> On 2/4/25 09:40, Mario Limonciello wrote:
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> Initramfs building tools such as dracut will look for a MODULE_FIRMWARE()
>> declaration to determine which firmware to include in the initramfs
>> when a driver is included in the initramfs.
>>
>> As amdxdna doesn't declare any firmware this causes the driver to fail
>> to load with -ENOENT when in the initramfs.  Add the missing declaration
>> for possible firmware.
>>
>> Reported-by: Renjith Pananchikkal <Renjith.Pananchikkal@amd.com>
>> Suggested-by: Alexander Deucher <Alexander.Deucher@amd.com>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>   drivers/accel/amdxdna/amdxdna_pci_drv.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/ 
>> amdxdna/amdxdna_pci_drv.c
>> index 97d4a032171f1..f5b8497cf5ad6 100644
>> --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c
>> +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c
>> @@ -21,6 +21,11 @@
>>   #define AMDXDNA_AUTOSUSPEND_DELAY    5000 /* milliseconds */
>> +MODULE_FIRMWARE("amdnpu/1502_00/npu.sbin");
>> +MODULE_FIRMWARE("amdnpu/17f0_10/npu.sbin");
>> +MODULE_FIRMWARE("amdnpu/17f0_11/npu.sbin");
>> +MODULE_FIRMWARE("amdnpu/17f0_20/npu.sbin");
>> +
> Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>

Thanks.

I also forgot to add a Fixes tag.
I'll add this when adding to drm-misc-fixes.

Fixes: 8c9ff1b181ba3 ("accel/amdxdna: Add a new driver for AMD AI Engine")

>>   /*
>>    * Bind the driver base on (vendor_id, device_id) pair and later use 
>> the
>>    * (device_id, rev_id) pair as a key to select the devices. The 
>> devices with
diff mbox series

Patch

diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c
index 97d4a032171f1..f5b8497cf5ad6 100644
--- a/drivers/accel/amdxdna/amdxdna_pci_drv.c
+++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c
@@ -21,6 +21,11 @@ 
 
 #define AMDXDNA_AUTOSUSPEND_DELAY	5000 /* milliseconds */
 
+MODULE_FIRMWARE("amdnpu/1502_00/npu.sbin");
+MODULE_FIRMWARE("amdnpu/17f0_10/npu.sbin");
+MODULE_FIRMWARE("amdnpu/17f0_11/npu.sbin");
+MODULE_FIRMWARE("amdnpu/17f0_20/npu.sbin");
+
 /*
  * Bind the driver base on (vendor_id, device_id) pair and later use the
  * (device_id, rev_id) pair as a key to select the devices. The devices with