Skip to contentSkip to conversation

misc: fs-loader: Use fw_storage_interface instead of storage_interface

PATCH Superseded MD Danish Anwar 4 participants 6 messages Jan 30, 2024 – Feb 9, 2024 Char and misc drivers

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 misc: fs-loader: Use fw_storage_interface instead of storage_interface

The fs-loader driver reads env storage_interface and uses it to load firmware file into memory using the medium set by env. Update the driver to use env fw_storage_interface as this variable is only used to load firmwares. The env storage_interface will act as fallback so that the existing implementations do not break.

Also update the FS Loader documentation accordingly.

---
Changes from v3 to v4:
*) No functional change. Splitted the patch out of the series as suggested
by Nishant.
*) Droppped the RFC tag.

v3: https://lore.kernel.org/all/[email protected]/

 doc/develop/driver-model/fs_firmware_loader.rst | 5 ++++-
 drivers/misc/fs_loader.c                        | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
doc/develop/driver-model/fs_firmware_loader.rst +4 -1
index 149b8b436e..410cc1442d 100644
@@ -98,8 +98,11 @@ through the U-Boot environment variable during run time.
 
 For examples:
 
+fw_storage_interface:
+  Firmware storage interface, it can be "mmc", "usb", "sata" or "ubi".
 storage_interface:
-  Storage interface, it can be "mmc", "usb", "sata" or "ubi".
+  Storage interface, it can be "mmc", "usb", "sata" or "ubi". This acts
+  as a fallback if fw_storage_interface is not set.
 fw_dev_part:
   Block device number and its partition, it can be "0:1".
 fw_ubi_mtdpart:
drivers/misc/fs_loader.c +4 -1
index 1ffc199ba1..3798dab5b6 100644
@@ -153,7 +153,10 @@ static int fw_get_filesystem_firmware(struct udevice *dev)
 	char *storage_interface, *dev_part, *ubi_mtdpart, *ubi_volume;
 	int ret;
 
-	storage_interface = env_get("storage_interface");
+	storage_interface = env_get("fw_storage_interface");
+	if (!storage_interface)
+		storage_interface = env_get("storage_interface");
+
 	dev_part = env_get("fw_dev_part");
 	ubi_mtdpart = env_get("fw_ubi_mtdpart");
 	ubi_volume = env_get("fw_ubi_volume");
Signature · 1 line
2.34.1
Acked-by on v4 1/1
#1 lore raw
Quoted 8 lines · MD Danish Anwar

The fs-loader driver reads env storage_interface and uses it to load firmware file into memory using the medium set by env. Update the driver to use env fw_storage_interface as this variable is only used to load firmwares. The env storage_interface will act as fallback so that the existing implementations do not break.

Also update the FS Loader documentation accordingly.

Quoted 8 lines

---
Changes from v3 to v4:
*) No functional change. Splitted the patch out of the series as suggested
by Nishant.
*) Droppped the RFC tag.

v3: https://lore.kernel.org/all/[email protected]/

#2 lore raw
In reply to MD Danish Anwar
Quoted 7 lines · MD Danish Anwar

The fs-loader driver reads env storage_interface and uses it to load firmware file into memory using the medium set by env. Update the driver to use env fw_storage_interface as this variable is only used to load firmwares. The env storage_interface will act as fallback so that the existing implementations do not break.

Also update the FS Loader documentation accordingly.

So why do you want to do this? I don't see what the point of renaming the variable is, since you are not e.g. adding any new functionality, and we have to pay for the rename in code size.

--Sean

#3 lore raw

Hi Sean,

Quoted 7 lines · Sean Anderson
Quoted 6 lines · MD Danish Anwar

The fs-loader driver reads env storage_interface and uses it to load firmware file into memory using the medium set by env. Update the driver to use env fw_storage_interface as this variable is only used to load firmwares. The env storage_interface will act as fallback so that the existing implementations do not break.

Quoted 6 lines
Quoted 1 line

Also update the FS Loader documentation accordingly.

So why do you want to do this? I don't see what the point of renaming the variable is, since you are not e.g. adding any new functionality, and we have to pay for the rename in code size.

I am upstreaming TI's ICSSG driver for u-boot and during code review Roger Quadros <[email protected]> commented asking to rename this variable [1]. I think the motive here was to keep all variables used by fs-loader driver with 'fw_' prefix. All other variables had 'fw_' prefix except for storage_interface.

[1]
https://lore.kernel.org/all/[email protected]/

Quoted 1 line

--Sean

Signature · 2 lines
Thanks and Regards,
Danish
#4 lore raw
Quoted 17 lines · MD Danish Anwar

Hi Sean,

Quoted 7 lines · Sean Anderson
Quoted 6 lines · MD Danish Anwar

The fs-loader driver reads env storage_interface and uses it to load firmware file into memory using the medium set by env. Update the driver to use env fw_storage_interface as this variable is only used to load firmwares. The env storage_interface will act as fallback so that the existing implementations do not break.

Quoted 6 lines
Quoted 1 line

Also update the FS Loader documentation accordingly.

So why do you want to do this? I don't see what the point of renaming the variable is, since you are not e.g. adding any new functionality, and we have to pay for the rename in code size.

Quoted 5 lines

I am upstreaming TI's ICSSG driver for u-boot and during code review Roger Quadros <[email protected]> commented asking to rename this variable [1]. I think the motive here was to keep all variables used by fs-loader driver with 'fw_' prefix. All other variables had 'fw_' prefix except for storage_interface.

Can you please mention this motive in the Commit message?

Quoted 6 lines

[1]
https://lore.kernel.org/all/[email protected]/

Quoted 1 line

--Sean

Signature · 2 lines
cheers,
-roger
#5 lore raw
Quoted 20 lines · Roger Quadros
Quoted 17 lines · MD Danish Anwar

Hi Sean,

Quoted 13 lines · Sean Anderson
Quoted 7 lines · MD Danish Anwar

The fs-loader driver reads env storage_interface and uses it to load firmware file into memory using the medium set by env. Update the driver to use env fw_storage_interface as this variable is only used to load firmwares. The env storage_interface will act as fallback so that the existing implementations do not break.

Also update the FS Loader documentation accordingly.

So why do you want to do this? I don't see what the point of renaming the variable is, since you are not e.g. adding any new functionality, and we have to pay for the rename in code size.

Quoted 8 lines
Quoted 5 lines

I am upstreaming TI's ICSSG driver for u-boot and during code review Roger Quadros <[email protected]> commented asking to rename this variable [1]. I think the motive here was to keep all variables used by fs-loader driver with 'fw_' prefix. All other variables had 'fw_' prefix except for storage_interface.

Can you please mention this motive in the Commit message?

Sure Roger, I will resend the patch after updating commit message.

Quoted 7 lines
Quoted 6 lines

[1]
https://lore.kernel.org/all/[email protected]/

Quoted 1 line

--Sean

Signature · 2 lines
Thanks and Regards,
Danish