From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39718 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWAMh-0007OH-3W for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:47:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWAMc-0002XT-6F for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:47:17 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:52872) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWAMc-0002Vy-41 for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:47:14 -0400 Received: by mail-gw0-f45.google.com with SMTP id 20so3345933gwj.4 for ; Tue, 06 Jul 2010 08:47:13 -0700 (PDT) Message-ID: <4C334FFB.40604@codemonkey.ws> Date: Tue, 06 Jul 2010 10:47:07 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] scsi: Fix SCSI bus reset References: <4C32F01B.7080101@siemens.com> In-Reply-To: <4C32F01B.7080101@siemens.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel On 07/06/2010 03:58 AM, Jan Kiszka wrote: > 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 > Applied. Thanks. Regards, Anthony Liguori > --- > hw/lsi53c895a.c | 15 +++++++++++++-- > 1 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c > index 9a37fed..249c6bf 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; > } >