From: Ulf Hansson <ulf.hansson@linaro.org>
To: micky <micky_ching@realsil.com.cn>
Cc: Chris Ball <chris@printf.net>,
Samuel Ortiz <sameo@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
"driverdev-devel@linuxdriverproject.org"
<devel@linuxdriverproject.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-mmc <linux-mmc@vger.kernel.org>,
Roger <rogerable@realtek.com>, Wei WANG <wei_wang@realsil.com.cn>
Subject: Re: [PATCH] mmc: rtsx: add card power off during probe
Date: Tue, 16 Sep 2014 20:01:17 +0200 [thread overview]
Message-ID: <CAPDyKFqcbK9OuQXbegignwiS7rz3L8resQ7Jfc8WvqXEKTcWVA@mail.gmail.com> (raw)
In-Reply-To: <1410485999-10939-1-git-send-email-micky_ching@realsil.com.cn>
On 12 September 2014 03:39, <micky_ching@realsil.com.cn> wrote:
> From: Roger Tseng <rogerable@realtek.com>
>
> Some platform have both UEFI driver and MFD/mmc driver, if entering
> linux while card in the slot, the card power is already on, and rtsx-mmc
> driver have no chance to make card power off. This will lead UHSI card
> failed to enter UHSI mode.
>
> It is hard to control the UEFI driver leaving state, so we power off the
> card power during probe.
>
> Signed-off-by: Roger Tseng <rogerable@realtek.com>
> Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
> ---
> drivers/mmc/host/rtsx_pci_sdmmc.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
> index dfde4a2..57b0796 100644
> --- a/drivers/mmc/host/rtsx_pci_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
> @@ -1341,8 +1341,13 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
> host->pcr = pcr;
> host->mmc = mmc;
> host->pdev = pdev;
> - host->power_state = SDMMC_POWER_OFF;
> INIT_WORK(&host->work, sd_request);
> + sd_power_off(host);
> + /*
> + * ref: SD spec 3.01: 6.4.1.2 Power On or Power Cycle
> + */
> + usleep_range(1000, 2000);
> +
This won't work in cases were you power off eMMC cards, unless you can
do a full power cycle - cut both VCC and VCCQ. Can you?
There are also another option you might want to use,
MMC_CAP2_NO_PRESCAN_POWERUP. But again, it must only be used for those
hosts that you are able to do a full power cycle for.
Kind regards
Uffe
> platform_set_drvdata(pdev, host);
> pcr->slots[RTSX_SD_CARD].p_dev = pdev;
> pcr->slots[RTSX_SD_CARD].card_event = rtsx_pci_sdmmc_card_event;
> --
> 1.7.9.5
>
next prev parent reply other threads:[~2014-09-16 18:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 1:39 [PATCH] mmc: rtsx: add card power off during probe micky_ching
2014-09-16 18:01 ` Ulf Hansson [this message]
2014-09-17 9:11 ` micky
2014-09-17 19:29 ` Ulf Hansson
2014-09-18 7:19 ` Roger Tseng
2014-09-18 21:14 ` Ulf Hansson
2014-09-22 10:09 ` Roger Tseng
2014-09-23 9:20 ` Ulf Hansson
2014-09-23 19:51 ` Adrian Hunter
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=CAPDyKFqcbK9OuQXbegignwiS7rz3L8resQ7Jfc8WvqXEKTcWVA@mail.gmail.com \
--to=ulf.hansson@linaro.org \
--cc=chris@printf.net \
--cc=dan.carpenter@oracle.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=micky_ching@realsil.com.cn \
--cc=rogerable@realtek.com \
--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 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).