From nobody Fri Dec 19 04:26:54 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ECC6C4167B for ; Sat, 25 Nov 2023 16:36:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232273AbjKYQgB (ORCPT ); Sat, 25 Nov 2023 11:36:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232420AbjKYQfs (ORCPT ); Sat, 25 Nov 2023 11:35:48 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33CAAD57; Sat, 25 Nov 2023 08:35:55 -0800 (PST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3APGOmAn027133; Sat, 25 Nov 2023 08:35:48 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=9ko12hy6RH7NAQXfAVgeMRqXNaNI7sh28jkGvrWea2A=; b=jg/FK7mb4S1Zq4Qaz061Lw0Hz5/ZW7jyykuO26l1Xu/KEJ8yOz8MRxQmDglkIGvdE1/r UAxe+84qMTdDApVNdagajWXRUnqw0IzJheYdZYhMR/P+rnMr9gd42O9ZjKK8JkQx9H7b lxwG4WG4YdbnCDJF47jn51zviljNe3gZPG2n8dVz4bWRB0FefpyxQMrbBagQaKb+Fn7Y DH1oj/prkNqANDPemjoxGbqZkH4ELfYCdLdxFx893c159zwO2VQy+9e9D1/3W5v6/5BJ kE7AAJqShRk3lKwzuOhOtGOJ9lx2tEnYwE/YxlvODuiUbsWB99ZtX7OmpnDFq5fbzujp NA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ukhauga8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 25 Nov 2023 08:35:48 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 25 Nov 2023 08:35:46 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Sat, 25 Nov 2023 08:35:46 -0800 Received: from hyd1358.marvell.com (unknown [10.29.37.11]) by maili.marvell.com (Postfix) with ESMTP id F102C5C68EA; Sat, 25 Nov 2023 08:35:42 -0800 (PST) From: Subbaraya Sundeep To: , CC: , , , , , , , Subbaraya Sundeep Subject: [PATCH net] octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam Date: Sat, 25 Nov 2023 22:05:41 +0530 Message-ID: <1700930141-5568-1-git-send-email-sbhatta@marvell.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: cue_y-qazPCNjCi9FU_TAdMK1cJo0UhR X-Proofpoint-GUID: cue_y-qazPCNjCi9FU_TAdMK1cJo0UhR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-25_16,2023-11-22_01,2023-05-22_02 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/dr= ivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c index 9efcec5..53f6258 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 *net= dev, if (is_otx2_lbkvf(pfvf->pdev)) return; =20 + mutex_lock(&pfvf->mbox.lock); req =3D otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox); - if (!req) + if (!req) { + mutex_unlock(&pfvf->mbox.lock); return; + } =20 if (!otx2_sync_mbox_msg(&pfvf->mbox)) { rsp =3D (struct cgx_pause_frm_cfg *) @@ -344,6 +347,7 @@ static void otx2_get_pauseparam(struct net_device *netd= ev, pause->rx_pause =3D rsp->rx_pause; pause->tx_pause =3D rsp->tx_pause; } + mutex_unlock(&pfvf->mbox.lock); } =20 static int otx2_set_pauseparam(struct net_device *netdev, --=20 2.7.4