linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: rtsx: add delay before power on
@ 2020-12-30  9:04 ricky_wu
  2020-12-30  9:04 ` [PATCH 2/2] mmc: rtsx: Add MMC_CAP2_NO_SDIO flag ricky_wu
  2021-01-13  9:58 ` [PATCH 1/2] mmc: rtsx: add delay before power on Ulf Hansson
  0 siblings, 2 replies; 5+ messages in thread
From: ricky_wu @ 2020-12-30  9:04 UTC (permalink / raw)
  To: ulf.hansson, ricky_wu, gregkh, rui_feng, rmfrfs, dianders,
	lee.jones, linux-mmc, linux-kernel

From: Ricky Wu <ricky_wu@realtek.com>

Make sure voltage below 0.5V before power on
when do power cycle

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index e6f5bbce5685..d21b99962b36 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -906,6 +906,8 @@ static int sd_power_on(struct realtek_pci_sdmmc *host)
 	if (host->power_state == SDMMC_POWER_ON)
 		return 0;
 
+	mdelay(100);
+
 	rtsx_pci_init_cmd(pcr);
 	rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL);
 	rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] mmc: rtsx: Add MMC_CAP2_NO_SDIO flag
  2020-12-30  9:04 [PATCH 1/2] mmc: rtsx: add delay before power on ricky_wu
@ 2020-12-30  9:04 ` ricky_wu
  2021-01-13 11:25   ` Ulf Hansson
  2021-01-13  9:58 ` [PATCH 1/2] mmc: rtsx: add delay before power on Ulf Hansson
  1 sibling, 1 reply; 5+ messages in thread
From: ricky_wu @ 2020-12-30  9:04 UTC (permalink / raw)
  To: ulf.hansson, ricky_wu, gregkh, rui_feng, rmfrfs, dianders,
	lee.jones, linux-mmc, linux-kernel

From: Ricky Wu <ricky_wu@realtek.com>

Added flag MMC_CAP2_NO_SDIO to mmc->caps2
Card Reader not support SDIO

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
---
 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 d21b99962b36..6a8b0282f272 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1427,7 +1427,8 @@ static void realtek_init_host(struct realtek_pci_sdmmc *host)
 		MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
 	if (pcr->rtd3_en)
 		mmc->caps = mmc->caps | MMC_CAP_AGGRESSIVE_PM;
-	mmc->caps2 = MMC_CAP2_NO_PRESCAN_POWERUP | MMC_CAP2_FULL_PWR_CYCLE;
+	mmc->caps2 = MMC_CAP2_NO_PRESCAN_POWERUP | MMC_CAP2_FULL_PWR_CYCLE |
+		MMC_CAP2_NO_SDIO;
 	mmc->max_current_330 = 400;
 	mmc->max_current_180 = 800;
 	mmc->ops = &realtek_pci_sdmmc_ops;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] mmc: rtsx: add delay before power on
  2020-12-30  9:04 [PATCH 1/2] mmc: rtsx: add delay before power on ricky_wu
  2020-12-30  9:04 ` [PATCH 2/2] mmc: rtsx: Add MMC_CAP2_NO_SDIO flag ricky_wu
@ 2021-01-13  9:58 ` Ulf Hansson
  2021-01-13 10:20   ` 吳昊澄 Ricky
  1 sibling, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2021-01-13  9:58 UTC (permalink / raw)
  To: 吳昊澄 Ricky
  Cc: Greg Kroah-Hartman, Rui Feng, Rui Miguel Silva, Doug Anderson,
	Lee Jones, linux-mmc, Linux Kernel Mailing List

On Wed, 30 Dec 2020 at 10:04, <ricky_wu@realtek.com> wrote:
>
> From: Ricky Wu <ricky_wu@realtek.com>
>
> Make sure voltage below 0.5V before power on
> when do power cycle
>
> Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
> ---
>  drivers/mmc/host/rtsx_pci_sdmmc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
> index e6f5bbce5685..d21b99962b36 100644
> --- a/drivers/mmc/host/rtsx_pci_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
> @@ -906,6 +906,8 @@ static int sd_power_on(struct realtek_pci_sdmmc *host)
>         if (host->power_state == SDMMC_POWER_ON)
>                 return 0;
>
> +       mdelay(100);
> +

Why exactly 100 ms? Can you at least add a comment about why in the code?

Moreover, I think you should convert to use msleep() rather than mdelay.

