From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: liulongfang <liulongfang@huawei.com>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"Jonathan Cameron" <jonathan.cameron@huawei.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linuxarm@openeuler.org" <linuxarm@openeuler.org>
Subject: RE: [PATCH v2 3/5] hisi_acc_vfio_pci: bugfix cache write-back issue
Date: Thu, 19 Dec 2024 10:01:31 +0000 [thread overview]
Message-ID: <6e905c2baf9f4dafaa2d1f2e9113252b@huawei.com> (raw)
In-Reply-To: <20241219091800.41462-4-liulongfang@huawei.com>
> -----Original Message-----
> From: liulongfang <liulongfang@huawei.com>
> Sent: Thursday, December 19, 2024 9:18 AM
> To: alex.williamson@redhat.com; jgg@nvidia.com; Shameerali Kolothum
> Thodi <shameerali.kolothum.thodi@huawei.com>; Jonathan Cameron
> <jonathan.cameron@huawei.com>
> Cc: kvm@vger.kernel.org; linux-kernel@vger.kernel.org;
> linuxarm@openeuler.org; liulongfang <liulongfang@huawei.com>
> Subject: [PATCH v2 3/5] hisi_acc_vfio_pci: bugfix cache write-back issue
>
> At present, cache write-back is placed in the device data
> copy stage after stopping the device operation.
> Writing back to the cache at this stage will cause the data
> obtained by the cache to be written back to be empty.
>
> In order to ensure that the cache data is written back
> successfully, the data needs to be written back into the
> stop device stage.
>
> Fixes:b0eed085903e("hisi_acc_vfio_pci: Add support for VFIO live
> migration")
> Signed-off-by: Longfang Liu <liulongfang@huawei.com>
> ---
> drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> index 4c8f1ae5b636..c057c0e24693 100644
> --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> @@ -559,7 +559,6 @@ static int vf_qm_state_save(struct
> hisi_acc_vf_core_device *hisi_acc_vdev,
> {
> struct acc_vf_data *vf_data = &migf->vf_data;
> struct hisi_qm *vf_qm = &hisi_acc_vdev->vf_qm;
> - struct device *dev = &vf_qm->pdev->dev;
> int ret;
>
> if (unlikely(qm_wait_dev_not_ready(vf_qm))) {
> @@ -573,12 +572,6 @@ static int vf_qm_state_save(struct
> hisi_acc_vf_core_device *hisi_acc_vdev,
> vf_data->vf_qm_state = QM_READY;
> hisi_acc_vdev->vf_qm_state = vf_data->vf_qm_state;
>
> - ret = vf_qm_cache_wb(vf_qm);
> - if (ret) {
> - dev_err(dev, "failed to writeback QM Cache!\n");
> - return ret;
> - }
> -
> ret = vf_qm_read_data(vf_qm, vf_data);
> if (ret)
> return -EINVAL;
> @@ -1005,6 +998,13 @@ static int hisi_acc_vf_stop_device(struct
> hisi_acc_vf_core_device *hisi_acc_vdev
> dev_err(dev, "failed to check QM INT state!\n");
> return ret;
> }
> +
> + ret = vf_qm_cache_wb(vf_qm);
> + if (ret) {
> + dev_err(dev, "failed to writeback QM cache!\n");
> + return ret;
> + }
> +
> return 0;
> }
Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Thanks,
Shameer
next prev parent reply other threads:[~2024-12-19 10:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 9:17 [PATCH v2 0/5] bugfix some driver issues Longfang Liu
2024-12-19 9:17 ` [PATCH v2 1/5] hisi_acc_vfio_pci: fix XQE dma address error Longfang Liu
2024-12-19 10:01 ` Shameerali Kolothum Thodi
2024-12-27 7:24 ` liulongfang
2025-01-02 22:30 ` Alex Williamson
2025-01-13 9:43 ` liulongfang
2025-01-13 13:34 ` Alex Williamson
2025-01-13 19:45 ` Alex Williamson
2025-01-14 3:17 ` liulongfang
2025-01-14 8:07 ` Shameerali Kolothum Thodi
2025-01-14 13:54 ` Alex Williamson
2024-12-19 9:17 ` [PATCH v2 2/5] hisi_acc_vfio_pci: add eq and aeq interruption restore Longfang Liu
2024-12-19 10:01 ` Shameerali Kolothum Thodi
2024-12-19 9:17 ` [PATCH v2 3/5] hisi_acc_vfio_pci: bugfix cache write-back issue Longfang Liu
2024-12-19 10:01 ` Shameerali Kolothum Thodi [this message]
2024-12-19 9:17 ` [PATCH v2 4/5] hisi_acc_vfio_pci: bugfix the problem of uninstalling driver Longfang Liu
2024-12-19 10:01 ` Shameerali Kolothum Thodi
2024-12-19 9:18 ` [PATCH v2 5/5] hisi_acc_vfio_pci: bugfix live migration function without VF device driver Longfang Liu
2024-12-19 10:02 ` Shameerali Kolothum Thodi
2024-12-27 7:20 ` liulongfang
2024-12-19 10:23 ` [PATCH v2 0/5] bugfix some driver issues Shameerali Kolothum Thodi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6e905c2baf9f4dafaa2d1f2e9113252b@huawei.com \
--to=shameerali.kolothum.thodi@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=jgg@nvidia.com \
--cc=jonathan.cameron@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=liulongfang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox