From patchwork Wed Aug 29 10:48:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 11017 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C27A923EFF for ; Wed, 29 Aug 2012 10:30:15 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 80863A188FF for ; Wed, 29 Aug 2012 10:29:43 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j25so734260iaf.11 for ; Wed, 29 Aug 2012 03:30:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-gm-message-state; bh=32wCd/LAHEmI918aUULpYFKqVT8QP9lcba/6sNbO6vk=; b=Jn06htntd6HNtXXpDMp6/pTBVOw6htSgacLFHZFGlvdKjayXcE2/Oq9imCSYKL75Y6 Fw21h8ddBE4Tjv5izYwtE67pFsa/S0rTs0id4Utg3RHTG7zCMXQ6Jz5wPR38g8aBK3Od D/WPnH2qPnfVmJ7zwDleRM+RfJgTU+/e4LqxZu57RPa6dpQBdggkKrIohNg9e//6zsjj oKKtrLvtThB4d6E9ntzgsV9LyWSeuwoCHiBARxa67qnDG+UE+lGivb2IWeDCGPJXq5UV cypWHHHoMB1Qe5C4Os8NufgUeQ76BnnB8pXbJFhtwRRfOPKNoZdub1RWeR07La0hrSox S1fw== Received: by 10.50.159.196 with SMTP id xe4mr16711814igb.43.1346236215236; Wed, 29 Aug 2012 03:30:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp77418igc; Wed, 29 Aug 2012 03:30:14 -0700 (PDT) Received: by 10.68.194.105 with SMTP id hv9mr219475pbc.13.1346236214416; Wed, 29 Aug 2012 03:30:14 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id px5si41703512pbb.202.2012.08.29.03.30.13; Wed, 29 Aug 2012 03:30:14 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9I00CPJIHKH311@mailout4.samsung.com>; Wed, 29 Aug 2012 19:30:13 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-70-503def35d278 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 06.2F.18282.53FED305; Wed, 29 Aug 2012 19:30:13 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9I004F3IHPXG70@mmp2.samsung.com>; Wed, 29 Aug 2012 19:30:13 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: will.newton@imgtec.com, cjb@laptop.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, girish.shivananjappa@linaro.org, jh80.chung@samsung.com, tgih.jun@samsung.com, patches@linaro.org Subject: [PATCH v5 3/9] mmc: dw_mmc: allow probe to succeed even if one slot is initialized Date: Wed, 29 Aug 2012 16:18:09 +0530 Message-id: <1346237295-7116-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1346237295-7116-1-git-send-email-thomas.abraham@linaro.org> References: <1346237295-7116-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jQV3T97YBBu3v+S2+fD3BZjHl8BcW ByaPO9f2sAUwRnHZpKTmZJalFunbJXBlHPvLU3CIt2Lzmd9sDYx3uboYOTkkBEwk7nStZoGw xSQu3FvP1sXIxSEkMJ1R4s+3yYwQThuTxMHbi5lAqtgEDCQeLXzHDmKLCDhJLJk7gRmkiFmg kUli48KdbCAJYYFYiZZ9GxhBbBYBVYm/k++xgti8Ah4SNx9OZoVYpySxofco2FBOAU+Jdyuv gPUKAdX8vreSbQIj7wJGhlWMoqkFyQXFSem5RnrFibnFpXnpesn5uZsYwf5/Jr2DcVWDxSFG AQ5GJR7eC9y2AUKsiWXFlbmHGCU4mJVEeFNfAYV4UxIrq1KL8uOLSnNSiw8xSnOwKInz8vcZ BggJpCeWpGanphakFsFkmTg4pRoYq5Y0yT36VJ8xM5KX4Zvp8+X1CdrTu1itJ+577H+06tBp y0ehB1bevrDivv7/6/E3EnUz5R65zdmkPl85vWVlgNZS5zUlzv/+37ls1KG5Ve++eFXNxzf7 dKJe75R/ekTpyZeFDtlGWhV2JwtZpkxdo7Evp8ag86au1cJNF99XP+CZbfhf7VSRmhJLcUai oRZzUXEiAAy7n0v7AQAA X-Gm-Message-State: ALoCoQn4D8ElJNJHx2lZd3fjUElV3Qh/m1+ywJxmL0YBGrm7wrd65ArT9Pmpqd0yik/wgQUZKzPV Instead of aborting the probe in case a slot initialization fails, allow initialization of as many slots as possible. If there are atleast one instance of slot that is successfully initialized, allow the driver probe to succeed. Signed-off-by: Thomas Abraham Acked-by: Will Newton --- drivers/mmc/host/dw_mmc.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index a18e73c..227c42e 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1946,6 +1946,7 @@ int dw_mci_probe(struct dw_mci *host) { int width, i, ret = 0; u32 fifo_size; + int init_slots = 0; if (!host->pdata || !host->pdata->init) { dev_err(host->dev, @@ -2054,10 +2055,18 @@ int dw_mci_probe(struct dw_mci *host) /* We need at least one slot to succeed */ for (i = 0; i < host->num_slots; i++) { ret = dw_mci_init_slot(host, i); - if (ret) { - ret = -ENODEV; - goto err_init_slot; - } + if (ret) + dev_dbg(host->dev, "slot %d init failed\n", i); + else + init_slots++; + } + + if (init_slots) { + dev_info(host->dev, "%d slots initialized\n", init_slots); + } else { + dev_dbg(host->dev, "attempted to initialize %d slots, " + "but failed on all\n", host->num_slots); + goto err_init_slot; } /* @@ -2092,12 +2101,6 @@ int dw_mci_probe(struct dw_mci *host) return 0; err_init_slot: - /* De-init any initialized slots */ - while (i > 0) { - if (host->slot[i]) - dw_mci_cleanup_slot(host->slot[i], i); - i--; - } free_irq(host->irq, host); err_workqueue: