* [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
@ 2011-12-09 2:53 r66093
2011-12-09 2:53 ` [PATCH 2/4 v3] MMC/SD: Add callback function to detect card r66093
2012-01-13 2:24 ` [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() Huang Changming-R66093
0 siblings, 2 replies; 14+ messages in thread
From: r66093 @ 2011-12-09 2:53 UTC (permalink / raw)
To: linux-mmc; +Cc: Jerry Huang, Chris Ball
From: Jerry Huang <Chang-Ming.Huang@freescale.com>
When f_init is zero, the SDHC can't work correctly. So f_min will replace
f_init, when f_init is zero.
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
CC: Chris Ball <cjb@laptop.org>
---
changes for v2:
- add the CC
changes for v3:
- enalbe the controller clock in platform, instead of core
drivers/mmc/core/core.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index a08e6b1..2d40c04 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1253,7 +1253,10 @@ static void mmc_power_up(struct mmc_host *host)
*/
mmc_delay(10);
- host->ios.clock = host->f_init;
+ if (host->f_init)
+ host->ios.clock = host->f_init;
+ else
+ host->ios.clock = host->f_min;
host->ios.power_mode = MMC_POWER_ON;
mmc_set_ios(host);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/4 v3] MMC/SD: Add callback function to detect card
2011-12-09 2:53 [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() r66093
@ 2011-12-09 2:53 ` r66093
2011-12-09 2:53 ` [PATCH 3/4 v4] SDHCI: add sdhci_get_cd callback to detect the card r66093
2012-01-13 2:24 ` [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() Huang Changming-R66093
1 sibling, 1 reply; 14+ messages in thread
From: r66093 @ 2011-12-09 2:53 UTC (permalink / raw)
To: linux-mmc; +Cc: Jerry Huang, Chris Ball
From: Jerry Huang <Chang-Ming.Huang@freescale.com>
In order to check whether the card has been removed, the function
mmc_send_status() will send command CMD13 to card and ask the card
to send its status register to sdhc driver, which will generate
many interrupts repeatedly and make the system performance bad.
Therefore, add callback function get_cd() to check whether
the card has been removed when the driver has this callback function.
If the card is present, 1 will return, if the card is absent, 0 will return.
If the controller will not support this feature, -ENOSYS will return.
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
CC: Chris Ball <cjb@laptop.org>
---
changes for v2:
- when controller don't support get_cd, return -ENOSYS
- add the CC
changes for v3:
- enalbe the controller clock in platform, instead of core
drivers/mmc/core/mmc.c | 10 ++++++++--
drivers/mmc/core/sd.c | 10 ++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index dbf421a..e03860e 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1105,7 +1105,7 @@ static void mmc_remove(struct mmc_host *host)
*/
static void mmc_detect(struct mmc_host *host)
{
- int err;
+ int err = -ENOSYS;
BUG_ON(!host);
BUG_ON(!host->card);
@@ -1115,7 +1115,13 @@ static void mmc_detect(struct mmc_host *host)
/*
* Just check if our card has been removed.
*/
- err = mmc_send_status(host->card, NULL);
+ if (host->ops->get_cd) {
+ err = host->ops->get_cd(host);
+ if (err >= 0)
+ err = !err;
+ }
+ if (err < 0)
+ err = mmc_send_status(host->card, NULL);
mmc_release_host(host);
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index f2a05ea..7e61bf0 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1023,7 +1023,7 @@ static void mmc_sd_remove(struct mmc_host *host)
*/
static void mmc_sd_detect(struct mmc_host *host)
{
- int err;
+ int err = -ENOSYS;
BUG_ON(!host);
BUG_ON(!host->card);
@@ -1033,7 +1033,13 @@ static void mmc_sd_detect(struct mmc_host *host)
/*
* Just check if our card has been removed.
*/
- err = mmc_send_status(host->card, NULL);
+ if (host->ops->get_cd) {
+ err = host->ops->get_cd(host);
+ if (err >= 0)
+ err = !err;
+ }
+ if (err < 0)
+ err = mmc_send_status(host->card, NULL);
mmc_release_host(host);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/4 v4] SDHCI: add sdhci_get_cd callback to detect the card
2011-12-09 2:53 ` [PATCH 2/4 v3] MMC/SD: Add callback function to detect card r66093
@ 2011-12-09 2:53 ` r66093
2011-12-09 2:53 ` [PATCH 4/4 v3] ESDHC: add callback esdhc_of_get_cd to detect card r66093
0 siblings, 1 reply; 14+ messages in thread
From: r66093 @ 2011-12-09 2:53 UTC (permalink / raw)
To: linux-mmc; +Cc: Jerry Huang, Chris Ball
From: Jerry Huang <Chang-Ming.Huang@freescale.com>
Add callback function sdhci_get_cd to detect the card.
And one new callback added to implement the card detect in sdhci struncture.
If special platform has the card detect callback, it will return the card
state, the value zero is for absent cardi and one is for present card.
If the controller don't support card detect, sdhci_get_cd will return -ENOSYS.
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
CC: Chris Ball <cjb@laptop.org>
---
changes for v2:
- when controller don't support get_cd, return -ENOSYS
- add new callback for sdhci to detect the card
- add the CC
changes for v3:
- use pin_lock only when get_cd defined
changes for v4:
- enalbe the controller clock in platform, instead of core
drivers/mmc/host/sdhci.c | 22 ++++++++++++++++++++++
drivers/mmc/host/sdhci.h | 2 ++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 6d8eea3..fbe2f46 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2,6 +2,7 @@
* linux/drivers/mmc/host/sdhci.c - Secure Digital Host Controller Interface driver
*
* Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.
+ * Copyright (C) 2011 Freescale Semiconductor Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1518,6 +1519,26 @@ static int sdhci_get_ro(struct mmc_host *mmc)
return ret;
}
+/* Return values for the sdjco_get_cd callback:
+ * 0 for a absent card
+ * 1 for a present card
+ * -ENOSYS when not supported (equal to NULL callback)
+ */
+static int sdhci_get_cd(struct mmc_host *mmc)
+{
+ struct sdhci_host *host = mmc_priv(mmc);
+ unsigned long flags;
+ int present = -ENOSYS;
+
+ if (host->ops->get_cd) {
+ spin_lock_irqsave(&host->lock, flags);
+ present = host->ops->get_cd(host);
+ spin_unlock_irqrestore(&host->lock, flags);
+ }
+
+ return present;
+}
+
static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable)
{
if (host->flags & SDHCI_DEVICE_DEAD)
@@ -1884,6 +1905,7 @@ static const struct mmc_host_ops sdhci_ops = {
.request = sdhci_request,
.set_ios = sdhci_set_ios,
.get_ro = sdhci_get_ro,
+ .get_cd = sdhci_get_cd,
.hw_reset = sdhci_hw_reset,
.enable_sdio_irq = sdhci_enable_sdio_irq,
.start_signal_voltage_switch = sdhci_start_signal_voltage_switch,
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 0a5b654..82f4d27 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -69,6 +69,7 @@
#define SDHCI_SPACE_AVAILABLE 0x00000400
#define SDHCI_DATA_AVAILABLE 0x00000800
#define SDHCI_CARD_PRESENT 0x00010000
+#define SDHCI_CARD_CDPL 0x00040000
#define SDHCI_WRITE_PROTECT 0x00080000
#define SDHCI_DATA_LVL_MASK 0x00F00000
#define SDHCI_DATA_LVL_SHIFT 20
@@ -261,6 +262,7 @@ struct sdhci_ops {
void (*set_clock)(struct sdhci_host *host, unsigned int clock);
+ int (*get_cd)(struct sdhci_host *host);
int (*enable_dma)(struct sdhci_host *host);
unsigned int (*get_max_clock)(struct sdhci_host *host);
unsigned int (*get_min_clock)(struct sdhci_host *host);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/4 v3] ESDHC: add callback esdhc_of_get_cd to detect card
2011-12-09 2:53 ` [PATCH 3/4 v4] SDHCI: add sdhci_get_cd callback to detect the card r66093
@ 2011-12-09 2:53 ` r66093
2012-01-13 2:25 ` Huang Changming-R66093
0 siblings, 1 reply; 14+ messages in thread
From: r66093 @ 2011-12-09 2:53 UTC (permalink / raw)
To: linux-mmc; +Cc: Jerry Huang, Chris Ball
From: Jerry Huang <Chang-Ming.Huang@freescale.com>
In order to check if the card is present, we will read the PRESENT STATE
register and check the bit13(Card detect pin level) and bit15(CINS).
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
CC: Chris Ball <cjb@laptop.org>
---
changes for v2:
- add new callback for esdhc to detect the card state
- add the CC
changes for v3:
- enable the controller clock when detect the card state, not core
drivers/mmc/host/sdhci-of-esdhc.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 59e9d00..40da8f4 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -1,7 +1,7 @@
/*
* Freescale eSDHC controller driver.
*
- * Copyright (c) 2007, 2010 Freescale Semiconductor, Inc.
+ * Copyright (c) 2007, 2010-2011 Freescale Semiconductor, Inc.
* Copyright (c) 2009 MontaVista Software, Inc.
*
* Authors: Xiaobo Xie <X.Xie@freescale.com>
@@ -82,6 +82,28 @@ static unsigned int esdhc_of_get_min_clock(struct sdhci_host *host)
return pltfm_host->clock / 256 / 16;
}
+/* Return: none zero - the card is presetn; 0 - card is absent */
+static int esdhc_of_get_cd(struct sdhci_host *host)
+{
+ int present;
+
+ if (host->flags & SDHCI_DEVICE_DEAD)
+ present = 0;
+ else {
+ int sysctl = sdhci_be32bs_readl(host, SDHCI_CLOCK_CONTROL);
+ /* Enable the controller clock to update the present state */
+ sdhci_be32bs_writel(host, sysctl | SDHCI_CLOCK_INT_EN,
+ SDHCI_CLOCK_CONTROL);
+ /* Detect the card present or absent */
+ present = sdhci_be32bs_readl(host, SDHCI_PRESENT_STATE);
+ present &= (SDHCI_CARD_PRESENT | SDHCI_CARD_CDPL);
+ /* Resve the previous to System control register */
+ sdhci_be32bs_writel(host, sysctl, SDHCI_CLOCK_CONTROL);
+ }
+
+ return present;
+}
+
static struct sdhci_ops sdhci_esdhc_ops = {
.read_l = sdhci_be32bs_readl,
.read_w = esdhc_readw,
@@ -93,6 +115,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
.enable_dma = esdhc_of_enable_dma,
.get_max_clock = esdhc_of_get_max_clock,
.get_min_clock = esdhc_of_get_min_clock,
+ .get_cd = esdhc_of_get_cd,
};
static struct sdhci_pltfm_data sdhci_esdhc_pdata = {
--
1.7.5.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* RE: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
2011-12-09 2:53 [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() r66093
2011-12-09 2:53 ` [PATCH 2/4 v3] MMC/SD: Add callback function to detect card r66093
@ 2012-01-13 2:24 ` Huang Changming-R66093
2012-01-13 3:26 ` Aaron Lu
1 sibling, 1 reply; 14+ messages in thread
From: Huang Changming-R66093 @ 2012-01-13 2:24 UTC (permalink / raw)
To: Huang Changming-R66093, linux-mmc@vger.kernel.org; +Cc: Chris Ball
Hi, Chris,
Could you have any comment about this patch?
Can it go into 3.3 or 3.4?
> -----Original Message-----
> From: Huang Changming-R66093
> Sent: Friday, December 09, 2011 10:54 AM
> To: linux-mmc@vger.kernel.org
> Cc: Huang Changming-R66093; Chris Ball
> Subject: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
>
> From: Jerry Huang <Chang-Ming.Huang@freescale.com>
>
> When f_init is zero, the SDHC can't work correctly. So f_min will replace
> f_init, when f_init is zero.
>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> CC: Chris Ball <cjb@laptop.org>
> ---
> changes for v2:
> - add the CC
> changes for v3:
> - enalbe the controller clock in platform, instead of core
>
> drivers/mmc/core/core.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index a08e6b1..2d40c04 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1253,7 +1253,10 @@ static void mmc_power_up(struct mmc_host *host)
> */
> mmc_delay(10);
>
> - host->ios.clock = host->f_init;
> + if (host->f_init)
> + host->ios.clock = host->f_init;
> + else
> + host->ios.clock = host->f_min;
>
> host->ios.power_mode = MMC_POWER_ON;
> mmc_set_ios(host);
> --
> 1.7.5.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 4/4 v3] ESDHC: add callback esdhc_of_get_cd to detect card
2011-12-09 2:53 ` [PATCH 4/4 v3] ESDHC: add callback esdhc_of_get_cd to detect card r66093
@ 2012-01-13 2:25 ` Huang Changming-R66093
0 siblings, 0 replies; 14+ messages in thread
From: Huang Changming-R66093 @ 2012-01-13 2:25 UTC (permalink / raw)
To: Huang Changming-R66093, linux-mmc@vger.kernel.org; +Cc: Chris Ball
Hi, Chris,
Could you have any comment about this patch?
Can it go into 3.3 or 3.4?
Thanks
Jerry Huang
> -----Original Message-----
> From: Huang Changming-R66093
> Sent: Friday, December 09, 2011 10:54 AM
> To: linux-mmc@vger.kernel.org
> Cc: Huang Changming-R66093; Chris Ball
> Subject: [PATCH 4/4 v3] ESDHC: add callback esdhc_of_get_cd to detect
> card
>
> From: Jerry Huang <Chang-Ming.Huang@freescale.com>
>
> In order to check if the card is present, we will read the PRESENT STATE
> register and check the bit13(Card detect pin level) and bit15(CINS).
>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> CC: Chris Ball <cjb@laptop.org>
> ---
> changes for v2:
> - add new callback for esdhc to detect the card state
> - add the CC
> changes for v3:
> - enable the controller clock when detect the card state, not core
>
> drivers/mmc/host/sdhci-of-esdhc.c | 25 ++++++++++++++++++++++++-
> 1 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-
> of-esdhc.c
> index 59e9d00..40da8f4 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -1,7 +1,7 @@
> /*
> * Freescale eSDHC controller driver.
> *
> - * Copyright (c) 2007, 2010 Freescale Semiconductor, Inc.
> + * Copyright (c) 2007, 2010-2011 Freescale Semiconductor, Inc.
> * Copyright (c) 2009 MontaVista Software, Inc.
> *
> * Authors: Xiaobo Xie <X.Xie@freescale.com>
> @@ -82,6 +82,28 @@ static unsigned int esdhc_of_get_min_clock(struct
> sdhci_host *host)
> return pltfm_host->clock / 256 / 16;
> }
>
> +/* Return: none zero - the card is presetn; 0 - card is absent */
> +static int esdhc_of_get_cd(struct sdhci_host *host)
> +{
> + int present;
> +
> + if (host->flags & SDHCI_DEVICE_DEAD)
> + present = 0;
> + else {
> + int sysctl = sdhci_be32bs_readl(host, SDHCI_CLOCK_CONTROL);
> + /* Enable the controller clock to update the present state */
> + sdhci_be32bs_writel(host, sysctl | SDHCI_CLOCK_INT_EN,
> + SDHCI_CLOCK_CONTROL);
> + /* Detect the card present or absent */
> + present = sdhci_be32bs_readl(host, SDHCI_PRESENT_STATE);
> + present &= (SDHCI_CARD_PRESENT | SDHCI_CARD_CDPL);
> + /* Resve the previous to System control register */
> + sdhci_be32bs_writel(host, sysctl, SDHCI_CLOCK_CONTROL);
> + }
> +
> + return present;
> +}
> +
> static struct sdhci_ops sdhci_esdhc_ops = {
> .read_l = sdhci_be32bs_readl,
> .read_w = esdhc_readw,
> @@ -93,6 +115,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
> .enable_dma = esdhc_of_enable_dma,
> .get_max_clock = esdhc_of_get_max_clock,
> .get_min_clock = esdhc_of_get_min_clock,
> + .get_cd = esdhc_of_get_cd,
> };
>
> static struct sdhci_pltfm_data sdhci_esdhc_pdata = {
> --
> 1.7.5.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
2012-01-13 2:24 ` [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() Huang Changming-R66093
@ 2012-01-13 3:26 ` Aaron Lu
2012-01-13 3:39 ` Huang Changming-R66093
0 siblings, 1 reply; 14+ messages in thread
From: Aaron Lu @ 2012-01-13 3:26 UTC (permalink / raw)
To: Huang Changming-R66093; +Cc: linux-mmc@vger.kernel.org, Chris Ball
Hi,
On Fri, Jan 13, 2012 at 02:24:46AM +0000, Huang Changming-R66093 wrote:
> Hi, Chris,
> Could you have any comment about this patch?
> Can it go into 3.3 or 3.4?
>
> > -----Original Message-----
> > From: Huang Changming-R66093
> > Sent: Friday, December 09, 2011 10:54 AM
> > To: linux-mmc@vger.kernel.org
> > Cc: Huang Changming-R66093; Chris Ball
> > Subject: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
> >
> > From: Jerry Huang <Chang-Ming.Huang@freescale.com>
> >
> > When f_init is zero, the SDHC can't work correctly. So f_min will replace
> > f_init, when f_init is zero.
What about setting f_init before your call to mmc_power_up?
> >
> > Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> > CC: Chris Ball <cjb@laptop.org>
> > ---
> > changes for v2:
> > - add the CC
> > changes for v3:
> > - enalbe the controller clock in platform, instead of core
> >
> > drivers/mmc/core/core.c | 5 ++++-
> > 1 files changed, 4 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> > index a08e6b1..2d40c04 100644
> > --- a/drivers/mmc/core/core.c
> > +++ b/drivers/mmc/core/core.c
> > @@ -1253,7 +1253,10 @@ static void mmc_power_up(struct mmc_host *host)
> > */
> > mmc_delay(10);
> >
> > - host->ios.clock = host->f_init;
> > + if (host->f_init)
> > + host->ios.clock = host->f_init;
> > + else
> > + host->ios.clock = host->f_min;
> >
> > host->ios.power_mode = MMC_POWER_ON;
> > mmc_set_ios(host);
> > --
> > 1.7.5.4
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
2012-01-13 3:26 ` Aaron Lu
@ 2012-01-13 3:39 ` Huang Changming-R66093
2012-01-13 6:32 ` Aaron Lu
0 siblings, 1 reply; 14+ messages in thread
From: Huang Changming-R66093 @ 2012-01-13 3:39 UTC (permalink / raw)
To: Aaron Lu; +Cc: linux-mmc@vger.kernel.org, Chris Ball
> -----Original Message-----
> From: Aaron Lu [mailto:aaron.lu@amd.com]
> Sent: Friday, January 13, 2012 11:27 AM
> To: Huang Changming-R66093
> Cc: linux-mmc@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
>
> Hi,
>
> On Fri, Jan 13, 2012 at 02:24:46AM +0000, Huang Changming-R66093 wrote:
> > Hi, Chris,
> > Could you have any comment about this patch?
> > Can it go into 3.3 or 3.4?
> >
> > > -----Original Message-----
> > > From: Huang Changming-R66093
> > > Sent: Friday, December 09, 2011 10:54 AM
> > > To: linux-mmc@vger.kernel.org
> > > Cc: Huang Changming-R66093; Chris Ball
> > > Subject: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
> > >
> > > From: Jerry Huang <Chang-Ming.Huang@freescale.com>
> > >
> > > When f_init is zero, the SDHC can't work correctly. So f_min will
> > > replace f_init, when f_init is zero.
>
> What about setting f_init before your call to mmc_power_up?
f_init is initialized only by mmc_rescan_try_freq, and mmc_power_up will use it.
But mmc_power_up will called not only by mmc_rescan_try_freq, but also by other functions.
You will see it in my previous email about it.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
2012-01-13 3:39 ` Huang Changming-R66093
@ 2012-01-13 6:32 ` Aaron Lu
2012-01-13 6:48 ` Huang Changming-R66093
0 siblings, 1 reply; 14+ messages in thread
From: Aaron Lu @ 2012-01-13 6:32 UTC (permalink / raw)
To: Huang Changming-R66093; +Cc: linux-mmc@vger.kernel.org, Chris Ball
Hi,
On Fri, Jan 13, 2012 at 03:39:53AM +0000, Huang Changming-R66093 wrote:
>
>
> > -----Original Message-----
> > From: Aaron Lu [mailto:aaron.lu@amd.com]
> > Sent: Friday, January 13, 2012 11:27 AM
> > To: Huang Changming-R66093
> > Cc: linux-mmc@vger.kernel.org; Chris Ball
> > Subject: Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
> >
> > Hi,
> >
> > On Fri, Jan 13, 2012 at 02:24:46AM +0000, Huang Changming-R66093 wrote:
> > > Hi, Chris,
> > > Could you have any comment about this patch?
> > > Can it go into 3.3 or 3.4?
> > >
> > > > -----Original Message-----
> > > > From: Huang Changming-R66093
> > > > Sent: Friday, December 09, 2011 10:54 AM
> > > > To: linux-mmc@vger.kernel.org
> > > > Cc: Huang Changming-R66093; Chris Ball
> > > > Subject: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
> > > >
> > > > From: Jerry Huang <Chang-Ming.Huang@freescale.com>
> > > >
> > > > When f_init is zero, the SDHC can't work correctly. So f_min will
> > > > replace f_init, when f_init is zero.
> >
> > What about setting f_init before your call to mmc_power_up?
> f_init is initialized only by mmc_rescan_try_freq, and mmc_power_up will use it.
> But mmc_power_up will called not only by mmc_rescan_try_freq, but also by other functions.
> You will see it in my previous email about it.
>
Yes, I know there are other callers for mmc_power_up.
Either you set host->f_init in mmc_power_up, or you set it before you
call mmc_power_up. I prefer the latter one but I'm not sure which one
should be used. Maybe Chris can comment on this.
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
2012-01-13 6:32 ` Aaron Lu
@ 2012-01-13 6:48 ` Huang Changming-R66093
0 siblings, 0 replies; 14+ messages in thread
From: Huang Changming-R66093 @ 2012-01-13 6:48 UTC (permalink / raw)
To: Aaron Lu; +Cc: linux-mmc@vger.kernel.org, Chris Ball
> -----Original Message-----
> From: Aaron Lu [mailto:aaron.lu@amd.com]
> Sent: Friday, January 13, 2012 2:32 PM
> To: Huang Changming-R66093
> Cc: linux-mmc@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
>
> Hi,
>
> On Fri, Jan 13, 2012 at 03:39:53AM +0000, Huang Changming-R66093 wrote:
> >
> >
> > > -----Original Message-----
> > > From: Aaron Lu [mailto:aaron.lu@amd.com]
> > > Sent: Friday, January 13, 2012 11:27 AM
> > > To: Huang Changming-R66093
> > > Cc: linux-mmc@vger.kernel.org; Chris Ball
> > > Subject: Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
> > >
> > > Hi,
> > >
> > > On Fri, Jan 13, 2012 at 02:24:46AM +0000, Huang Changming-R66093
> wrote:
> > > > Hi, Chris,
> > > > Could you have any comment about this patch?
> > > > Can it go into 3.3 or 3.4?
> > > >
> > > > > -----Original Message-----
> > > > > From: Huang Changming-R66093
> > > > > Sent: Friday, December 09, 2011 10:54 AM
> > > > > To: linux-mmc@vger.kernel.org
> > > > > Cc: Huang Changming-R66093; Chris Ball
> > > > > Subject: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
> > > > >
> > > > > From: Jerry Huang <Chang-Ming.Huang@freescale.com>
> > > > >
> > > > > When f_init is zero, the SDHC can't work correctly. So f_min
> > > > > will replace f_init, when f_init is zero.
> > >
> > > What about setting f_init before your call to mmc_power_up?
> > f_init is initialized only by mmc_rescan_try_freq, and mmc_power_up
> will use it.
> > But mmc_power_up will called not only by mmc_rescan_try_freq, but also
> by other functions.
> > You will see it in my previous email about it.
> >
>
> Yes, I know there are other callers for mmc_power_up.
> Either you set host->f_init in mmc_power_up, or you set it before you
> call mmc_power_up. I prefer the latter one but I'm not sure which one
> should be used. Maybe Chris can comment on this.
>
First, if the f_init is initialized, mmc_power_up will use it, if not, just the f_min is used.
I think it is reasonable.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
@ 2012-10-30 8:12 r66093
2012-10-30 23:08 ` Ulf Hansson
0 siblings, 1 reply; 14+ messages in thread
From: r66093 @ 2012-10-30 8:12 UTC (permalink / raw)
To: linux-mmc; +Cc: Jerry Huang, Anton Vorontsov, Chris Ball
From: Jerry Huang <Chang-Ming.Huang@freescale.com>
When f_init is zero, the SDHC can't work correctly. So f_min will replace
f_init, when f_init is zero.
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
CC: Anton Vorontsov <cbouatmailru@gmail.com>
CC: Chris Ball <cjb@laptop.org>
---
changes for v2:
- add the CC
changes for v3:
- enalbe the controller clock in platform, instead of core
drivers/mmc/core/core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 06c42cf..9c162cd 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1319,7 +1319,10 @@ static void mmc_power_up(struct mmc_host *host)
*/
mmc_delay(10);
- host->ios.clock = host->f_init;
+ if (host->f_init)
+ host->ios.clock = host->f_init;
+ else
+ host->ios.clock = host->f_min;
host->ios.power_mode = MMC_POWER_ON;
mmc_set_ios(host);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
2012-10-30 8:12 r66093
@ 2012-10-30 23:08 ` Ulf Hansson
2012-10-31 2:23 ` Huang Changming-R66093
2012-10-31 4:21 ` Jaehoon Chung
0 siblings, 2 replies; 14+ messages in thread
From: Ulf Hansson @ 2012-10-30 23:08 UTC (permalink / raw)
To: r66093; +Cc: linux-mmc, Jerry Huang, Anton Vorontsov, Chris Ball
On 30 October 2012 09:12, <r66093@freescale.com> wrote:
> From: Jerry Huang <Chang-Ming.Huang@freescale.com>
>
> When f_init is zero, the SDHC can't work correctly. So f_min will replace
> f_init, when f_init is zero.
>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> CC: Anton Vorontsov <cbouatmailru@gmail.com>
> CC: Chris Ball <cjb@laptop.org>
> ---
> changes for v2:
> - add the CC
> changes for v3:
> - enalbe the controller clock in platform, instead of core
>
> drivers/mmc/core/core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 06c42cf..9c162cd 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1319,7 +1319,10 @@ static void mmc_power_up(struct mmc_host *host)
> */
> mmc_delay(10);
>
> - host->ios.clock = host->f_init;
> + if (host->f_init)
> + host->ios.clock = host->f_init;
> + else
> + host->ios.clock = host->f_min;
This should not be needed. host->f_init should never become zero, I believe.
>
> host->ios.power_mode = MMC_POWER_ON;
> mmc_set_ios(host);
> --
> 1.7.9.5
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Kind regards
Ulf Hansson
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
2012-10-30 23:08 ` Ulf Hansson
@ 2012-10-31 2:23 ` Huang Changming-R66093
2012-10-31 4:21 ` Jaehoon Chung
1 sibling, 0 replies; 14+ messages in thread
From: Huang Changming-R66093 @ 2012-10-31 2:23 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc@vger.kernel.org, Anton Vorontsov, Chris Ball
Best Regards
Jerry Huang
> -----Original Message-----
> From: Ulf Hansson [mailto:ulf.hansson@linaro.org]
> Sent: Wednesday, October 31, 2012 7:09 AM
> To: Huang Changming-R66093
> Cc: linux-mmc@vger.kernel.org; Huang Changming-R66093; Anton Vorontsov;
> Chris Ball
> Subject: Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
>
> On 30 October 2012 09:12, <r66093@freescale.com> wrote:
> > From: Jerry Huang <Chang-Ming.Huang@freescale.com>
> >
> > When f_init is zero, the SDHC can't work correctly. So f_min will
> replace
> > f_init, when f_init is zero.
> >
> > Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> > CC: Anton Vorontsov <cbouatmailru@gmail.com>
> > CC: Chris Ball <cjb@laptop.org>
> > ---
> > changes for v2:
> > - add the CC
> > changes for v3:
> > - enalbe the controller clock in platform, instead of core
> >
> > drivers/mmc/core/core.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> > index 06c42cf..9c162cd 100644
> > --- a/drivers/mmc/core/core.c
> > +++ b/drivers/mmc/core/core.c
> > @@ -1319,7 +1319,10 @@ static void mmc_power_up(struct mmc_host *host)
> > */
> > mmc_delay(10);
> >
> > - host->ios.clock = host->f_init;
> > + if (host->f_init)
> > + host->ios.clock = host->f_init;
> > + else
> > + host->ios.clock = host->f_min;
>
> This should not be needed. host->f_init should never become zero, I
> believe.
>
Uh, this patch can be removed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on()
2012-10-30 23:08 ` Ulf Hansson
2012-10-31 2:23 ` Huang Changming-R66093
@ 2012-10-31 4:21 ` Jaehoon Chung
1 sibling, 0 replies; 14+ messages in thread
From: Jaehoon Chung @ 2012-10-31 4:21 UTC (permalink / raw)
To: Ulf Hansson; +Cc: r66093, linux-mmc, Jerry Huang, Anton Vorontsov, Chris Ball
On 10/31/2012 08:08 AM, Ulf Hansson wrote:
> On 30 October 2012 09:12, <r66093@freescale.com> wrote:
>> From: Jerry Huang <Chang-Ming.Huang@freescale.com>
>>
>> When f_init is zero, the SDHC can't work correctly. So f_min will replace
>> f_init, when f_init is zero.
>>
>> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
>> CC: Anton Vorontsov <cbouatmailru@gmail.com>
>> CC: Chris Ball <cjb@laptop.org>
>> ---
>> changes for v2:
>> - add the CC
>> changes for v3:
>> - enalbe the controller clock in platform, instead of core
>>
>> drivers/mmc/core/core.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>> index 06c42cf..9c162cd 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -1319,7 +1319,10 @@ static void mmc_power_up(struct mmc_host *host)
>> */
>> mmc_delay(10);
>>
>> - host->ios.clock = host->f_init;
>> + if (host->f_init)
>> + host->ios.clock = host->f_init;
>> + else
>> + host->ios.clock = host->f_min;
>
> This should not be needed. host->f_init should never become zero, I believe.
I agree for Ulf's comment.
>
>>
>> host->ios.power_mode = MMC_POWER_ON;
>> mmc_set_ios(host);
>> --
>> 1.7.9.5
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> Kind regards
> Ulf Hansson
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2012-10-31 4:21 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-09 2:53 [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() r66093
2011-12-09 2:53 ` [PATCH 2/4 v3] MMC/SD: Add callback function to detect card r66093
2011-12-09 2:53 ` [PATCH 3/4 v4] SDHCI: add sdhci_get_cd callback to detect the card r66093
2011-12-09 2:53 ` [PATCH 4/4 v3] ESDHC: add callback esdhc_of_get_cd to detect card r66093
2012-01-13 2:25 ` Huang Changming-R66093
2012-01-13 2:24 ` [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() Huang Changming-R66093
2012-01-13 3:26 ` Aaron Lu
2012-01-13 3:39 ` Huang Changming-R66093
2012-01-13 6:32 ` Aaron Lu
2012-01-13 6:48 ` Huang Changming-R66093
-- strict thread matches above, loose matches on Subject: below --
2012-10-30 8:12 r66093
2012-10-30 23:08 ` Ulf Hansson
2012-10-31 2:23 ` Huang Changming-R66093
2012-10-31 4:21 ` Jaehoon Chung
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.