From patchwork Wed Nov 29 05:23:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Subbaraya Sundeep X-Patchwork-Id: 171062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp132183vqn; Tue, 28 Nov 2023 21:24:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHv/hdNtDon9kXa9zKc94WJSWkRKmIDvAbL3AxBMfyfbl0hTg1J7KD49Pz6rBP0dV/UfcV/ X-Received: by 2002:a17:902:f54b:b0:1cf:e203:1856 with SMTP id h11-20020a170902f54b00b001cfe2031856mr7511241plf.14.1701235456383; Tue, 28 Nov 2023 21:24:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701235456; cv=none; d=google.com; s=arc-20160816; b=RKEShURFckULWBkukY0uTAf8qjJb4JMeqeEgWeWbXXSLmE7P3/b1Xh+fNstGdJz5WD 2Dckbonr2frkgxSdlaHdqxYN/msId3jGYgHcg4N8oAnWzm5PA6iBMON+XD3W9vLhxvQR a4fsFuKdpU3vlsT+IQJ0vfu9NbaLpscx2l4NyHf4FSkZmQ/jrAQxpbjK8myyUW+Dpi3G SiQeUR527IBAPN9RkjDsMhj/k9vXzvewVoNUFdy2kQq8tlYBYTxekPFFLS9dtSUaxS09 r7/QUon6IW2QPM44PxELIURsWZCbhvl4ypFiy1i380kun02bBaoK+kcYeW2iiBRp7x6G FA7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=RyQNu/4f6bw63umQMN6av9DZSEVhbf5Xz7SFVkrjG6c=; fh=X6m7kab/uccGINYdfJUCfvUGCl02WYCq5o/5W9QRetE=; b=qJMeGtTTFr7kk/hCxNh8QQeNA8vgjLWymcQe3ZyB9ckTSFWlPFxV/ywFXXEtjDK4vW 1YGw1tBXL8BRokskep1MZOph2xhMQf8GbAd1d4q81BWE9ZFQVkR5KhUYUfI5JHTbqDda R7zh6BeSzcrmQTPMTeusYwtH2FBl3nKfcAfepgIttUA+BG6B1zh/A7KeJmNXY077ff19 CyZ00rI5oedD2de4Mw1T0dJgwLUQgxytSc7O0viqdOirOuBP7soI/daQyR4JkHCGagiJ DUkluNGuCS/QTWuOgf32Mkdcig4uD52Ko1JgcCGeOW41I7DycszQFwmhMBABHucCj2KT JUpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="dRoTA+/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id w19-20020a1709027b9300b001cfc1556e74si7493256pll.406.2023.11.28.21.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 21:24:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="dRoTA+/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 62DF680A5F3C; Tue, 28 Nov 2023 21:24:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230198AbjK2FXw (ORCPT + 99 others); Wed, 29 Nov 2023 00:23:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjK2FXv (ORCPT ); Wed, 29 Nov 2023 00:23:51 -0500 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE5881BE; Tue, 28 Nov 2023 21:23:57 -0800 (PST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ASIdt2Q021069; Tue, 28 Nov 2023 21:23:51 -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=RyQNu/4f6bw63umQMN6av9DZSEVhbf5Xz7SFVkrjG6c=; b=dRoTA+/qReOFVuar7zJPScRoUn4NKrjiON1fHQR0sZs/yo1wkjJiGlPBgBUyXaYHuavV VDjRNhw1cnuMqC+aXzD6LVgmVC/i39LSfvcoSlsFYXgkva+RBc3AWDxHCrF2Vv2ctBNC 1Zr+fONsyhUy5eeU36ota54GRz2GcHZQt2Ffxj7hN2ISyhJWfxbe78NQ2MLrfQ/4X830 hKCLuJJBiCZW7yK+Vtxl67aOBwysT/Y28KlTd9NyVEGaXvlKAaxRMXHSCYoSEg90EA3Y PfDNI6ID8F4k4waLxj7YzhPqOXqzv6ttJEm27MCj0dJnq9RjoKKHlDCWNfIAcqYyINPW pg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3unn86a18w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 28 Nov 2023 21:23:51 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 28 Nov 2023 21:23:49 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 28 Nov 2023 21:23:49 -0800 Received: from hyd1358.marvell.com (unknown [10.29.37.11]) by maili.marvell.com (Postfix) with ESMTP id ADB743F7048; Tue, 28 Nov 2023 21:23:45 -0800 (PST) From: Subbaraya Sundeep To: , CC: , , , , , , , , , "Subbaraya Sundeep" Subject: [PATCH v2 net] octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam Date: Wed, 29 Nov 2023 10:53:42 +0530 Message-ID: <1701235422-22488-1-git-send-email-sbhatta@marvell.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: GzgL5lzcAPokTodDWzZsP1yHw-0rQYGU X-Proofpoint-GUID: GzgL5lzcAPokTodDWzZsP1yHw-0rQYGU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-29_02,2023-11-27_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 21:24:13 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783554585280788507 X-GMAIL-MSGID: 1783874669849282667 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 Reviewed-by: Simon Horman --- v2 changes: Added maintainers of AF driver too 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/drivers/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 *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,