From nobody Fri Dec 19 03:16:11 2025 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 1D5C91FECD7; Thu, 13 Mar 2025 07:22:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741850541; cv=none; b=a6IdwFRLPyKFRu76eT3vfl5OxUUVLvq3jLOho2NyFHGfU5kfoaStNIxY78qL19Pio5d58n965s+XFW4sJblkLiu3rGmrJo2ZvoVIIVwwW/FK6VilGPbPp+fMNlwIhEY/a4q6ku8JpL6dYnjiDrceE+XAAHHrSgcP/Wz0ZX+MaJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741850541; c=relaxed/simple; bh=MqzMTHnTEu1FeISjKQCA39NUQveXJOzahMu81/JGy6Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=g1mKAY3F9jGIt3P7fDG0rAMBaXYSgocg5Wj4qbtV0IlWhkn/bLd3pULn9YWlQDLrzTsse85ptbbfXe6zT2rpfjp3zaieEoZwbLRe7PMY71WyD5C7gTA1vPZuat8xvKI7ghDf2+FehzEt/2X5HlCM7Y8sjPKpeK08faAtiC32kCU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4ZCzTc0WfSzyRrT; Thu, 13 Mar 2025 15:22:12 +0800 (CST) Received: from kwepemg500006.china.huawei.com (unknown [7.202.181.43]) by mail.maildlp.com (Postfix) with ESMTPS id C239F1402CC; Thu, 13 Mar 2025 15:22:17 +0800 (CST) Received: from huawei.com (10.50.165.33) by kwepemg500006.china.huawei.com (7.202.181.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 13 Mar 2025 15:22:17 +0800 From: Longfang Liu To: , , , CC: , , , Subject: [PATCH v5 4/5] hisi_acc_vfio_pci: bugfix the problem of uninstalling driver Date: Thu, 13 Mar 2025 15:20:09 +0800 Message-ID: <20250313072010.57199-5-liulongfang@huawei.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20250313072010.57199-1-liulongfang@huawei.com> References: <20250313072010.57199-1-liulongfang@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemg500006.china.huawei.com (7.202.181.43) Content-Type: text/plain; charset="utf-8" In a live migration scenario. If the number of VFs at the destination is greater than the source, the recovery operation will fail and qemu will not be able to complete the process and exit after shutting down the device FD. This will cause the driver to be unable to be unloaded normally due to abnormal reference counting of the live migration driver caused by the abnormal closing operation of fd. Fixes: b0eed085903e ("hisi_acc_vfio_pci: Add support for VFIO live migratio= n") Signed-off-by: Longfang Liu Reviewed-by: Shameer Kolothum --- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/= pci/hisilicon/hisi_acc_vfio_pci.c index d96446f499ed..cadc82419dca 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c @@ -1508,6 +1508,7 @@ static void hisi_acc_vfio_pci_close_device(struct vfi= o_device *core_vdev) struct hisi_acc_vf_core_device *hisi_acc_vdev =3D hisi_acc_get_vf_dev(cor= e_vdev); struct hisi_qm *vf_qm =3D &hisi_acc_vdev->vf_qm; =20 + hisi_acc_vf_disable_fds(hisi_acc_vdev); mutex_lock(&hisi_acc_vdev->open_mutex); hisi_acc_vdev->dev_opened =3D false; iounmap(vf_qm->io_base); --=20 2.24.0