From: Longfang Liu <liulongfang@huawei.com>
To: <alex.williamson@redhat.com>, <jgg@nvidia.com>,
<shameerali.kolothum.thodi@huawei.com>
Cc: <cohuck@redhat.com>, <linux-kernel@vger.kernel.org>,
<linuxarm@openeuler.org>, <liulongfang@huawei.com>
Subject: [PATCH 4/5] hisi_acc_vfio_pci: Fix device data address combination problem
Date: Thu, 15 Sep 2022 09:31:56 +0800 [thread overview]
Message-ID: <20220915013157.60771-5-liulongfang@huawei.com> (raw)
In-Reply-To: <20220915013157.60771-1-liulongfang@huawei.com>
The queue address of the accelerator device should be combined into
a dma address in a way of combining the low and high bits.
The previous combination is wrong and needs to be modified.
Signed-off-by: Longfang Liu <liulongfang@huawei.com>
---
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
index c172a52088b7..fce49c7f5db8 100644
--- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
+++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
@@ -527,12 +527,12 @@ static int vf_qm_state_save(struct hisi_acc_vf_core_device *hisi_acc_vdev,
return -EINVAL;
/* Every reg is 32 bit, the dma address is 64 bit. */
- vf_data->eqe_dma = vf_data->qm_eqc_dw[2];
+ vf_data->eqe_dma = vf_data->qm_eqc_dw[1];
vf_data->eqe_dma <<= QM_XQC_ADDR_OFFSET;
- vf_data->eqe_dma |= vf_data->qm_eqc_dw[1];
- vf_data->aeqe_dma = vf_data->qm_aeqc_dw[2];
+ vf_data->eqe_dma |= vf_data->qm_eqc_dw[0];
+ vf_data->aeqe_dma = vf_data->qm_aeqc_dw[1];
vf_data->aeqe_dma <<= QM_XQC_ADDR_OFFSET;
- vf_data->aeqe_dma |= vf_data->qm_aeqc_dw[1];
+ vf_data->aeqe_dma |= vf_data->qm_aeqc_dw[0];
/* Through SQC_BT/CQC_BT to get sqc and cqc address */
ret = qm_get_sqc(vf_qm, &vf_data->sqc_dma);
--
2.33.0
next prev parent reply other threads:[~2022-09-15 1:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 1:31 [PATCH 0/5] Fix some bugs and clean code issues Longfang Liu
2022-09-15 1:31 ` [PATCH 1/5] hisi_acc_vfio_pci: Fixes a memory leak bug Longfang Liu
2022-09-20 16:34 ` Alex Williamson
2022-09-20 16:38 ` Jason Gunthorpe
2022-09-20 17:03 ` Shameerali Kolothum Thodi
2022-09-21 3:13 ` liulongfang
2022-09-21 7:27 ` Shameerali Kolothum Thodi
2022-09-22 7:51 ` liulongfang
2022-09-15 1:31 ` [PATCH 2/5] hisi_acc_vfio_pci: Fixes error return code issue Longfang Liu
2022-09-15 1:31 ` [PATCH 3/5] hisi_acc_vfio_pci: Remove useless function parameter Longfang Liu
2022-09-15 1:31 ` Longfang Liu [this message]
2022-09-15 1:31 ` [PATCH 5/5] hisi_acc_vfio_pci: Fix some clean code issues Longfang Liu
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=20220915013157.60771-5-liulongfang@huawei.com \
--to=liulongfang@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=jgg@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=shameerali.kolothum.thodi@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
all inboxes | Powered by JetHome®