From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3613937B40C; Tue, 21 Jul 2026 18:15:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657711; cv=none; b=pC5QD7sin4QdAtPjigrl2XcIwZGt8ralgPrUmIILR5peL6YYVHL0Y5zinJGT1k2WyyTKtHwwrV65jd3Z7hM09yHG/88VATjA40gUhS+YeLoVzgjUQ5g4dTJlW/ZH4QiLopWY/gk1WqSyBorM6/0yA2MQSjHf8FJ6JSoAso6ELX4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657711; c=relaxed/simple; bh=sNVp6ER0SlC1FVXJemnA1q3aYMH4fvOr/6KGmLKPPFc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=niyzkSXG4BQKKBMZa+iibptkg/BbqIp+V0dZ+Dim1Xqv0AlLJ+mIM/zOg2MmqGdkzD01mNYsh5o9kwcRtAGOcOwlgGE8C1w004qqE5glebUtYWqc5U8H6zkUCLkEb6YUi2ghdQ87jjo82CRKz0UOC9+zoTlCq6eGDzk9R3+hHUQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=055y7DZo; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="055y7DZo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 590F21F000E9; Tue, 21 Jul 2026 18:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784657709; bh=T0ZoG8zqpgkP38TqtmosKi3E3ctQgMpWbtA0B7WY90g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=055y7DZorKFoUrLV7N6R3OMpvewOhLMtmRNrDcIlVrycXqvwkzyULpiaPvY1hfmID 8O87OosR+RiDcNVioF6w1AZHk+aDwOLf38govFB1dIF0escSKXXTdM9yrSq94oQbem FYy3rLMmv76xuzb32bqevtsSJ758Jx9/MdTpqCbA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Geetha sowjanya , Subbaraya Sundeep , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 0867/1611] octeontx2-pf: mcs: Fix mcs resources free on PF shutdown Date: Tue, 21 Jul 2026 17:16:23 +0200 Message-ID: <20260721152534.893441021@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152514.750365251@linuxfoundation.org> References: <20260721152514.750365251@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Geetha sowjanya [ Upstream commit 450d0e90b10393bd9f50c127875a9fdd4cc81c30 ] On PF shutdown, the current driver free mcs hardware resources though mcs resources are not allocated to it. This patch checks the mcs resources status and if resources are allocated then only sends mailbox message to free them. Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep Link: https://patch.msgid.link/1781636420-19816-3-git-send-email-sbhatta@marvell.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- .../net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c index 9a104dafe63f12..7b2deb78ea4c08 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c @@ -1806,11 +1806,16 @@ int cn10k_mcs_init(struct otx2_nic *pfvf) void cn10k_mcs_free(struct otx2_nic *pfvf) { + struct cn10k_mcs_cfg *cfg = pfvf->macsec_cfg; + if (!test_bit(CN10K_HW_MACSEC, &pfvf->hw.cap_flag)) return; - cn10k_mcs_free_rsrc(pfvf, MCS_TX, MCS_RSRC_TYPE_SECY, 0, true); - cn10k_mcs_free_rsrc(pfvf, MCS_RX, MCS_RSRC_TYPE_SECY, 0, true); + if (!list_empty(&cfg->txsc_list)) { + cn10k_mcs_free_rsrc(pfvf, MCS_TX, MCS_RSRC_TYPE_SECY, 0, true); + cn10k_mcs_free_rsrc(pfvf, MCS_RX, MCS_RSRC_TYPE_SECY, 0, true); + } + kfree(pfvf->macsec_cfg); pfvf->macsec_cfg = NULL; } -- 2.53.0