Document adapter->ctrl_pf_lock as the outer lifetime lock for TX clock state and PTP hardware semaphore operations. This makes the existing ordering constraints visible to future callers and helps avoid nesting the rwsem below a DPLL lock.
Signed-off-by: Sergey Temerkhanov <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> --- drivers/net/ethernet/intel/ice/ice_dpll.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.h b/drivers/net/ethernet/intel/ice/ice_dpll.h index f7e6680d124c..67f2fc6e79e4 100644 --- a/drivers/net/ethernet/intel/ice/ice_dpll.h +++ b/drivers/net/ethernet/intel/ice/ice_dpll.h @@ -156,10 +156,21 @@ struct ice_dpll { * Locking: * Acquisition order (top to bottom): * - * txclk_notify_rwsem (read) - * -> pf->dplls.lock - * -> ctrl_pf->dplls.lock + * adapter->ctrl_pf_lock (read) + * -> txclk_notify_rwsem (read) + * -> pf->dplls.lock + * -> ctrl_pf->dplls.lock * + * PTP hardware semaphore path: + * + * ptp_port->ps_lock + * -> adapter->ctrl_pf_lock (read) + * -> PFTSYN_SEM + * + * - ice_ptp_port_phy_restart() takes @ps_lock before reaching + * ice_ptp_lock() via ice_start_phy_timer_eth56g() or + * ice_start_phy_timer_e82x(), so ctrl_pf_lock is not the outermost + * lock on that path. Never take @ps_lock with ctrl_pf_lock held. * - @lock serializes all DPLL state mutations on this PF. When the * controlling PF's lock must also be taken (e.g. updating the shared * tx_refclks usage map), acquire pf->dplls.lock first, then -- 2.53.0
