Subject: Re: [PATCH v2 3/7] ice: move devlink locking outside the port creation

From: Jakub Kicinski <[email-masked]>
Date: Thu, 6 Jun 2024 17:56:34 -0700

On Wed, 05 Jun 2024 13:40:43 -0700 Jacob Keller wrote:
> From: Michal Swiatkowski <[email-masked]>
> 
> In case of subfunction lock will be taken for whole port creation. Do
> the same in VF case.

No interactions with other locks worth mentioning?

> diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c
> index 704e9ad5144e..f774781ab514 100644
> --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
> +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
> @@ -794,10 +794,8 @@ int ice_devlink_rate_init_tx_topology(struct devlink *devlink, struct ice_vsi *v
>  
>  	tc_node = pi->root->children[0];
>  	mutex_lock(&pi->sched_lock);
> -	devl_lock(devlink);
>  	for (i = 0; i < tc_node->num_children; i++)
>  		ice_traverse_tx_tree(devlink, tc_node->children[i], tc_node, pf);
> -	devl_unlock(devlink);
>  	mutex_unlock(&pi->sched_lock);

Like this didn't use to cause a deadlock?

Seems ice_devlink_rate_node_del() takes this lock and it's already
holding the devlink instance lock.