From patchwork Wed May 22 13:37:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 245620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5564D2C009F for ; Wed, 22 May 2013 23:38:44 +1000 (EST) Received: from localhost ([::1]:35094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf9Fa-0008Tz-HP for incoming@patchwork.ozlabs.org; Wed, 22 May 2013 09:38:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf9Ex-0008FX-M7 for qemu-devel@nongnu.org; Wed, 22 May 2013 09:38:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf9Eu-0006Uz-2T for qemu-devel@nongnu.org; Wed, 22 May 2013 09:38:03 -0400 Received: from mail-oa0-f50.google.com ([209.85.219.50]:42486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf9Et-0006St-GF for qemu-devel@nongnu.org; Wed, 22 May 2013 09:37:59 -0400 Received: by mail-oa0-f50.google.com with SMTP id l20so2544420oag.23 for ; Wed, 22 May 2013 06:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=U7bzi1tM5oDQRiWOp6Dsf0cpomdwDJF9+uswU5f9m+o=; b=rjrWkrzG05zoH9vvfyTQHYlfjPYCYNPRl7xo+X3XtmkCYikdUDTUV5zvkHxK3icfiW HXuXUo3e93zJ0jcdRVnbNiMZ0G//5oRFwE9OBNFhBnDsct6aQK7jDSgGKF0CiP7rmRoO Upvhqmy9bMAv/548xXI50IUe2PqXZ4YkvfZJdw8YoMRVGtq3oHFDYEKeCucf833d1Ic7 ftu9ryRlQVbeMTlirNrcUpzlfK5iTEc+9BcOybNrgDOvmU6w4Dzyf0ce15dE6YVdPhuy 6U8qiqkyBs0M63/ev6ZfN3UsMrB6DYF8mBD6S9rZ7lq+2ksT9cmU19CKPFsb4mWXkHjp +zhA== MIME-Version: 1.0 X-Received: by 10.182.78.41 with SMTP id y9mr4633036obw.69.1369229878931; Wed, 22 May 2013 06:37:58 -0700 (PDT) Received: by 10.76.13.129 with HTTP; Wed, 22 May 2013 06:37:58 -0700 (PDT) Date: Wed, 22 May 2013 17:37:58 +0400 Message-ID: From: Igor Mitsyanko To: peter.crosthwaite@xilinx.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.219.50 Cc: Peter Maydell , qemu-devel@nongnu.org, edgar.iglesias@gmail.com Subject: Re: [Qemu-devel] [PATCH arm-devs v1 3/5] sd/sdhci: Fix Buffer Write Ready interrupt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 05/21/2013 10:51 AM, peter.crosthwaite@xilinx.com wrote: 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(-) Reviewed-by: Igor Mitsyanko -- Best wishes, Igor Mitsyanko email: i.mitsyanko@gmail.com 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 */