2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-10 06:14:51 -08:00
|
|
|
|
2020-04-24 18:49:16 +00:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
2018-03-10 06:14:50 -08:00
|
|
|
|
|
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-26 19:57:38 +05:30
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-26 19:57:38 +05:30
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
2023-10-26 19:57:39 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-10 06:14:55 -08:00
|
|
|
|
2018-05-10 13:08:38 -07:00
|
|
|
|
2018-04-25 12:25:39 -04:00
|
|
|
|
2018-03-10 06:14:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-02 10:38:26 -07:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-26 19:57:39 +05:30
|
|
|
|
2021-07-28 14:21:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-02 10:38:26 -07:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
firmware: fix a double abort case with fw_load_sysfs_fallback
fw_sysfs_wait_timeout may return err with -ENOENT
at fw_load_sysfs_fallback and firmware is already
in abort status, no need to abort again, so skip it.
This issue is caused by concurrent situation like below:
when thread 1# wait firmware loading, thread 2# may write
-1 to abort loading and wakeup thread 1# before it timeout.
so wait_for_completion_killable_timeout of thread 1# would
return remaining time which is != 0 with fw_st->status
FW_STATUS_ABORTED.And the results would be converted into
err -ENOENT in __fw_state_wait_common and transfered to
fw_load_sysfs_fallback in thread 1#.
The -ENOENT means firmware status is already at ABORTED,
so fw_load_sysfs_fallback no need to get mutex to abort again.
-----------------------------
thread 1#,wait for loading
fw_load_sysfs_fallback
->fw_sysfs_wait_timeout
->__fw_state_wait_common
->wait_for_completion_killable_timeout
in __fw_state_wait_common,
...
93 ret = wait_for_completion_killable_timeout(&fw_st->completion, timeout);
94 if (ret != 0 && fw_st->status == FW_STATUS_ABORTED)
95 return -ENOENT;
96 if (!ret)
97 return -ETIMEDOUT;
98
99 return ret < 0 ? ret : 0;
-----------------------------
thread 2#, write -1 to abort loading
firmware_loading_store
->fw_load_abort
->__fw_load_abort
->fw_state_aborted
->__fw_state_set
->complete_all
in __fw_state_set,
...
111 if (status == FW_STATUS_DONE || status == FW_STATUS_ABORTED)
112 complete_all(&fw_st->completion);
-------------------------------------------
BTW,the double abort issue would not cause kernel panic or create an issue,
but slow down it sometimes.The change is just a minor optimization.
Signed-off-by: Junyong Sun <sunjunyong@xiaomi.com>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/1583202968-28792-1-git-send-email-sunjunyong@xiaomi.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-03 10:36:08 +08:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-07-28 14:21:07 +05:30
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-22 16:12:02 -07:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-02 10:38:26 -07:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
2020-10-02 10:38:26 -07:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-22 16:12:02 -07:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-22 16:12:02 -07:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
2018-07-13 14:05:59 -04:00
|
|
|
|
|
|
|
|
|
2018-03-10 06:14:52 -08:00
|
|
|
|
2018-03-21 15:34:28 -07:00
|
|
|
|
2018-03-10 06:14:52 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-15 17:35:47 +01:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
2018-07-13 14:05:59 -04:00
|
|
|
|
2020-10-02 10:38:21 -07:00
|
|
|
|
2018-07-13 14:05:59 -04:00
|
|
|
|
2019-06-17 14:23:54 -04:00
|
|
|
|
2018-07-13 14:05:59 -04:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-10 13:08:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-06 15:21:33 +02:00
|
|
|
|
|
|
|
|
|
2018-05-10 13:08:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-30 16:56:10 +02:00
|
|
|
|
|
|
|
|
|
2018-05-10 13:08:40 -07:00
|
|
|
|
2020-01-15 17:35:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-10 13:08:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-10 13:08:39 -07:00
|
|
|
|
|
|
|
|
|
2020-05-22 16:12:02 -07:00
|
|
|
|
2018-05-10 13:08:39 -07:00
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-10 13:08:44 -07:00
|
|
|
|
2019-04-30 16:56:10 +02:00
|
|
|
|
2018-05-10 13:08:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-10 06:14:49 -08:00
|
|
|
|
|
|
|
|
|