From patchwork Wed Oct 13 07:31:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 249861 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9D7bk0V012215 for ; Wed, 13 Oct 2010 07:37:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753152Ab0JMHhp (ORCPT ); Wed, 13 Oct 2010 03:37:45 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:34781 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753127Ab0JMHho (ORCPT ); Wed, 13 Oct 2010 03:37:44 -0400 Received: by bwz15 with SMTP id 15so2991231bwz.19 for ; Wed, 13 Oct 2010 00:37:43 -0700 (PDT) Received: by 10.204.160.90 with SMTP id m26mr7440314bkx.45.1286955463165; Wed, 13 Oct 2010 00:37:43 -0700 (PDT) Received: from localhost.localdomain (109-186-69-160.bb.netvision.net.il [109.186.69.160]) by mx.google.com with ESMTPS id p34sm6005292bkf.3.2010.10.13.00.37.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Oct 2010 00:37:35 -0700 (PDT) From: Ohad Ben-Cohen To: Cc: Sven Neumann , Chris Ball , Nicolas Pitre , , "Rafael J. Wysocki" , Daniel Mack , Colin Cross , Greg Kroah-Hartman , , , Maxim Levitsky , Ohad Ben-Cohen , Subject: [PATCH] sdio: fix suspend/resume regression Date: Wed, 13 Oct 2010 09:31:56 +0200 Message-Id: <1286955116-22793-1-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1286788315.3101.11.camel@sven> References: <1286788315.3101.11.camel@sven> 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.3 (demeter1.kernel.org [140.211.167.41]); Wed, 13 Oct 2010 07:37:46 +0000 (UTC) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index c94565d..515ff39 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1682,6 +1682,19 @@ int mmc_suspend_host(struct mmc_host *host) if (host->bus_ops && !host->bus_dead) { if (host->bus_ops->suspend) err = host->bus_ops->suspend(host); + if (err == -ENOSYS || !host->bus_ops->resume) { + /* + * We simply "remove" the card in this case. + * It will be redetected on resume. + */ + if (host->bus_ops->remove) + host->bus_ops->remove(host); + mmc_claim_host(host); + mmc_detach_bus(host); + mmc_release_host(host); + host->pm_flags = 0; + err = 0; + } } mmc_bus_put(host);