* [Qemu-devel] [PATCH v2 2/2] lsi: Properly initialize controller state on reset
@ 2010-04-30 12:06 Jan Kiszka
0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2010-04-30 12:06 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
The LSI controller was lacking a system reset handler. Simply invoke the
existing soft reset handler in this case. This also allows to drop its
explicit invocation during init.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/lsi53c895a.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index ad23ece..85eea15 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -2007,6 +2007,13 @@ static void lsi_mmio_mapfunc(PCIDevice *pci_dev, int region_num,
cpu_register_physical_memory(addr + 0, 0x400, s->mmio_io_addr);
}
+static void lsi_scsi_reset(DeviceState *dev)
+{
+ LSIState *s = DO_UPCAST(LSIState, dev.qdev, dev);
+
+ lsi_soft_reset(s);
+}
+
static void lsi_pre_save(void *opaque)
{
LSIState *s = opaque;
@@ -2147,8 +2154,6 @@ static int lsi_scsi_init(PCIDevice *dev)
PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_ram_mapfunc);
QTAILQ_INIT(&s->queue);
- lsi_soft_reset(s);
-
scsi_bus_new(&s->bus, &dev->qdev, 1, LSI_MAX_DEVS, lsi_command_complete);
if (!dev->qdev.hotplugged) {
scsi_bus_legacy_handle_cmdline(&s->bus);
@@ -2160,6 +2165,7 @@ static PCIDeviceInfo lsi_info = {
.qdev.name = "lsi53c895a",
.qdev.alias = "lsi",
.qdev.size = sizeof(LSIState),
+ .qdev.reset = lsi_scsi_reset,
.qdev.vmsd = &vmstate_lsi_scsi,
.init = lsi_scsi_init,
.exit = lsi_scsi_uninit,
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-04-30 12:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-30 12:06 [Qemu-devel] [PATCH v2 2/2] lsi: Properly initialize controller state on reset Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).