Return-path: Received: from mail-iw0-f174.google.com ([209.85.214.174]:35790 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753649Ab0KAJCV (ORCPT ); Mon, 1 Nov 2010 05:02:21 -0400 MIME-Version: 1.0 In-Reply-To: <4CCE74DB.8000206@arndnet.de> References: <4CCDA454.708@arndnet.de> <4CCDE4EB.7060001@arndnet.de> <4CCE74DB.8000206@arndnet.de> From: Ohad Ben-Cohen Date: Mon, 1 Nov 2010 11:02:00 +0200 Message-ID: Subject: Re: regression: b43-sdio: probe of mmc0:0001:1 failed with error -16 To: Arnd Hannemann Cc: "linux-mmc@vger.kernel.org" , "linux-wireless@vger.kernel.org" , linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary=000325574a52dc9bc50493fa10a7 Sender: linux-wireless-owner@vger.kernel.org List-ID: --000325574a52dc9bc50493fa10a7 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Nov 1, 2010 at 10:05 AM, Arnd Hannemann wrote: > No, actually mmc_sdio_init_card() is called _before_ sdio_bus_probe Yes, it is called once at boot while the card is mmc_rescan()ed. But that's not interesting, because the card is then powered down, and will only be powered on again when it is probed with a driver. > Also mmd_sdio_resume is not called at all. Sorry, I meant mmc_sdio_restore_host. You should see something like this: sdio_bus_probe - > ... (runtime PM function calls) ... -> mmc_power_restore_host -> mmc_sdio_power_restore -> mmc_sdio_init_card -> ... We have 1 report where the latter mmc_sdio_init_card fails at this point, and I'm interested to know whether it fails for you, too (and if yes, where). If it is not even called, I'd appreciate if you can check out where does this flow break in your case. > No mmc_send_relative_addr() does _not_ return -110, actually it > is not called at all. OK. > I inserted a WARN_ON() in sdio_bus_probe, and here is the backtrace I get: The interesting part is actually what happens after sdio_bus_probe(), not before it. Is mmc_power_restore_host being called ? mmc_sdio_power_restore ? mmc_sdio_init_card ? etc... I'm also attaching a patch that requires hosts to explicitly indicate whether they support powering off/on their cards after boot (which would prevent SDIO core from powering off you card after boot since your host doesn't indicate that capability). Can you please see if the problem goes away with it ? Thanks, Ohad. --000325574a52dc9bc50493fa10a7 Content-Type: text/x-patch; charset=US-ASCII; name="0001-mmc-add-MMC_CAP_RUNTIME_PM.patch" Content-Disposition: attachment; filename="0001-mmc-add-MMC_CAP_RUNTIME_PM.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gfz4dlia0 RnJvbSA2YjU2OTFiZGQ4MTg0Y2MwODc2ZDIwOWM2OWQzODg0NGVhMTBmNjc4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBPaGFkIEJlbi1Db2hlbiA8b2hhZEB3aXplcnkuY29tPgpEYXRl OiBNb24sIDEgTm92IDIwMTAgMDk6NDE6NDQgKzAyMDAKU3ViamVjdDogW1BBVENIXSBtbWM6IGFk ZCBNTUNfQ0FQX1JVTlRJTUVfUE0KClNvbWUgYm9hcmQvY2FyZC9ob3N0IGNvbmZpZ3VyYXRpb25z IGFyZSBub3QgY2FwYWJsZSBvZiBwb3dlcmluZyBvZmYvb24Kb24gdGhlIGNhcmQgZHVyaW5nIHJ1 bnRpbWUuCgpUbyBzdXBwb3J0IHN1Y2ggY29uZmlndXJhdGlvbnMsIGFuZCB0byBhbGxvdyBzbW9v dGhlciB0cmFuc2l0aW9uIHRvCnJ1bnRpbWUgUE0gYmVoYXZpb3IsIE1NQ19DQVBfUlVOVElNRV9Q TSBpcyBhZGRlZCwgc28gaG9zdHMgbmVlZCB0bwpleHBsaWNpdGx5IGluZGljYXRlIHRoYXQgaXQn cyBPSyB0byBwb3dlciBvZmYgdGhlaXIgY2FyZHMgYWZ0ZXIgYm9vdC4KClRoaXMgd2lsbCBwcmV2 ZW50IHNkaW9fYnVzX3Byb2JlKCkgZnJvbSBmYWlsaW5nIHRvIHBvd2VyIG9uIHRoZSBjYXJkCndo ZW4gdGhlIGRyaXZlciBpcyBsb2FkZWQgb24gc3VjaCBzZXR1cHMuCgpTaWduZWQtb2ZmLWJ5OiBP aGFkIEJlbi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