* [Qemu-devel] [PATCH] lsi: Properly initialize controller state on reset
@ 2010-04-29 16:54 Jan Kiszka
2010-04-30 10:57 ` [Qemu-devel] " Jan Kiszka
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-04-29 16:54 UTC (permalink / raw)
To: qemu-devel
The LSI controller was lacking any system reset handler. This is an
attempt to fix it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/lsi53c895a.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 98b7f54..f328057 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -1996,6 +1996,16 @@ 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);
+
+ s->dma_buf = NULL;
+ s->current_dma_len = 0;
+ s->active_commands = 0;
+ lsi_soft_reset(s);
+}
+
static void lsi_pre_save(void *opaque)
{
LSIState *s = opaque;
@@ -2149,6 +2159,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] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] lsi: Properly initialize controller state on reset
2010-04-29 16:54 [Qemu-devel] [PATCH] lsi: Properly initialize controller state on reset Jan Kiszka
@ 2010-04-30 10:57 ` Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2010-04-30 10:57 UTC (permalink / raw)
Cc: qemu-devel
Jan Kiszka wrote:
> The LSI controller was lacking any system reset handler. This is an
> attempt to fix it.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> hw/lsi53c895a.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
> index 98b7f54..f328057 100644
> --- a/hw/lsi53c895a.c
> +++ b/hw/lsi53c895a.c
> @@ -1996,6 +1996,16 @@ 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);
> +
> + s->dma_buf = NULL;
> + s->current_dma_len = 0;
> + s->active_commands = 0;
OK, this 0.12 patch obviously no longer applies. And purging the command
queue should not only be done on hard reset, but also when software
triggered it (ie. move it to lsi_soft_reset). Reworking...
Jan
> + lsi_soft_reset(s);
> +}
> +
> static void lsi_pre_save(void *opaque)
> {
> LSIState *s = opaque;
> @@ -2149,6 +2159,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,
>
>
>
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-30 10:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-29 16:54 [Qemu-devel] [PATCH] lsi: Properly initialize controller state on reset Jan Kiszka
2010-04-30 10:57 ` [Qemu-devel] " 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).