From patchwork Wed Nov 22 19:32:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brett Creeley X-Patchwork-Id: 13465413 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="hTprqL5O" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2053.outbound.protection.outlook.com [40.107.223.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D41D419D; Wed, 22 Nov 2023 11:32:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IFh1iUnHmVG9fM/Tidmt32bYq1K9yyhF/cd7Nld5KUsKd7DXwV7zzPC/PEJ4CGk1H9MTE4eQYWPGWUuH4fBo/adjM36/BPksBJPjAbJAAhLVwWfGFrEJQpkLRQX5AuLQn+OeJhUq+o4URuPCaZ0BrjJkCwYWLBQX0Yw2CYZ1TnSa6kBzm0cz9Xh6GftAjcLSryy6ouq9mIRmkxxsgOw17dsPnmyad0WIOwAzx5PMwYH0EaPRopOlPbQd3W8jXtExm93WrkxLy4GOFlumC4kRTmqyTXGT1OI0vpBvU8CtHBwpjKwcsPXFnPYuTnhvObTczDqAd22bDopmEkeLEJsQ7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Lcw8ubx4/O/7VVkvW5lGzzS4CJMRXDnsGILAAGYHdLc=; b=Xfl3QFAud0DloKzQhUDpBcvKrjMNgX1o8CfrCpJlckAN4OKs3eWtjV9qg1o/2gATnQXnWdR892wb/9rdiOlEVsbbOfeE8XZ0tGbO0ClZRr5eBKH9JSKYUUh7eLvtExZ1kkaIpmguf7e9fz5nzq3YZLYk1whW63a6Hxinh2X1ZKBDRvYbcpd58dPIqES+YfxIh16TIvYFg52MrQpln57+wi+Wd7tbAqlhJBsJxvPmTT+lpQx53zRviMDYTQbmN46ZlJN7BSNweAgR0ui/8y6Q9nY0fBZfpUFeK3FderjyyAcolN9eaBcs7BgEE9ikjQddNUv62Yf5KJSEsV5DuoaT6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ziepe.ca smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lcw8ubx4/O/7VVkvW5lGzzS4CJMRXDnsGILAAGYHdLc=; b=hTprqL5OW/zSD1GqakINLUvQwOCIB/TEXieBKGuuke3XTyhA/dlKcur1bte+Eck7BCLIzH0g3uwEld6y5+MqzL2MH0Pdf4aOLcZ+TF9j8atOWsNMQKWDlUlUs3lYfojHvRCb7ldJO8nnIHnnkQvjG5VLMp1JjtDrfohis1hb7PY= Received: from BN9PR03CA0854.namprd03.prod.outlook.com (2603:10b6:408:13d::19) by DM6PR12MB4371.namprd12.prod.outlook.com (2603:10b6:5:2a3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19; Wed, 22 Nov 2023 19:32:43 +0000 Received: from SN1PEPF0002636D.namprd02.prod.outlook.com (2603:10b6:408:13d:cafe::a) by BN9PR03CA0854.outlook.office365.com (2603:10b6:408:13d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18 via Frontend Transport; Wed, 22 Nov 2023 19:32:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Wed, 22 Nov 2023 19:32:43 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 22 Nov 2023 13:32:16 -0600 From: Brett Creeley To: , , , , , , CC: , Subject: [PATCH vfio 1/2] vfio/mlx5: Change reset_lock to mutex_lock Date: Wed, 22 Nov 2023 11:32:02 -0800 Message-ID: <20231122193203.26127-2-brett.creeley@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231122193203.26127-1-brett.creeley@amd.com> References: <20231122193203.26127-1-brett.creeley@amd.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|DM6PR12MB4371:EE_ X-MS-Office365-Filtering-Correlation-Id: a5865340-9ccb-41ca-dda5-08dbeb91cc32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OzUs0bSDDnUpkLBE7y2dPNO4VHYtHHUBJENCCeeFlNmKfB6TJJ1CyXunw/dLCHAtcqTAJb/WJJGC+ZQNWsJUfqkUvu6rHtR+1Wx2P8/zn8jzqjv8KucgXmq/6efwVF/aZMx6fMTC3SM05vp3Xr4MZkJTTgzhFIyaBeueok9pzIUgsMjL7T4217QPa6RRX7OyuWudzy93zmyHT9iClwK5kYdY9JE3Bpf2EKf5F1YaKo+cDP6SmzVCGYY252XphQSAMUELONhjWIkqYKZ7FTVJsUU8pszcb3/g9taEXgl4XHURWQV7z5rzuCFE07UJ7J+VsKCXseze5WQGEevBupP6kFelzf8ZMyvzF+oI5T7vigkHwmQAtl4VZ5d8RiQyHiHBwj2N9xyOnHuDbgJC4cnUOWPtJGWLZoHEO2ylVINiW9GdQydU5kiVdKYPfMWY6L8y9e3CWr/uoXHEjVrM3CSYioheclh8dxjaSjdNRBpoTkf56wOsg0ZycurWZmX9AMzBF31BERtwyU2kjAdhpBf9n+Edd82GgNvbvGYnS1gJwtf+GuZruI+rw6dxBGkN2y0rnaE/7wiEMy9CEy4HlWHsuzXNjr49il8g3hTZQEG7jxrD+5dbhIaZMnRdd4rjCEG2zakAfBm60NrYI6J9BZSPRlbM0bhAMU0Z/4SAqT/K9xZOJSzFJl9yD0ZfvGoCAMWrHwDWky0GoshjS8MpriEc1rMs7EHQIr9Gi3iDt2WCl3PG5VuC7UD1vNeeGn3KR6WYQbzpg3/OBDFGBAvwFc7fNg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(396003)(136003)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(82310400011)(186009)(40470700004)(46966006)(36840700001)(316002)(2616005)(426003)(336012)(16526019)(1076003)(26005)(36860700001)(82740400003)(81166007)(356005)(86362001)(36756003)(83380400001)(40460700003)(47076005)(54906003)(8936002)(4326008)(70586007)(70206006)(110136005)(5660300002)(41300700001)(44832011)(2906002)(8676002)(6666004)(40480700001)(966005)(45080400002)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 19:32:43.1102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5865340-9ccb-41ca-dda5-08dbeb91cc32 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4371 Based on comments from other vfio vendors and the maintainer the vfio/pds driver changed the reset_lock to a mutex_lock. As part of that change it was requested that the other vendor drivers be changed as well. So, make the change. The comment that requested the change for reference: https://lore.kernel.org/kvm/BN9PR11MB52769E037CB356AB15A0D9B88CA0A@BN9PR11MB5276.namprd11.prod.outlook.com/ Also, make checkpatch happy by moving the lock comment. Signed-off-by: Brett Creeley --- drivers/vfio/pci/mlx5/cmd.c | 3 ++- drivers/vfio/pci/mlx5/cmd.h | 3 +-- drivers/vfio/pci/mlx5/main.c | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/vfio/pci/mlx5/cmd.c b/drivers/vfio/pci/mlx5/cmd.c index efd1d252cdc9..5cf68ab2bbd7 100644 --- a/drivers/vfio/pci/mlx5/cmd.c +++ b/drivers/vfio/pci/mlx5/cmd.c @@ -202,6 +202,7 @@ void mlx5vf_cmd_remove_migratable(struct mlx5vf_pci_core_device *mvdev) mlx5_sriov_blocking_notifier_unregister(mvdev->mdev, mvdev->vf_id, &mvdev->nb); destroy_workqueue(mvdev->cb_wq); + mutex_destroy(&mvdev->reset_mutex); } void mlx5vf_cmd_set_migratable(struct mlx5vf_pci_core_device *mvdev, @@ -238,7 +239,7 @@ void mlx5vf_cmd_set_migratable(struct mlx5vf_pci_core_device *mvdev, goto end; mutex_init(&mvdev->state_mutex); - spin_lock_init(&mvdev->reset_lock); + mutex_init(&mvdev->reset_mutex); mvdev->nb.notifier_call = mlx5fv_vf_event; ret = mlx5_sriov_blocking_notifier_register(mvdev->mdev, mvdev->vf_id, &mvdev->nb); diff --git a/drivers/vfio/pci/mlx5/cmd.h b/drivers/vfio/pci/mlx5/cmd.h index f2c7227fa683..1cfd126724a2 100644 --- a/drivers/vfio/pci/mlx5/cmd.h +++ b/drivers/vfio/pci/mlx5/cmd.h @@ -183,8 +183,7 @@ struct mlx5vf_pci_core_device { /* protect migration state */ struct mutex state_mutex; enum vfio_device_mig_state mig_state; - /* protect the reset_done flow */ - spinlock_t reset_lock; + struct mutex reset_mutex; /* protect the reset_done flow */ struct mlx5_vf_migration_file *resuming_migf; struct mlx5_vf_migration_file *saving_migf; struct mlx5_vhca_page_tracker tracker; diff --git a/drivers/vfio/pci/mlx5/main.c b/drivers/vfio/pci/mlx5/main.c index b6ac66c5008d..689edfd750e1 100644 --- a/drivers/vfio/pci/mlx5/main.c +++ b/drivers/vfio/pci/mlx5/main.c @@ -1284,16 +1284,16 @@ mlx5vf_pci_step_device_state_locked(struct mlx5vf_pci_core_device *mvdev, void mlx5vf_state_mutex_unlock(struct mlx5vf_pci_core_device *mvdev) { again: - spin_lock(&mvdev->reset_lock); + mutex_lock(&mvdev->reset_mutex); if (mvdev->deferred_reset) { mvdev->deferred_reset = false; - spin_unlock(&mvdev->reset_lock); + mutex_unlock(&mvdev->reset_mutex); mvdev->mig_state = VFIO_DEVICE_STATE_RUNNING; mlx5vf_disable_fds(mvdev); goto again; } mutex_unlock(&mvdev->state_mutex); - spin_unlock(&mvdev->reset_lock); + mutex_unlock(&mvdev->reset_mutex); } static struct file * @@ -1372,13 +1372,13 @@ static void mlx5vf_pci_aer_reset_done(struct pci_dev *pdev) * In case the state_mutex was taken already we defer the cleanup work * to the unlock flow of the other running context. */ - spin_lock(&mvdev->reset_lock); + mutex_lock(&mvdev->reset_mutex); mvdev->deferred_reset = true; if (!mutex_trylock(&mvdev->state_mutex)) { - spin_unlock(&mvdev->reset_lock); + mutex_unlock(&mvdev->reset_mutex); return; } - spin_unlock(&mvdev->reset_lock); + mutex_unlock(&mvdev->reset_mutex); mlx5vf_state_mutex_unlock(mvdev); } From patchwork Wed Nov 22 19:32:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brett Creeley X-Patchwork-Id: 13465412 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="NBcHUG4I" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2075.outbound.protection.outlook.com [40.107.244.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 052741A4; Wed, 22 Nov 2023 11:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gZD6F19C1ldYpHCzsQEdQuP4sHJmpnH7eu2U70ByzftUnT4ubkPMswS/LOh8//uBdYHObyJR+fuJZBnjqBD2DuQCELXwL8v0z1TAG9YER4OwqyU9Wjf9lDcqABaniR3FOf2w2OofkW7GgIV2bgUHSyPTCVy2MJ+xf6ES1KF0M1R8RInp8isHVrPzsvqNJ2D01W4IZoaoSIehWmeQ3ISAuQjnc8NtN1J6N5rfrtBOypqjXbcTPozoYc2N1eHwlUQvNrf4LBJ2sOSIN5DBesfivjpcEM5ezZ9ttDjq8FU70SHel/i9L6RD7+RdT4+ZkgdAGYGVYxFKkjXh/ujsuoL5lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7DuhM4Gik8C4Gpzu/tFt4Op3SrlDCB6Fy52QG6z+0OM=; b=hKBJiSoxaT8Ebb62ONUStYjTHe0DU6b8Xg4hL1AcZ4rZxHGVK6NYSGtf7Avc4TBJ1i2e7/SKYYCuV5QNCO+x9R5aUjwgDwSgYJgVDyHrmpF+0XYaODjAkgmKWKHR6Clt5MvGP9HOcGzWTYmWvi7tvk/J99nhHLdZS+mgT0SDnfnhR7hWC6m6Gnbiob7P7sU4teNcWEmauaBiomOyp9md/5Enj8PuKg9TtcZpaaSFmHgt4S0n0A9FS81E5RlWaJNoV7gXfjVaLj7ERJKrtbt6rl2lpwquz6J5gdh5gTXDbr0fl0aRRF4pRtKL4qxC5yYakCrLBxHcdNCJ7e/xPTXk0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ziepe.ca smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7DuhM4Gik8C4Gpzu/tFt4Op3SrlDCB6Fy52QG6z+0OM=; b=NBcHUG4I8Psn3S9yTwDG4mCQGeWH6M0UjepvCxLvBeqORQxjyr8XwvPOyYNOdnOdyLvoNVkP3BkBhw4qCOchwY3OaKDXy595MDmsgMchKypyhlHf0KajRIk3kAotW65f4DIm+JqJIe8vGbe8q+gd+ySijW925HmerxxMqTcnTng= Received: from BN9PR03CA0850.namprd03.prod.outlook.com (2603:10b6:408:13d::15) by DM4PR12MB8476.namprd12.prod.outlook.com (2603:10b6:8:17e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 19:32:45 +0000 Received: from SN1PEPF0002636D.namprd02.prod.outlook.com (2603:10b6:408:13d:cafe::88) by BN9PR03CA0850.outlook.office365.com (2603:10b6:408:13d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18 via Frontend Transport; Wed, 22 Nov 2023 19:32:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Wed, 22 Nov 2023 19:32:45 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 22 Nov 2023 13:32:39 -0600 From: Brett Creeley To: , , , , , , CC: , Subject: [PATCH vfio 2/2] vfio/mlx5: Destroy the state_mutex on release Date: Wed, 22 Nov 2023 11:32:03 -0800 Message-ID: <20231122193203.26127-3-brett.creeley@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231122193203.26127-1-brett.creeley@amd.com> References: <20231122193203.26127-1-brett.creeley@amd.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|DM4PR12MB8476:EE_ X-MS-Office365-Filtering-Correlation-Id: ae19381b-b9a3-4e40-7f9d-08dbeb91cd79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HT+QIutJrjXPoZBAE0cpsc3hSc5iVtNDNXtMobQOajj1FefPKWMvl6bL8a3Bg6DixVCxK5he9paSbvDLBmVmarN35W7qr6PVHtl02DjViIZXa6yar52EJFp+TESZAjt0j5WsDprCgEu5O1bW5DQHHZknnHCdNh8RQVF3wG/NmFd5FWzE8sRETCGKWgWCvk7Nn3ecIan0McOTKhBlo6EZ8MQOXJ6sq6l9XTjovQmcfUkz2o8mHCq6CIgVro1+my5W3UOrdnRUwLteVffiMo28pgVfJcms1pjIStp+aQTnYaCdngIH128e1P45mdjTvYd2b0pUjOF/jjEfysoaAWdqD0XKJPpyG4pV1rQx0xbjP6T9U5xB+7orAk4YbKtWbXB1FPRHHMVc9SjhkpfX9BPpJL9wmrU4ux8UV38+qIffgGjJyWD2bdYnL4348YQw2s5hsJTojNIT1zzz2l6ybLxUS0IIQbyGthf+MY9aXCZCay23ur6vbwl7jiSqHOrPdkVnrBU5jjONniwQcaBLK4wUNc24kyIqrNpv/XsI93EszDbEKOk83mw5h2xRULLZITlwL0o7NYawQ1IbvoFneyt+BEeznUaFWr892qwhxPwSsA+NresnKUZwy+hylT7u9Bl19GOMyiBh8/9EivsBw31cmSLMqBwio5R4XaYIR3coUo0bwdmuaIRcJbfNQ9ttuU4f6avwxlJMav2/TA/V9v08/JRxoUi17DJgqA6S7PBlExRGwVlQ7+9nzQxLOiHozcnW7JsRWqpLfN0s6S+0R0oL1Q== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(376002)(39860400002)(136003)(396003)(230922051799003)(451199024)(1800799012)(82310400011)(64100799003)(186009)(36840700001)(46966006)(40470700004)(40480700001)(82740400003)(83380400001)(336012)(426003)(1076003)(2616005)(16526019)(26005)(8936002)(8676002)(4326008)(44832011)(36860700001)(47076005)(356005)(81166007)(40460700003)(6666004)(478600001)(316002)(110136005)(54906003)(70586007)(70206006)(41300700001)(36756003)(2906002)(4744005)(86362001)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 19:32:45.2509 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae19381b-b9a3-4e40-7f9d-08dbeb91cd79 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8476 The state_mutex is initialized in vfio init, but never destroyed. This isn't required as mutex_destroy() doesn't do anything unless lock debugging is enabled. However, for completeness, fix it. No fixes tag is added as it doesn't seem worthwhile for such a trivial and debug only change. Signed-off-by: Brett Creeley --- drivers/vfio/pci/mlx5/cmd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vfio/pci/mlx5/cmd.c b/drivers/vfio/pci/mlx5/cmd.c index 5cf68ab2bbd7..4ae5295757b4 100644 --- a/drivers/vfio/pci/mlx5/cmd.c +++ b/drivers/vfio/pci/mlx5/cmd.c @@ -203,6 +203,7 @@ void mlx5vf_cmd_remove_migratable(struct mlx5vf_pci_core_device *mvdev) &mvdev->nb); destroy_workqueue(mvdev->cb_wq); mutex_destroy(&mvdev->reset_mutex); + mutex_destroy(&mvdev->state_mutex); } void mlx5vf_cmd_set_migratable(struct mlx5vf_pci_core_device *mvdev,