linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: linux-rpi-kernel@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
	Eric Anholt <eric@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Lee Jones <lee@kernel.org>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 4/5] mmc: bcm2835-sdhost: reset tweaks. [fixup]
Date: Wed, 22 Jun 2016 13:42:17 +0200	[thread overview]
Message-ID: <1466595738-2229-5-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1466595738-2229-1-git-send-email-kraxel@redhat.com>

Kill any pending stuff before calling reset_internal(), so there
shouldn't be any completion callbacks interfering.  This allows
to call reset_internal without lock, which in turn allows to
turn the mdelay calls into msleep calls.  Also adjust the time
from 10ms to 20ms as checkpatch warns about the 10ms.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/mmc/host/bcm2835-sdhost.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c
index 8a05c02..a895561 100644
--- a/drivers/mmc/host/bcm2835-sdhost.c
+++ b/drivers/mmc/host/bcm2835-sdhost.c
@@ -321,9 +321,9 @@ static void bcm2835_sdhost_reset_internal(struct bcm2835_host *host)
 	temp |= (FIFO_READ_THRESHOLD << SDEDM_READ_THRESHOLD_SHIFT) |
 		(FIFO_WRITE_THRESHOLD << SDEDM_WRITE_THRESHOLD_SHIFT);
 	bcm2835_sdhost_write(host, temp, SDEDM);
-	mdelay(10);
+	msleep(20);
 	bcm2835_sdhost_set_power(host, true);
-	mdelay(10);
+	msleep(20);
 	host->clock = 0;
 	bcm2835_sdhost_write(host, host->hcfg, SDHCFG);
 	bcm2835_sdhost_write(host, host->cdiv, SDCDIV);
@@ -334,9 +334,10 @@ static void bcm2835_sdhost_reset(struct mmc_host *mmc)
 	struct bcm2835_host *host = mmc_priv(mmc);
 	unsigned long flags;
 
-	spin_lock_irqsave(&host->lock, flags);
+	if (host->dma_chan)
+		dmaengine_terminate_sync(host->dma_chan);
+	tasklet_kill(&host->finish_tasklet);
 	bcm2835_sdhost_reset_internal(host);
-	spin_unlock_irqrestore(&host->lock, flags);
 }
 
 static void bcm2835_sdhost_set_ios(struct mmc_host *mmc, struct mmc_ios *ios);
-- 
1.8.3.1

  parent reply	other threads:[~2016-06-22 11:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1466595738-2229-1-git-send-email-kraxel@redhat.com>
2016-06-22 11:42 ` [PATCH 1/5] dt-bindings: Add binding for brcm,bcm2835-sdhost Gerd Hoffmann
2016-06-24 15:55   ` Rob Herring
2016-06-22 11:42 ` [PATCH 2/5] mmc: bcm2835-sdhost: Add new driver for the internal SD controller Gerd Hoffmann
2016-08-31 12:58   ` Ulf Hansson
2016-09-08 15:08     ` Gerd Hoffmann
2016-09-09 18:25       ` Eric Anholt
2016-09-17 10:02         ` Ulf Hansson
2016-06-22 11:42 ` [PATCH 3/5] mmc: bcm2835-sdhost: zap mmiowb() [fixup] Gerd Hoffmann
2016-06-22 11:42 ` Gerd Hoffmann [this message]
2016-06-22 11:42 ` [PATCH 5/5] mmc: bcm2835-sdhost: add to devicetree Gerd Hoffmann

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=1466595738-2229-5-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=eric@anholt.net \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=swarren@wwwdotorg.org \
    --cc=ulf.hansson@linaro.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).