Commit 9572c949 authored by Subbaraya Sundeep's avatar Subbaraya Sundeep Committed by David S. Miller

octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam

All the mailbox messages sent to AF needs to be guarded
by mutex lock. Add the missing lock in otx2_get_pauseparam
function.

Fixes: 75f36270 ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cf50b5ca
...@@ -334,9 +334,12 @@ static void otx2_get_pauseparam(struct net_device *netdev, ...@@ -334,9 +334,12 @@ static void otx2_get_pauseparam(struct net_device *netdev,
if (is_otx2_lbkvf(pfvf->pdev)) if (is_otx2_lbkvf(pfvf->pdev))
return; return;
mutex_lock(&pfvf->mbox.lock);
req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox); req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
if (!req) if (!req) {
mutex_unlock(&pfvf->mbox.lock);
return; return;
}
if (!otx2_sync_mbox_msg(&pfvf->mbox)) { if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
rsp = (struct cgx_pause_frm_cfg *) rsp = (struct cgx_pause_frm_cfg *)
...@@ -344,6 +347,7 @@ static void otx2_get_pauseparam(struct net_device *netdev, ...@@ -344,6 +347,7 @@ static void otx2_get_pauseparam(struct net_device *netdev,
pause->rx_pause = rsp->rx_pause; pause->rx_pause = rsp->rx_pause;
pause->tx_pause = rsp->tx_pause; pause->tx_pause = rsp->tx_pause;
} }
mutex_unlock(&pfvf->mbox.lock);
} }
static int otx2_set_pauseparam(struct net_device *netdev, static int otx2_set_pauseparam(struct net_device *netdev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment