diff options
author | Subbaraya Sundeep <sbhatta@marvell.com> | 2023-11-29 10:53:42 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-12-01 11:02:18 +0000 |
commit | 9572c949385aa2ef10368287c439bcb7935137c8 (patch) | |
tree | 5565efb79fe8ab263c2ecd8d738d8a8b53f7ade2 | |
parent | cf50b5cae84741268c7bd3fed568c1b8beef9fa9 (diff) | |
download | linux-9572c949385aa2ef10368287c439bcb7935137c8.tar.gz linux-9572c949385aa2ef10368287c439bcb7935137c8.tar.bz2 linux-9572c949385aa2ef10368287c439bcb7935137c8.zip |
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: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c index 9efcec549834..53f6258a973c 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c @@ -334,9 +334,12 @@ static void otx2_get_pauseparam(struct net_device *netdev, if (is_otx2_lbkvf(pfvf->pdev)) return; + mutex_lock(&pfvf->mbox.lock); req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox); - if (!req) + if (!req) { + mutex_unlock(&pfvf->mbox.lock); return; + } if (!otx2_sync_mbox_msg(&pfvf->mbox)) { rsp = (struct cgx_pause_frm_cfg *) @@ -344,6 +347,7 @@ static void otx2_get_pauseparam(struct net_device *netdev, pause->rx_pause = rsp->rx_pause; pause->tx_pause = rsp->tx_pause; } + mutex_unlock(&pfvf->mbox.lock); } static int otx2_set_pauseparam(struct net_device *netdev, |