Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: omap_hsmmc: remove prepare/complete system suspend support.

The only function of these 'prepare' and 'complete' is to
disable the 'card detect' irq during suspend.

The commit which added this,
commit a48ce884d5819d5df2cf1139ab3c43f8e9e419b3
mmc: omap_hsmmc: Introduce omap_hsmmc_prepare/complete

justified it by the need to avoid the registration of new devices
during suspend.
However mmc_pm_notify will set ->rescan_disable in the 'prepare'
stage and clear it in the 'complete' stage, so no card detection
will actually happen.
Also the interrupt will be disabled before final suspend as part
of common suspend processing.

So this disabling of the interrupt is unnecessary, and interferes
with a transition to using common code for card-detect management.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Venkatraman S <svenkatr@ti.com>
Cc: Chris Ball <cjb@laptop.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

NeilBrown and committed by
Ulf Hansson
61bd8a04 8a66fdae

-54
-50
drivers/mmc/host/omap_hsmmc.c
··· 275 275 return !gpio_get_value_cansleep(mmc->switch_pin); 276 276 } 277 277 278 - #ifdef CONFIG_PM 279 - 280 - static int omap_hsmmc_suspend_cdirq(struct device *dev) 281 - { 282 - struct omap_hsmmc_host *host = dev_get_drvdata(dev); 283 - 284 - disable_irq(host->card_detect_irq); 285 - return 0; 286 - } 287 - 288 - static int omap_hsmmc_resume_cdirq(struct device *dev) 289 - { 290 - struct omap_hsmmc_host *host = dev_get_drvdata(dev); 291 - 292 - enable_irq(host->card_detect_irq); 293 - return 0; 294 - } 295 - 296 - #else 297 - 298 - #define omap_hsmmc_suspend_cdirq NULL 299 - #define omap_hsmmc_resume_cdirq NULL 300 - 301 - #endif 302 - 303 278 #ifdef CONFIG_REGULATOR 304 279 305 280 static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd) ··· 2209 2234 "Unable to grab MMC CD IRQ\n"); 2210 2235 goto err_irq_cd; 2211 2236 } 2212 - host->suspend = omap_hsmmc_suspend_cdirq; 2213 - host->resume = omap_hsmmc_resume_cdirq; 2214 2237 } 2215 2238 2216 2239 omap_hsmmc_disable_irq(host); ··· 2295 2322 } 2296 2323 2297 2324 #ifdef CONFIG_PM 2298 - static int omap_hsmmc_prepare(struct device *dev) 2299 - { 2300 - struct omap_hsmmc_host *host = dev_get_drvdata(dev); 2301 - 2302 - if (host->suspend) 2303 - return host->suspend(dev); 2304 - 2305 - return 0; 2306 - } 2307 - 2308 - static void omap_hsmmc_complete(struct device *dev) 2309 - { 2310 - struct omap_hsmmc_host *host = dev_get_drvdata(dev); 2311 - 2312 - if (host->resume) 2313 - host->resume(dev); 2314 - 2315 - } 2316 - 2317 2325 static int omap_hsmmc_suspend(struct device *dev) 2318 2326 { 2319 2327 struct omap_hsmmc_host *host = dev_get_drvdata(dev); ··· 2352 2398 } 2353 2399 2354 2400 #else 2355 - #define omap_hsmmc_prepare NULL 2356 - #define omap_hsmmc_complete NULL 2357 2401 #define omap_hsmmc_suspend NULL 2358 2402 #define omap_hsmmc_resume NULL 2359 2403 #endif ··· 2436 2484 static struct dev_pm_ops omap_hsmmc_dev_pm_ops = { 2437 2485 .suspend = omap_hsmmc_suspend, 2438 2486 .resume = omap_hsmmc_resume, 2439 - .prepare = omap_hsmmc_prepare, 2440 - .complete = omap_hsmmc_complete, 2441 2487 .runtime_suspend = omap_hsmmc_runtime_suspend, 2442 2488 .runtime_resume = omap_hsmmc_runtime_resume, 2443 2489 };
-4
include/linux/platform_data/mmc-omap.h
··· 31 31 void (*cleanup)(struct device *dev); 32 32 void (*shutdown)(struct device *dev); 33 33 34 - /* To handle board related suspend/resume functionality for MMC */ 35 - int (*suspend)(struct device *dev, int slot); 36 - int (*resume)(struct device *dev, int slot); 37 - 38 34 /* Return context loss count due to PM states changing */ 39 35 int (*get_context_loss_count)(struct device *dev); 40 36