From patchwork Thu Jun 9 17:27:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 866192 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p59HSB4k022694 for ; Thu, 9 Jun 2011 17:28:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278Ab1FIR2K (ORCPT ); Thu, 9 Jun 2011 13:28:10 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:36048 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752987Ab1FIR2J (ORCPT ); Thu, 9 Jun 2011 13:28:09 -0400 Received: by wya21 with SMTP id 21so1301300wya.19 for ; Thu, 09 Jun 2011 10:28:08 -0700 (PDT) Received: by 10.216.59.81 with SMTP id r59mr1090666wec.40.1307640488273; Thu, 09 Jun 2011 10:28:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.90.132 with HTTP; Thu, 9 Jun 2011 10:27:48 -0700 (PDT) X-Originating-IP: [46.116.119.47] In-Reply-To: References: <20110605123852.BC6F39D401C@zog.reactivated.net> From: Ohad Ben-Cohen Date: Thu, 9 Jun 2011 20:27:48 +0300 Message-ID: Subject: Re: [PATCH] mmc: sdio: reset card during power_restore To: Daniel Drake Cc: linux-mmc@vger.kernel.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 09 Jun 2011 17:28:12 +0000 (UTC) On Thu, Jun 9, 2011 at 7:44 PM, Daniel Drake wrote: > Note that during the insmod/rmmod calls, runtime PM did not touch the > power state - the card remained powered ever since the first insmod. > Not sure if this is in-line with your expectations. It definitely isn't. And that may very well be our culprit here. Let's focus now on just this one sequence: - boot - cat /sys/.../ios (power should be off) - insmod - cat /sys/.../ios (power should be on) - rmmod - cat /sys/.../ios (power should be off again) You will see the problem now. And I think I know why - there was a driver core change that indirectly caused this. Please try to revert e1866b33b1e89f077b7132daae3dfd9a594e9a1a "PM / Runtime: Rework runtime PM handling during driver removal" and tell me if it helped. If it did, un-revert that change, and try this one patch, which adopts SDIO runtime PM to that change: Thanks, Ohad. --- 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 diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index d29b9c3..d2565df 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c @@ -189,7 +189,7 @@ static int sdio_bus_remove(struct device *dev) /* Then undo the runtime PM settings in sdio_bus_probe() */ if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) - pm_runtime_put_noidle(dev); + pm_runtime_put_sync(dev); out: return ret;