linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: david.lanzendoerfer@o2s.ch (David Lanzendörfer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] mmc: sunxi: Fix setup of last descriptor of dma transfer
Date: Tue, 16 Dec 2014 15:10:59 +0100	[thread overview]
Message-ID: <20141216141059.3036.53205.stgit@dizzy-6.o2s.ch> (raw)
In-Reply-To: <20141216140921.3036.14668.stgit@dizzy-6.o2s.ch>

From: Hans de Goede <hdegoede@redhat.com>

The last descriptor might be the first descriptor as well, so use masking to
add the LD (last descriptor) bit and drop the DIC (disable interrupt on
completion) bit rather then hard assignment as hard assigment will override
the FD (first descriptor) bit if there is only 1 descriptor.

Also set the ER (end of ring) bit and clear buf_addr_ptr2 on the last
descriptor, like the android kernel code does.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: David Lanzend?rfer <david.lanzendoerfer@o2s.ch>
Reported-by: ?? <lixiang@allwinnertech.com>
---
 drivers/mmc/host/sunxi-mmc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 15cb8b7..1fe54a8 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -310,7 +310,9 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,
 	}
 
 	pdes[0].config |= SDXC_IDMAC_DES0_FD;
-	pdes[i - 1].config = SDXC_IDMAC_DES0_OWN | SDXC_IDMAC_DES0_LD;
+	pdes[i - 1].config |= SDXC_IDMAC_DES0_LD | SDXC_IDMAC_DES0_ER;
+	pdes[i - 1].config &= ~SDXC_IDMAC_DES0_DIC;
+	pdes[i - 1].buf_addr_ptr2 = 0;
 
 	/*
 	 * Avoid the io-store starting the idmac hitting io-mem before the

  reply	other threads:[~2014-12-16 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 14:10 [PATCH 0/4] mmc: sunxi: General fixup (v2) David Lanzendörfer
2014-12-16 14:10 ` David Lanzendörfer [this message]
2014-12-16 14:11 ` [PATCH 2/4] mmc: sunxi: Lock fix David Lanzendörfer
2014-12-16 14:11 ` [PATCH 3/4] mmc: sunxi: Correcting SDXC_HARDWARE_RESET bit David Lanzendörfer
2014-12-16 14:11 ` [PATCH 4/4] mmc: sunxi: Removing unused code David Lanzendörfer
2014-12-16 14:12 ` [PATCH 0/4] mmc: sunxi: General fixup (v2) Hans de Goede
2014-12-19 12:32 ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141216141059.3036.53205.stgit@dizzy-6.o2s.ch \
    --to=david.lanzendoerfer@o2s.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).