>         rtsx_pci_init_cmd(pcr);
>         rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL);
>         rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE,
> --
> 2.17.1
>

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 1/2] mmc: rtsx: add delay before power on
  2021-01-13  9:58 ` [PATCH 1/2] mmc: rtsx: add delay before power on Ulf Hansson
@ 2021-01-13 10:20   ` 吳昊澄 Ricky
  0 siblings, 0 replies; 5+ messages in thread
From: 吳昊澄 Ricky @ 2021-01-13 10:20 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Greg Kroah-Hartman, Rui Feng, Rui Miguel Silva, Doug Anderson,
	Lee Jones, linux-mmc, Linux Kernel Mailing List

> On Wed, 30 Dec 2020 at 10:04, <ricky_wu@realtek.com> wrote:
> >
> > From: Ricky Wu <ricky_wu@realtek.com>
> >
> > Make sure voltage below 0.5V before power on when do power cycle
> >
> > Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
> > ---
> >  drivers/mmc/host/rtsx_pci_sdmmc.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c
> > b/drivers/mmc/host/rtsx_pci_sdmmc.c
> > index e6f5bbce5685..d21b99962b36 100644
> > --- a/drivers/mmc/host/rtsx_pci_sdmmc.c
> > +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
> > @@ -906,6 +906,8 @@ static int sd_power_on(struct realtek_pci_sdmmc
> *host)
> >         if (host->power_state == SDMMC_POWER_ON)
> >                 return 0;
> >
> > +       mdelay(100);
> > +
> 
> Why exactly 100 ms? Can you at least add a comment about why in the code?
> 
> Moreover, I think you should convert to use msleep() rather than mdelay.
> 

Because we need to make sure voltage below 0.5V before power on
mmc-core will do quickly power cycle at recognition card phase, 
we need at least 100ms to make our device voltage below 0.5V 

I will change mdelay() to msleep()

> >         rtsx_pci_init_cmd(pcr);
> >         rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SELECT, 0x07,
> SD_MOD_SEL);
> >         rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE,
> > --
> > 2.17.1
> >
> 
> Kind regards
> Uffe
> 
> ------Please consider the environment before printing this e-mail.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] mmc: rtsx: Add MMC_CAP2_NO_SDIO flag
  2020-12-30  9:04 ` [PATCH 2/2] mmc: rtsx: Add MMC_CAP2_NO_SDIO flag ricky_wu
@ 2021-01-13 11:25   ` Ulf Hansson
  0 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2021-01-13 11:25 UTC (permalink / raw)
  To: 吳昊澄 Ricky
  Cc: Greg Kroah-Hartman, Rui Feng, Rui Miguel Silva, Doug Anderson,
	Lee Jones, linux-mmc, Linux Kernel Mailing List

On Wed, 30 Dec 2020 at 10:04, <ricky_wu@realtek.com> wrote:
>
> From: Ricky Wu <ricky_wu@realtek.com>
>
> Added flag MMC_CAP2_NO_SDIO to mmc->caps2
> Card Reader not support SDIO
>
> Signed-off-by: Ricky Wu <ricky_wu@realtek.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  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 d21b99962b36..6a8b0282f272 100644
> --- a/drivers/mmc/host/rtsx_pci_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
> @@ -1427,7 +1427,8 @@ static void realtek_init_host(struct realtek_pci_sdmmc *host)
>                 MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
>         if (pcr->rtd3_en)
>                 mmc->caps = mmc->caps | MMC_CAP_AGGRESSIVE_PM;
> -       mmc->caps2 = MMC_CAP2_NO_PRESCAN_POWERUP | MMC_CAP2_FULL_PWR_CYCLE;
> +       mmc->caps2 = MMC_CAP2_NO_PRESCAN_POWERUP | MMC_CAP2_FULL_PWR_CYCLE |
> +               MMC_CAP2_NO_SDIO;
>         mmc->max_current_330 = 400;
>         mmc->max_current_180 = 800;
>         mmc->ops = &realtek_pci_sdmmc_ops;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-13 11:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30  9:04 [PATCH 1/2] mmc: rtsx: add delay before power on ricky_wu
2020-12-30  9:04 ` [PATCH 2/2] mmc: rtsx: Add MMC_CAP2_NO_SDIO flag ricky_wu
2021-01-13 11:25   ` Ulf Hansson
2021-01-13  9:58 ` [PATCH 1/2] mmc: rtsx: add delay before power on Ulf Hansson
2021-01-13 10:20   ` 吳昊澄 Ricky

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).