mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-29 22:14:41 +08:00
5c91ecfda5
The ice_init_all_ctrlq and ice_shutdown_all_ctrlq functions create and
destroy the locks used to protect the send and receive process of each
control queue.
This is problematic, as the driver may use these functions to shutdown
and re-initialize the control queues at run time. For example, it may do
this in response to a device reset.
If the driver failed to recover from a reset, it might leave the control
queues offline. In this case, the locks will no longer be initialized.
A later call to ice_sq_send_cmd will then attempt to acquire a lock that
has been destroyed.
It is incorrect behavior to access a lock that has been destroyed.
Indeed, ice_aq_send_cmd already tries to avoid accessing an offline
control queue, but the check occurs inside the lock.
The root of the problem is that the locks are destroyed at run time.
Modify ice_init_all_ctrlq and ice_shutdown_all_ctrlq such that they no
longer create or destroy the locks.
Introduce new functions, ice_create_all_ctrlq and ice_destroy_all_ctrlq.
Call these functions in ice_init_hw and ice_deinit_hw.
Now, the control queue locks will remain valid for the life of the
driver, and will not be destroyed until the driver unloads.
This also allows removing a duplicate check of the sq.count and
rq.count values when shutting down the controlqs. The ice_shutdown_ctrlq
function already checks this value under the lock. Previously
commit
|
||
---|---|---|
.. | ||
ice_adminq_cmd.h | ||
ice_common.c | ||
ice_common.h | ||
ice_controlq.c | ||
ice_controlq.h | ||
ice_dcb_lib.c | ||
ice_dcb_lib.h | ||
ice_dcb.c | ||
ice_dcb.h | ||
ice_devids.h | ||
ice_ethtool.c | ||
ice_hw_autogen.h | ||
ice_lan_tx_rx.h | ||
ice_lib.c | ||
ice_lib.h | ||
ice_main.c | ||
ice_nvm.c | ||
ice_osdep.h | ||
ice_sched.c | ||
ice_sched.h | ||
ice_sriov.c | ||
ice_sriov.h | ||
ice_status.h | ||
ice_switch.c | ||
ice_switch.h | ||
ice_txrx.c | ||
ice_txrx.h | ||
ice_type.h | ||
ice_virtchnl_pf.c | ||
ice_virtchnl_pf.h | ||
ice.h | ||
Makefile |