[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 13/15] megasas: remove unnecessary megasas_use_ms
From: |
Cao jin |
Subject: |
[Qemu-devel] [PATCH v7 13/15] megasas: remove unnecessary megasas_use_msi() |
Date: |
Mon, 6 Jun 2016 16:01:00 +0800 |
megasas overwrite user configuration when msi_init fail to reflect internal msi
state, which is unsuitable. megasa_use_msi() is unnecessary, we can call
msi_uninit() when unrealize, even no bother to call msi_enabled() first.
cc: Hannes Reinecke <address@hidden>
cc: Paolo Bonzini <address@hidden>
cc: Markus Armbruster <address@hidden>
cc: Marcel Apfelbaum <address@hidden>
cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Cao jin <address@hidden>
---
hw/scsi/megasas.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 5c57106..84d7885 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -155,11 +155,6 @@ static bool megasas_use_queue64(MegasasState *s)
return s->flags & MEGASAS_MASK_USE_QUEUE64;
}
-static bool megasas_use_msi(MegasasState *s)
-{
- return s->msi != ON_OFF_AUTO_OFF;
-}
-
static bool megasas_use_msix(MegasasState *s)
{
return s->msix != ON_OFF_AUTO_OFF;
@@ -2307,9 +2302,7 @@ static void megasas_scsi_uninit(PCIDevice *d)
if (megasas_use_msix(s)) {
msix_uninit(d, &s->mmio_io, &s->mmio_io);
}
- if (megasas_use_msi(s)) {
- msi_uninit(d);
- }
+ msi_uninit(d);
}
static const struct SCSIBusInfo megasas_scsi_info = {
@@ -2340,7 +2333,7 @@ static void megasas_scsi_realize(PCIDevice *dev, Error
**errp)
/* Interrupt pin 1 */
pci_conf[PCI_INTERRUPT_PIN] = 0x01;
- if (megasas_use_msi(s)) {
+ if (s->msi != ON_OFF_AUTO_OFF) {
ret = msi_init(dev, 0x50, 1, true, false, &err);
/* Any error other than -ENOTSUP(board's MSI support is broken)
* is a programming error */
@@ -2351,10 +2344,8 @@ static void megasas_scsi_realize(PCIDevice *dev, Error
**errp)
"msi=off with this machine type.\n");
error_propagate(errp, err);
return;
- } else if (ret) {
- s->msi = ON_OFF_AUTO_OFF;
}
-
+ assert(!err || s->msi == ON_OFF_AUTO_AUTO);
/* With msi=auto, we fall back to MSI off silently */
error_free(err);
}
--
2.1.0
- [Qemu-devel] [PATCH v7 03/15] change pvscsi_init_msi() type to void, (continued)
- [Qemu-devel] [PATCH v7 03/15] change pvscsi_init_msi() type to void, Cao jin, 2016/06/06
- [Qemu-devel] [PATCH v7 07/15] intel-hda: change msi property type, Cao jin, 2016/06/06
- [Qemu-devel] [PATCH v7 05/15] mptsas: change .realize function name, Cao jin, 2016/06/06
- [Qemu-devel] [PATCH v7 15/15] vmw_pvscsi: remove unnecessary internal msi state flag, Cao jin, 2016/06/06
- [Qemu-devel] [PATCH v7 12/15] pci: Convert msi_init() to Error and fix callers to check it, Cao jin, 2016/06/06
- [Qemu-devel] [PATCH v7 13/15] megasas: remove unnecessary megasas_use_msi(),
Cao jin <=
- [Qemu-devel] [PATCH v7 11/15] msi_init: change return value to 0 on success, Cao jin, 2016/06/06
- [Qemu-devel] [PATCH v7 09/15] megasas: change msi/msix property type, Cao jin, 2016/06/06
- Re: [Qemu-devel] [PATCH v7 00/15] Add param Error ** for msi_init(), Cao jin, 2016/06/08
- Re: [Qemu-devel] [PATCH v7 00/15] Add param Error ** for msi_init(), Markus Armbruster, 2016/06/09