From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UegUQ-00080Z-Ce for qemu-devel@nongnu.org; Tue, 21 May 2013 02:56:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UegUG-00030l-W4 for qemu-devel@nongnu.org; Tue, 21 May 2013 02:56:06 -0400 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]:49279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UegUG-00030P-P9 for qemu-devel@nongnu.org; Tue, 21 May 2013 02:55:56 -0400 Received: by mail-pb0-f51.google.com with SMTP id jt11so302794pbb.38 for ; Mon, 20 May 2013 23:55:55 -0700 (PDT) Sender: Peter Crosthwaite From: peter.crosthwaite@xilinx.com Date: Tue, 21 May 2013 16:51:37 +1000 Message-Id: <1f5bfe802b3e21ac5860ee02ed21dd8cd9d5f98a.1369118806.git.peter.crosthwaite@xilinx.com> In-Reply-To: References: Subject: [Qemu-devel] [PATCH arm-devs v1 3/5] sd/sdhci: Fix Buffer Write Ready interrupt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, i.mitsyanko@samsung.com, edgar.iglesias@gmail.com 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 --- 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.8.3.rc1.44.gb387c77.dirty