Skip to contentSkip to conversation

mmc: start removing enable / disable API

PATCH New Adrian Hunter 2 participants 3 messages Feb 24, 2012 – Feb 29, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: start removing enable / disable API

Most parts of the enable / disable API are no longer used and can be removed.

Cc Rajendra Nayak <[email protected]>
Cc Venkatraman S <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Thomas Abraham <[email protected]>
Cc Kyungmin Park <[email protected]>
Cc Sekhar Nori <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-exynos/mach-nuri.c           |    5 +-
 arch/arm/mach-exynos/mach-universal_c210.c |    9 +-
 drivers/mmc/core/core.c                    |  185 ++--------------------------
 drivers/mmc/core/host.c                    |    1 -
 drivers/mmc/core/host.h                    |    1 -
 drivers/mmc/host/davinci_mmc.c             |    4 -
 drivers/mmc/host/omap_hsmmc.c              |   15 +--
 include/linux/mmc/core.h                   |    1 -
 include/linux/mmc/host.h                   |   46 +-------
 9 files changed, 25 insertions(+), 242 deletions(-)
arch/arm/mach-exynos/mach-nuri.c +2 -3
index 644af11..de68248 100644
@@ -109,7 +109,7 @@ static struct s3c_sdhci_platdata nuri_hsmmc0_data __initdata = {
 	.max_width		= 8,
 	.host_caps		= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
 				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-				MMC_CAP_DISABLE | MMC_CAP_ERASE),
+				MMC_CAP_ERASE),
 	.cd_type		= S3C_SDHCI_CD_PERMANENT,
 };
 
@@ -147,8 +147,7 @@ static struct platform_device emmc_fixed_voltage = {
 static struct s3c_sdhci_platdata nuri_hsmmc2_data __initdata = {
 	.max_width		= 4,
 	.host_caps		= MMC_CAP_4_BIT_DATA |
-				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-				MMC_CAP_DISABLE,
+				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
 	.ext_cd_gpio		= EXYNOS4_GPX3(3),	/* XEINT_27 */
 	.ext_cd_gpio_invert	= 1,
 	.cd_type		= S3C_SDHCI_CD_GPIO,
arch/arm/mach-exynos/mach-universal_c210.c +3 -6
index 9b3fbae..57cfe61 100644
@@ -734,8 +734,7 @@ static struct platform_device universal_gpio_keys = {
 static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = {
 	.max_width		= 8,
 	.host_caps		= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
-				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-				MMC_CAP_DISABLE),
+				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
 	.cd_type		= S3C_SDHCI_CD_PERMANENT,
 };
 
@@ -772,8 +771,7 @@ static struct platform_device mmc0_fixed_voltage = {
 static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = {
 	.max_width		= 4,
 	.host_caps		= MMC_CAP_4_BIT_DATA |
-				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-				MMC_CAP_DISABLE,
+				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
 	.ext_cd_gpio		= EXYNOS4_GPX3(4),      /* XEINT_28 */
 	.ext_cd_gpio_invert	= 1,
 	.cd_type		= S3C_SDHCI_CD_GPIO,
@@ -783,8 +781,7 @@ static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = {
 static struct s3c_sdhci_platdata universal_hsmmc3_data __initdata = {
 	.max_width		= 4,
 	.host_caps		= MMC_CAP_4_BIT_DATA |
-				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-				MMC_CAP_DISABLE,
+				MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
 	.cd_type		= S3C_SDHCI_CD_EXTERNAL,
 };
 
drivers/mmc/core/core.c +13 -172

237 lines not on this page · raw message

drivers/mmc/core/host.c +0 -1
index c3704e2..91c84c7 100644
@@ -330,7 +330,6 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
 	spin_lock_init(&host->lock);
 	init_waitqueue_head(&host->wq);
 	INIT_DELAYED_WORK(&host->detect, mmc_rescan);
-	INIT_DELAYED_WORK_DEFERRABLE(&host->disable, mmc_host_deeper_disable);
 #ifdef CONFIG_PM
 	host->pm_notify.notifier_call = mmc_pm_notify;
 #endif
drivers/mmc/core/host.h +0 -1
index 08a7852..f2ab9e5 100644
@@ -14,7 +14,6 @@
 
 int mmc_register_host_class(void);
 void mmc_unregister_host_class(void);
-void mmc_host_deeper_disable(struct work_struct *work);
 
 #endif
 
drivers/mmc/host/davinci_mmc.c +0 -4
index 64a8325..8de9c9b 100644
@@ -1418,17 +1418,14 @@ static int davinci_mmcsd_suspend(struct device *dev)
 	struct mmc_davinci_host *host = platform_get_drvdata(pdev);
 	int ret;
 
-	mmc_host_enable(host->mmc);
 	ret = mmc_suspend_host(host->mmc);
 	if (!ret) {
 		writel(0, host->base + DAVINCI_MMCIM);
 		mmc_davinci_reset_ctrl(host, 1);
-		mmc_host_disable(host->mmc);
 		clk_disable(host->clk);
 		host->suspended = 1;
 	} else {
 		host->suspended = 0;
-		mmc_host_disable(host->mmc);
 	}
 
 	return ret;
@@ -1444,7 +1441,6 @@ static int davinci_mmcsd_resume(struct device *dev)
 		return 0;
 
 	clk_enable(host->clk);
-	mmc_host_enable(host->mmc);
 
 	mmc_davinci_reset_ctrl(host, 0);
 	ret = mmc_resume_host(host->mmc);
drivers/mmc/host/omap_hsmmc.c +3 -12
index 36e7f5b..fdb24cf 100644
@@ -179,7 +179,6 @@ struct omap_hsmmc_host {
 	int			got_dbclk;
 	int			response_busy;
 	int			context_loss;
-	int			dpm_state;
 	int			vdd;
 	int			protect_card;
 	int			reqs_blocked;
@@ -1748,7 +1747,7 @@ static int omap_hsmmc_enable_fclk(struct mmc_host *mmc)
 	return 0;
 }
 
-static int omap_hsmmc_disable_fclk(struct mmc_host *mmc, int lazy)
+static int omap_hsmmc_disable_fclk(struct mmc_host *mmc)
 {
 	struct omap_hsmmc_host *host = mmc_priv(mmc);
 
@@ -1782,15 +1781,8 @@ static int omap_hsmmc_regs_show(struct seq_file *s, void *data)
 	if (host->pdata->get_context_loss_count)
 		context_loss = host->pdata->get_context_loss_count(host->dev);
 
-	seq_printf(s, "mmc%d:\n"
-			" enabled:\t%d\n"
-			" dpm_state:\t%d\n"
-			" nesting_cnt:\t%d\n"
-			" ctx_loss:\t%d:%d\n"
-			"\nregs:\n",
-			mmc->index, mmc->enabled ? 1 : 0,
-			host->dpm_state, mmc->nesting_cnt,
-			host->context_loss, context_loss);
+	seq_printf(s, "mmc%d:\n ctx_loss:\t%d:%d\n\nregs:\n",
+			mmc->index, host->context_loss, context_loss);
 
 	if (host->suspended) {
 		seq_printf(s, "host suspended, can't read registers\n");
@@ -1930,7 +1922,6 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
 
 	omap_hsmmc_context_save(host);
 
-	mmc->caps |= MMC_CAP_DISABLE;
 	if (host->pdata->controller_flags & OMAP_HSMMC_BROKEN_MULTIBLOCK_READ) {
 		dev_info(&pdev->dev, "multiblock reads disabled due to 35xx erratum 2.1.1.128; MMC read performance may suffer\n");
 		mmc->caps2 |= MMC_CAP2_NO_MULTI_READ;
include/linux/mmc/core.h +0 -1
index 87a976c..2bfa589 100644
@@ -175,7 +175,6 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
 
 extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
 extern void mmc_release_host(struct mmc_host *host);
-extern void mmc_do_release_host(struct mmc_host *host);
 extern int mmc_try_claim_host(struct mmc_host *host);
 
 extern int mmc_flush_cache(struct mmc_card *);
include/linux/mmc/host.h +4 -42

75 lines not on this page · raw message

Signature · 1 line
1.7.6.4
#1 lore raw

PATCH 1/1 mmc: start removing enable / disable API

Hi Adrian,

Quoted 31 lines · Adrian Hunter

Most parts of the enable / disable API are no longer used and can be removed.

Cc Rajendra Nayak<[email protected]>
Cc Venkatraman S<[email protected]>
Cc Kukjin Kim<[email protected]>
Cc Thomas Abraham<[email protected]>
Cc Kyungmin Park<[email protected]>
Cc Sekhar Nori<[email protected]>
Cc Kevin Hilman<[email protected]>
---
  arch/arm/mach-exynos/mach-nuri.c           |    5 +-
  arch/arm/mach-exynos/mach-universal_c210.c |    9 +-
  drivers/mmc/core/core.c                    |  185 ++--------------------------
  drivers/mmc/core/host.c                    |    1 -
  drivers/mmc/core/host.h                    |    1 -
  drivers/mmc/host/davinci_mmc.c             |    4 -
  drivers/mmc/host/omap_hsmmc.c              |   15 +--
  include/linux/mmc/core.h                   |    1 -
  include/linux/mmc/host.h                   |   46 +-------
  9 files changed, 25 insertions(+), 242 deletions(-)
drivers/mmc/core/core.c +0 -2
-	if (host->caps&  MMC_CAP_DISABLE)
-		cancel_delayed_work(&host->disable);
  	cancel_delayed_work_sync(&host->detect);
  	mmc_flush_scheduled_work();
@@ -2402,13 +2245,11 @@ int mmc_suspend_host(struct mmc_host *host)
  {

drivers/mmc/core/core.c int mmc_suspend_host(struct mmc_host *host) · line 2252

Quoted 10 lines
drivers/mmc/core/core.c +1 -3
  	int err = 0;
 
-	if (host->caps&  MMC_CAP_DISABLE)
-		cancel_delayed_work(&host->disable);
  	cancel_delayed_work(&host->detect);
  	mmc_flush_scheduled_work();
  	if (mmc_try_claim_host(host)) {
  		err = mmc_cache_ctrl(host, 0);
-		mmc_do_release_host(host);
+		mmc_release_host(host);

mmc_try_claim_host does not call host->ops->enable(), but mmc_release_host call host->ops->disable(), is there any reason for this? For example: If host controller disable method internally calls clk_disable() then that would cause reference count warnings.

drivers/mmc/core/core.c int mmc_suspend_host(struct mmc_host *host)

Quoted 4 lines
drivers/mmc/core/core.c +0 -0
  	} else {
  		err = -EBUSY;
  	}
@@ -2429,7 +2270,7 @@ int mmc_suspend_host(struct mmc_host *host)

Thanks,
Sujit

#2 lore raw

PATCH 1/1 mmc: start removing enable / disable API

Quoted 37 lines · Sujit Reddy Thumma

Hi Adrian,

Quoted 34 lines · Adrian Hunter

Most parts of the enable / disable API are no longer used and can be removed.

Cc Rajendra Nayak<[email protected]>
Cc Venkatraman S<[email protected]>
Cc Kukjin Kim<[email protected]>
Cc Thomas Abraham<[email protected]>
Cc Kyungmin Park<[email protected]>
Cc Sekhar Nori<[email protected]>
Cc Kevin Hilman<[email protected]>
---
  arch/arm/mach-exynos/mach-nuri.c           |    5 +-
  arch/arm/mach-exynos/mach-universal_c210.c |    9 +-
  drivers/mmc/core/core.c                    |  185
++--------------------------
  drivers/mmc/core/host.c                    |    1 -
  drivers/mmc/core/host.h                    |    1 -
  drivers/mmc/host/davinci_mmc.c             |    4 -
  drivers/mmc/host/omap_hsmmc.c              |   15 +--
  include/linux/mmc/core.h                   |    1 -
  include/linux/mmc/host.h                   |   46 +-------
  9 files changed, 25 insertions(+), 242 deletions(-)
drivers/mmc/core/core.c +0 -2
-    if (host->caps&  MMC_CAP_DISABLE)
-        cancel_delayed_work(&host->disable);
      cancel_delayed_work_sync(&host->detect);
      mmc_flush_scheduled_work();
@@ -2402,13 +2245,11 @@ int mmc_suspend_host(struct mmc_host *host)
  {
      int err = 0;
 
Quoted 11 lines

drivers/mmc/core/core.c int mmc_suspend_host(struct mmc_host *host) · line 2252

Quoted 8 lines
drivers/mmc/core/core.c +1 -3
-    if (host->caps&  MMC_CAP_DISABLE)
-        cancel_delayed_work(&host->disable);
      cancel_delayed_work(&host->detect);
      mmc_flush_scheduled_work();
      if (mmc_try_claim_host(host)) {
          err = mmc_cache_ctrl(host, 0);
-        mmc_do_release_host(host);
+        mmc_release_host(host);

mmc_try_claim_host does not call host->ops->enable(), but mmc_release_host call host->ops->disable(), is there any reason for this?

No, it is an oversight. I will send V2.