RE: [PATCH v5 04/10] platform/x86/intel/ifs: Read IFS firmware image

Luck, Tony
2022-05-04T16:51:58Z

>> + ret = request_firmware_direct(&fw, scan_path, dev);
>> + if (ret) {
>> + dev_err(dev, "ifs file %s load failed\n", scan_path);
>> + return;
>
> Why is this not returning an error to the caller?

There are three call sequences that lead here:

1) CONFIG_INTEL_IFS=y
At boot this is pretty much guaranteed to fail (unless some crazy person includes the
scan file in the initramfs). In this case there isn't a useful caller to return the code to.
In this case the driver init routine must ignore any error to make sure the sysfs reload
file is present to load the scan file once the file system is available.

2) CONFIG_INTEL_IFS=m module load time
Same code path as built-in ... so must ignore a failed load here too (unless there is a
way to distinguish the built-in vs. module execution environment).

3) echo 1 > reload
Hmmm. Some older revision did return an error ... but I seem to have factored it out
during cleanups. Limited to standard -E???? error codes. The reload_store() function
can just check whether the load succeeded by looking at ifsd->loaded instead of a
return value from ifs_load_firmware()

So, I will fix case 3. But probably by checking ifsd->loaded rather than by adding a return
code to this function.

-Tony