Received: from eggs.gnu.org ([208.118.235.92]:48587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE3aa-0000Cc-VZ for qemu-devel@nongnu.org; Fri, 08 Mar 2013 15:08:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UE3a8-0000cj-9k for qemu-devel@nongnu.org; Fri, 08 Mar 2013 15:08:24 -0500 From: Alexander Graf Date: Fri, 8 Mar 2013 21:07:03 +0100 Message-Id: <1362773228-1747-62-git-send-email-agraf@suse.de> In-Reply-To: <1362773228-1747-1-git-send-email-agraf@suse.de> References: <1362773228-1747-1-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 61/66] PPC: xnu kernel expects FLUSH to be cleared on STOP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel qemu-devel Cc: Blue Swirl , =?utf-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , "qemu-ppc@nongnu.org list:PowerPC" , =?utf-8?q?Aur=C3=A9lien=20Jarno?= From: Amadeusz S=C5=82awi=C5=84ski otherwise it gets stuck in a loop so clear it when unsetting run when flush is set void IODBDMAStop( volatile IODBDMAChannelRegisters *registers) { IOSetDBDMAChannelControl( registers, IOClearDBDMAChannelControlBits( kdbdmaRun ) | IOSetDBDMAChannelControlBits( kdbdmaFlush )); DBDMA: writel 0x0000000000000b00 <=3D 0xa0002000 DBDMA: channel 0x16 reg 0x0 DBDMA: status 0x00002000 while( IOGetDBDMAChannelStatus( registers) & ( kdbdmaActive | kdbdmaFlush)) eieio(); DBDMA: readl 0x0000000000000b04 =3D> 0x00002000 DBDMA: channel 0x16 reg 0x1 DBDMA: readl 0x0000000000000b04 =3D> 0x00002000 DBDMA: channel 0x16 reg 0x1 DBDMA: readl 0x0000000000000b04 =3D> 0x00002000 DBDMA: channel 0x16 reg 0x1 DBDMA: readl 0x0000000000000b04 =3D> 0x00002000 DBDMA: channel 0x16 reg 0x1 it continues to get printed } Signed-off-by: Amadeusz S=C5=82awi=C5=84ski [agraf: replace tabs with spaces] Signed-off-by: Alexander Graf --- hw/mac_dbdma.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/mac_dbdma.c b/hw/mac_dbdma.c index b894ab2..73d74c2 100644 --- a/hw/mac_dbdma.c +++ b/hw/mac_dbdma.c @@ -688,6 +688,10 @@ dbdma_control_write(DBDMA_channel *ch) if ((ch->regs[DBDMA_STATUS] & RUN) && !(status & RUN)) { /* RUN is cleared */ status &=3D ~(ACTIVE|DEAD); + if ((status & FLUSH) && ch->flush) { + ch->flush(&ch->io); + status &=3D ~FLUSH; + } } =20 DBDMA_DPRINTF(" status 0x%08x\n", status); --=20 1.6.0.2