]> Git Repo - qemu.git/commitdiff
pci: designware: Update MSI mapping unconditionally
authorAndrey Smirnov <[email protected]>
Mon, 1 Jul 2019 16:26:15 +0000 (17:26 +0100)
committerPeter Maydell <[email protected]>
Mon, 1 Jul 2019 16:28:59 +0000 (17:28 +0100)
Expression to calculate update_msi_mapping in code handling writes to
DESIGNWARE_PCIE_MSI_INTR0_ENABLE is missing an ! operator and should
be:

    !!root->msi.intr[0].enable ^ !!val;

so that MSI mapping is updated when enabled transitions from either
"none" -> "any" or "any" -> "none". Since that register shouldn't be
written to very often, change the code to update MSI mapping
unconditionally instead of trying to fix the update_msi_mapping logic.

Signed-off-by: Andrey Smirnov <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Acked-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/pci-host/designware.c

index 0fdfff57848ac7b6111917c82602076decb1daff..ec697c8f9dff0cae7ed56dbad2f0e0cbc161e07a 100644 (file)
@@ -297,16 +297,10 @@ static void designware_pcie_root_config_write(PCIDevice *d, uint32_t address,
         root->msi.base |= (uint64_t)val << 32;
         break;
 
-    case DESIGNWARE_PCIE_MSI_INTR0_ENABLE: {
-        const bool update_msi_mapping = !root->msi.intr[0].enable ^ !!val;
-
+    case DESIGNWARE_PCIE_MSI_INTR0_ENABLE:
         root->msi.intr[0].enable = val;
-
-        if (update_msi_mapping) {
-            designware_pcie_root_update_msi_mapping(root);
-        }
+        designware_pcie_root_update_msi_mapping(root);
         break;
-    }
 
     case DESIGNWARE_PCIE_MSI_INTR0_MASK:
         root->msi.intr[0].mask = val;
This page took 0.025909 seconds and 4 git commands to generate.