Received: from eggs.gnu.org ([2001:4830:134:3::10]:42217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjYzU-0006Oa-09 for qemu-devel@nongnu.org; Mon, 03 Jun 2013 13:56:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjY30-0006MF-3P for qemu-devel@nongnu.org; Mon, 03 Jun 2013 12:56:19 -0400 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:57809 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjY2z-0006LI-AJ for qemu-devel@nongnu.org; Mon, 03 Jun 2013 12:55:53 -0400 From: Peter Maydell Date: Mon, 3 Jun 2013 17:30:14 +0100 Message-Id: <1370277021-26129-18-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1370277021-26129-1-git-send-email-peter.maydell@linaro.org> References: <1370277021-26129-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 17/24] sd/sdhci: Fix Buffer Write Ready interrupt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Paul Brook From: Peter Crosthwaite This interrupt is not risen after the last block is written to sd. It is mutually exclusive with the end of transfer conditions. Fix. Signed-off-by: Peter Crosthwaite Reviewed-by: Igor Mitsyanko Message-id: 7ca9fd3e03ce1bec94aff08f607c15a0ec3d3371.1369370934.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell --- hw/sd/sdhci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 0a84540..ea510b5 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -405,15 +405,14 @@ static void sdhci_write_block_to_card(SDHCIState *s) /* Next data can be written through BUFFER DATORT register */ s->prnsts |= SDHC_SPACE_AVAILABLE; - if (s->norintstsen & SDHC_NISEN_WBUFRDY) { - s->norintsts |= SDHC_NIS_WBUFRDY; - } /* Finish transfer if that was the last block of data */ if ((s->trnmod & SDHC_TRNS_MULTI) == 0 || ((s->trnmod & SDHC_TRNS_MULTI) && (s->trnmod & SDHC_TRNS_BLK_CNT_EN) && (s->blkcnt == 0))) { SDHCI_GET_CLASS(s)->end_data_transfer(s); + } else if (s->norintstsen & SDHC_NISEN_WBUFRDY) { + s->norintsts |= SDHC_NIS_WBUFRDY; } /* Generate Block Gap Event if requested and if not the last block */ -- 1.7.9.5