From 6589d0c33708ccb47417eeed3bd247d8aa998d26 Mon Sep 17 00:00:00 2001 From: Liu Long Date: Mon, 6 Jun 2022 21:15:50 +0800 Subject: [PATCH] ACRN:DM: Fix USB msi capability access issue. This patch fix the USB msi capability access failed issue and fix the MSI pending bit clear bugs. Tracked-On: #7697 Signed-off-by: Liu Long --- devicemodel/hw/pci/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devicemodel/hw/pci/core.c b/devicemodel/hw/pci/core.c index 4f52a76a4..1dbfbd8f1 100644 --- a/devicemodel/hw/pci/core.c +++ b/devicemodel/hw/pci/core.c @@ -1069,7 +1069,7 @@ static int pci_access_msi(struct pci_vdev *dev, int msi_cap, uint32_t *val, bool is_write) { uint16_t msgctrl; - int rc, offset; + int rc, offset = 0; if (msi_cap > PCIR_MSI_PENDING) { pr_err("%s: Msi capability length is out of msi length!\n", __func__); @@ -1133,7 +1133,7 @@ pci_set_msi_pending(struct pci_vdev *dev, uint32_t index, bool set) if (set) val = (1 << index) | val; else - val = (~(1 << index)) | val; + val = (~(1 << index)) & val; pci_access_msi(dev, PCIR_MSI_PENDING, &val, true); }