From patchwork Sat Oct 9 01:07:50 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: 242871 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 o9918GAR002442 for ; Sat, 9 Oct 2010 01:08:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759990Ab0JIBIQ (ORCPT ); Fri, 8 Oct 2010 21:08:16 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:34876 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759972Ab0JIBIP convert rfc822-to-8bit (ORCPT ); Fri, 8 Oct 2010 21:08:15 -0400 Received: by iwn6 with SMTP id 6so960200iwn.19 for ; Fri, 08 Oct 2010 18:08:14 -0700 (PDT) Received: by 10.42.170.129 with SMTP id f1mr247719icz.94.1286586491598; Fri, 08 Oct 2010 18:08:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.182.10 with HTTP; Fri, 8 Oct 2010 18:07:50 -0700 (PDT) X-Originating-IP: [46.116.86.31] In-Reply-To: <201010082208.25767.rjw@sisk.pl> References: <1286177435.2140.5.camel@sven> <201010072323.05218.rjw@sisk.pl> <1286526197.4493.19.camel@sven> <201010082208.25767.rjw@sisk.pl> From: Ohad Ben-Cohen Date: Sat, 9 Oct 2010 03:07:50 +0200 Message-ID: Subject: Re: 2.6.35.6 fails to suspend (pxa2xx-mci.0) To: Sven Neumann Cc: "Rafael J. Wysocki" , Daniel Mack , Colin Cross , Greg Kroah-Hartman , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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.3 (demeter1.kernel.org [140.211.167.41]); Sat, 09 Oct 2010 01:08:16 +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);