From nobody Fri Apr 3 09:56:03 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A58F8ECAAD3 for ; Thu, 15 Sep 2022 01:36:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbiIOBgs (ORCPT ); Wed, 14 Sep 2022 21:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbiIOBgo (ORCPT ); Wed, 14 Sep 2022 21:36:44 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07D7F8C46B for ; Wed, 14 Sep 2022 18:36:43 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MSfpb4P5vzmVCC; Thu, 15 Sep 2022 09:32:55 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 15 Sep 2022 09:36:41 +0800 Received: from huawei.com (10.69.192.56) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 15 Sep 2022 09:36:41 +0800 From: Longfang Liu To: , , CC: , , , Subject: [PATCH 4/5] hisi_acc_vfio_pci: Fix device data address combination problem Date: Thu, 15 Sep 2022 09:31:56 +0800 Message-ID: <20220915013157.60771-5-liulongfang@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220915013157.60771-1-liulongfang@huawei.com> References: <20220915013157.60771-1-liulongfang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 --- 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_d= evice *hisi_acc_vdev, return -EINVAL; =20 /* Every reg is 32 bit, the dma address is 64 bit. */ - vf_data->eqe_dma =3D vf_data->qm_eqc_dw[2]; + vf_data->eqe_dma =3D vf_data->qm_eqc_dw[1]; vf_data->eqe_dma <<=3D QM_XQC_ADDR_OFFSET; - vf_data->eqe_dma |=3D vf_data->qm_eqc_dw[1]; - vf_data->aeqe_dma =3D vf_data->qm_aeqc_dw[2]; + vf_data->eqe_dma |=3D vf_data->qm_eqc_dw[0]; + vf_data->aeqe_dma =3D vf_data->qm_aeqc_dw[1]; vf_data->aeqe_dma <<=3D QM_XQC_ADDR_OFFSET; - vf_data->aeqe_dma |=3D vf_data->qm_aeqc_dw[1]; + vf_data->aeqe_dma |=3D vf_data->qm_aeqc_dw[0]; =20 /* Through SQC_BT/CQC_BT to get sqc and cqc address */ ret =3D qm_get_sqc(vf_qm, &vf_data->sqc_dma); --=20 2.33.0