public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Rudholm <johan.rudholm@axis.com>
To: linux-mmc@vger.kernel.org, Chris Ball <chris@printf.net>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Adrian Hunter" <adrian.hunter@intel.com>,
	"Guennadi Liakhovetski" <g.liakhovetski@gmx.de>,
	"David Lanzendörfer" <david.lanzendoerfer@o2s.ch>,
	"Jesper Nilsson" <jespern@axis.com>,
	"Johan Rudholm" <johanru@axis.com>
Subject: [PATCH v7 3/3] mmc: sd: add reset bus_ops callback
Date: Mon, 12 Jan 2015 15:38:06 +0100	[thread overview]
Message-ID: <1421073486-10903-4-git-send-email-johanru@axis.com> (raw)
In-Reply-To: <1421073486-10903-1-git-send-email-johanru@axis.com>

Enable power cycle and re-initialization of SD cards via the reset
bus_ops. Power cycling a buggy SD card sometimes helps it get back on
track.

Signed-off-by: Johan Rudholm <johanru@axis.com>
---
 drivers/mmc/core/sd.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 29fccdc..36d5333 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1197,6 +1197,12 @@ static int mmc_sd_power_restore(struct mmc_host *host)
 	return ret;
 }
 
+static int mmc_sd_reset(struct mmc_host *host)
+{
+	mmc_power_cycle(host, host->card->ocr);
+	return mmc_sd_power_restore(host);
+}
+
 static const struct mmc_bus_ops mmc_sd_ops = {
 	.remove = mmc_sd_remove,
 	.detect = mmc_sd_detect,
@@ -1207,6 +1213,7 @@ static const struct mmc_bus_ops mmc_sd_ops = {
 	.power_restore = mmc_sd_power_restore,
 	.alive = mmc_sd_alive,
 	.shutdown = mmc_sd_suspend,
+	.reset = mmc_sd_reset,
 };
 
 /*
-- 
1.7.2.5


  parent reply	other threads:[~2015-01-12 14:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 14:38 [PATCH v7 0/3] mmc: core: hw_reset changes Johan Rudholm
2015-01-12 14:38 ` [PATCH v7 1/3] mmc: core: always check status after reset Johan Rudholm
2015-01-12 14:38 ` [PATCH v7 2/3] mmc: core: refactor the hw_reset routines Johan Rudholm
2015-01-12 14:38 ` Johan Rudholm [this message]
2015-01-12 15:11 ` [PATCH v7 0/3] mmc: core: hw_reset changes Ulf Hansson
2015-01-13  8:19   ` Ulf Hansson
2015-01-13  8:26     ` Johan Rudholm

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=1421073486-10903-4-git-send-email-johanru@axis.com \
    --to=johan.rudholm@axis.com \
    --cc=adrian.hunter@intel.com \
    --cc=chris@printf.net \
    --cc=david.lanzendoerfer@o2s.ch \
    --cc=g.liakhovetski@gmx.de \
    --cc=jespern@axis.com \
    --cc=johanru@axis.com \
    --cc=linux-mmc@vger.kernel.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