All of lore.kernel.org
 help / color / mirror / Atom feed
From: <micky_ching@realsil.com.cn>
To: <cjb@laptop.org>, <sameo@linux.intel.com>
Cc: <devel@linuxdriverproject.org>, <linux-kernel@vger.kernel.org>,
	<linux-mmc@vger.kernel.org>, <gregkh@linuxfoundation.org>,
	<wei_wang@realsil.com.cn>,
	Micky Ching <micky_ching@realsil.com.cn>
Subject: [PATCH 1/2] mmc: rtsx: fix card poweroff bug
Date: Tue, 19 Nov 2013 19:10:34 +0800	[thread overview]
Message-ID: <fb17a994c87352b1d82c6fb4141aa47b0c1d7e56.1384858553.git.micky_ching@realsil.com.cn> (raw)
In-Reply-To: <cover.1384858553.git.micky_ching@realsil.com.cn>

From: Micky Ching <micky_ching@realsil.com.cn>

If the host driver removed while card in the slot, the host will not
power off card power correctly. This bug is produced because host
eject flag set before the last mmc_set_ios callback, we should set the
eject flag after power off.

Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 375a880e..c9a7328 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1328,7 +1328,6 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
 	pcr->slots[RTSX_SD_CARD].p_dev = NULL;
 	pcr->slots[RTSX_SD_CARD].card_event = NULL;
 	mmc = host->mmc;
-	host->eject = true;
 
 	mutex_lock(&host->host_mutex);
 	if (host->mrq) {
@@ -1346,6 +1345,8 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
 	mutex_unlock(&host->host_mutex);
 
 	mmc_remove_host(mmc);
+	host->eject = true;
+
 	mmc_free_host(mmc);
 
 	dev_dbg(&(pdev->dev),
-- 
1.7.9.5


WARNING: multiple messages have this Message-ID (diff)
From: <micky_ching@realsil.com.cn>
To: cjb@laptop.org, sameo@linux.intel.com
Cc: gregkh@linuxfoundation.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, wei_wang@realsil.com.cn,
	devel@linuxdriverproject.org
Subject: [PATCH 1/2] mmc: rtsx: fix card poweroff bug
Date: Tue, 19 Nov 2013 19:10:34 +0800	[thread overview]
Message-ID: <fb17a994c87352b1d82c6fb4141aa47b0c1d7e56.1384858553.git.micky_ching@realsil.com.cn> (raw)
In-Reply-To: <cover.1384858553.git.micky_ching@realsil.com.cn>

From: Micky Ching <micky_ching@realsil.com.cn>

If the host driver removed while card in the slot, the host will not
power off card power correctly. This bug is produced because host
eject flag set before the last mmc_set_ios callback, we should set the
eject flag after power off.

Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 375a880e..c9a7328 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1328,7 +1328,6 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
 	pcr->slots[RTSX_SD_CARD].p_dev = NULL;
 	pcr->slots[RTSX_SD_CARD].card_event = NULL;
 	mmc = host->mmc;
-	host->eject = true;
 
 	mutex_lock(&host->host_mutex);
 	if (host->mrq) {
@@ -1346,6 +1345,8 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
 	mutex_unlock(&host->host_mutex);
 
 	mmc_remove_host(mmc);
+	host->eject = true;
+
 	mmc_free_host(mmc);
 
 	dev_dbg(&(pdev->dev),
-- 
1.7.9.5

  reply	other threads:[~2013-11-19 11:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 11:10 [PATCH 0/2] fix sd power bug and modify phase-searching method micky_ching
2013-11-19 11:10 ` micky_ching
2013-11-19 11:10 ` micky_ching [this message]
2013-11-19 11:10   ` [PATCH 1/2] mmc: rtsx: fix card poweroff bug micky_ching
2013-11-19 11:10 ` [PATCH 2/2] mmc: rtsx: modify phase searching method for tunning micky_ching
2013-11-19 11:10   ` micky_ching
2013-11-20  8:17   ` Dan Carpenter
2013-11-20  8:17     ` Dan Carpenter
2013-11-20  9:13     ` micky
2013-11-20  9:13       ` micky

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=fb17a994c87352b1d82c6fb4141aa47b0c1d7e56.1384858553.git.micky_ching@realsil.com.cn \
    --to=micky_ching@realsil.com.cn \
    --cc=cjb@laptop.org \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=wei_wang@realsil.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.