Re: [PATCH/RFC] MMC: remove unbalanced pm_runtime_suspend()

Guennadi Liakhovetski
2011-04-19T22:59:35Z

Thanks to all for clarifications. Since everyone is convinced, that that
idle function in mmc bus.c is appropriate, I restored it and managed to
achieve my goals also without it by adjusting the platform runtime pm and
power domain prototype support.

But I still need those "cheating" calls to

pm_runtime_put_noidle(&pdev->dev);
and
pm_runtime_get_noresume(&pdev->dev);

in the sh_mmcif.c driver. If I use the patch as posted at

http://article.gmane.org/gmane.linux.ports.sh.devel/10724

but without those two calls, and load and unload the driver, while a card
is plugged in, unloading the driver doesn't power down the interface,
because the usage_count == 1 also after the kernel has soft-ejected the
card

mmc0: card 0001 removed

With my put_noidle() / get_noresume() hack all cases of modprobe / rmmod,
card insert / eject work correctly.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer