From: Jan Kiszka Date: Tue, 6 Jul 2010 08:58:03 +0000 (+0200) Subject: scsi: Fix SCSI bus reset X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~7459 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=680a34eeb8f2d455121c67697fca146440e61612;p=sdk%2Femulator%2Fqemu.git scsi: Fix SCSI bus reset When the controller raises the SCSI reset line, we have to perform the requested reset on all disks attached to the controller's bus. Moreover, reset is edge triggered, so avoid repeating it if the line was already high. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 1bb1caf..bd7b661 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -1590,8 +1590,19 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val) BADF("Immediate Arbritration not implemented\n"); } if (val & LSI_SCNTL1_RST) { - s->sstat0 |= LSI_SSTAT0_RST; - lsi_script_scsi_interrupt(s, LSI_SIST0_RST, 0); + if (!(s->sstat0 & LSI_SSTAT0_RST)) { + DeviceState *dev; + int id; + + for (id = 0; id < s->bus.ndev; id++) { + if (s->bus.devs[id]) { + dev = &s->bus.devs[id]->qdev; + dev->info->reset(dev); + } + } + s->sstat0 |= LSI_SSTAT0_RST; + lsi_script_scsi_interrupt(s, LSI_SIST0_RST, 0); + } } else { s->sstat0 &= ~LSI_SSTAT0_RST; }