Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3645255pxb; Mon, 24 Jan 2022 14:17:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIJY7rPynALnJYS0yy4i2cIEWLJt94N0lXP3z0G9hxG4+LBvx8pFGuzpB8+dOo5eCae69r X-Received: by 2002:a17:902:6b81:b0:149:7e13:6d4e with SMTP id p1-20020a1709026b8100b001497e136d4emr16194328plk.47.1643062663485; Mon, 24 Jan 2022 14:17:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062663; cv=none; d=google.com; s=arc-20160816; b=x2JBZeuU4VmbMDN2Ozd5NMPikpps4CszuMmhnNmZOWYvF+sbf+vSnx1aeoyEugJuPd X7af4qvSCp3Ni7/uMChyv+7w/W1XzWiLbdwtZEXsiVoOObwBqyFuwZHH66bzq/q9LIww LlKML6CC1F5bS8UvAOdXIe80ECPbS+ONKntryc5uGthnzNkUbhpJxZVFoMANa+KO4KOs NrC40b1qEDR36+vCLZQOAHF72puZtoczShk0eNIaHJt4UHg54S8sd3Z85C7LHwWJupbQ hlppHgmLdcR6/z3mMPR40unIsRvoHJ5uoWV5qyjAQ6eAD/uwjDgvpopCyYZOqKRbx306 YK/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RFwUY6V2E2L2y5RBepHuF0llAgW4d/QNHiM8cTpx5Dw=; b=Hy9sk1d5Zj8XKTVbq0fdhl4yZpa9tItMRAmE9J6ryj68FpDGwr9w9txRH9aAIMecBt JFdHC24mkIy5IwjsSFndcjPdesCVPEmf/jXAsWSfphqH/FAYOJIALyamxbBcXqEu1VAY rZUSEB/c4nBObe3WfHEcCsCYHI104EPoOQZpbxVkfUsi2qb1/dEK+GD9E7zKa8vr8fXM Zim9O/0BG1UdVlIqF1nLzYCEQvdbsAyolQuToM9uKOid4EAvVu9us42FtZ4eJlZ+rQXy bgUFOi8xvMzytJEW4KxtTkphh6HrZGysHu9QFEpLWsRCb7GJ7niTHFtTIcHSw7QHfrDD 2+pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qny8aKex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si16886939plf.521.2022.01.24.14.17.30; Mon, 24 Jan 2022 14:17:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qny8aKex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580483AbiAXWJt (ORCPT + 99 others); Mon, 24 Jan 2022 17:09:49 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:37160 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448937AbiAXVOS (ORCPT ); Mon, 24 Jan 2022 16:14:18 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4F6EF6141C; Mon, 24 Jan 2022 21:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 353ABC340E5; Mon, 24 Jan 2022 21:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058856; bh=V/bcMqNPkVX/u08LsSoXhVbrVGRhAneAsOwIFiWm3F0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qny8aKexySmth3BreCq3Mnfc7yGjBund4Khv/z0IgdNvKkRNjuM16oABixLU3NhPh VGbe9XnvQ8s/UBIghpIPCdXP+6I2xe3c4KyhCAyx+Fn9GLwclSM0CiUgGxohWsy788 js8vG12HsLWm89WOjieSKnIfBttm3Sw/GIofPPk0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rakesh Babu Saladi , Subbaraya Sundeep , Sunil Goutham , "David S. Miller" , Sasha Levin Subject: [PATCH 5.16 0424/1039] octeontx2-nicvf: Free VF PTP resources. Date: Mon, 24 Jan 2022 19:36:53 +0100 Message-Id: <20220124184139.559681839@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rakesh Babu Saladi [ Upstream commit eabd0f88b0d2d433c5dfe88218d4ce1c11ef04b8 ] When a VF is removed respective PTP resources are not being freed currently. This patch fixes it. Fixes: 43510ef4ddad ("octeontx2-nicvf: Add PTP hardware clock support to NIX VF") Signed-off-by: Rakesh Babu Saladi Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c index 78944ad3492ff..d75f3a78fabf1 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c @@ -684,7 +684,7 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id) err = register_netdev(netdev); if (err) { dev_err(dev, "Failed to register netdevice\n"); - goto err_detach_rsrc; + goto err_ptp_destroy; } err = otx2_wq_init(vf); @@ -709,6 +709,8 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id) err_unreg_netdev: unregister_netdev(netdev); +err_ptp_destroy: + otx2_ptp_destroy(vf); err_detach_rsrc: if (test_bit(CN10K_LMTST, &vf->hw.cap_flag)) qmem_free(vf->dev, vf->dync_lmt); @@ -742,6 +744,7 @@ static void otx2vf_remove(struct pci_dev *pdev) unregister_netdev(netdev); if (vf->otx2_wq) destroy_workqueue(vf->otx2_wq); + otx2_ptp_destroy(vf); otx2vf_disable_mbox_intr(vf); otx2_detach_resources(&vf->mbox); if (test_bit(CN10K_LMTST, &vf->hw.cap_flag)) -- 2.34.1