From patchwork Thu Jul 12 12:54:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 1188811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 0BC15DFFFE for ; Thu, 12 Jul 2012 12:46:49 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SpIic-0005EN-3a; Thu, 12 Jul 2012 12:42:06 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SpIhT-00051Y-7W for linux-arm-kernel@lists.infradead.org; Thu, 12 Jul 2012 12:40:57 +0000 Received: from epcpsbgm2.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M71003DOSJUSDB0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 12 Jul 2012 21:40:45 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-c4-4ffec5ccc276 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6D.4E.23690.CC5CEFF4; Thu, 12 Jul 2012 21:40:45 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7100BYUSJJH720@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 12 Jul 2012 21:40:44 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Subject: [PATCH v3 2/6] mmc: dw_mmc: allow probe to succeed even if one slot is initialized Date: Thu, 12 Jul 2012 18:24:24 +0530 Message-id: <1342097668-25243-3-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1342097668-25243-1-git-send-email-thomas.abraham@linaro.org> References: <1342097668-25243-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAd2zR//5G0y9wmyx6fE1VgdGj81L 6gMYo7hsUlJzMstSi/TtErgyjn7cy1owibdi7eEfLA2Mm7i6GDk5JARMJE70PWSCsMUkLtxb z9bFyMUhJLCIUWL6tx/MEM56Jokdd36xg1SxCRhIPFr4DswWEXCSWDJ3AlgRs8AdRolHs04y giSEBWIlJv+7xApiswioSryZOZ0NxOYV8JT42nQOap2SxIbeo2A2p4CXxPWVLUD1HEDbPCVe /XGYwMi7gJFhFaNoakFyQXFSeq6RXnFibnFpXrpecn7uJkawz59J72Bc1WBxiFGAg1GJh/fB pn/+QqyJZcWVuYcYJTiYlUR4+3OBQrwpiZVVqUX58UWlOanFhxilOViUxHlNvL/6CwmkJ5ak ZqemFqQWwWSZODilGhiXqu1/Hb4qa8/jYDab/alLSn5vjXut9aZLZFHwj4CrP9OltTqy7obY 8KhYlt5qPnjp4FRx8cnOl2ets40KS/MR+Mh4gTNt39KzTDdUE814NnoY3WEK3Cq50Ff+ZN/u KRYa7PsNFvl/PHTa9ETyq5UrFoXsKP1jwMn+QtBxqxkj1zKt8Mg8zylKLMUZiYZazEXFiQCt oYoH9QEAAA== X-TM-AS-MML: No X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.25 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-samsung-soc@vger.kernel.org, patches@linaro.org, linux-kernel@vger.kernel.org, rob.herring@calxeda.com, grant.likely@secretlab.ca, kgene.kim@samsung.com, cjb@laptop.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- 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 948a7ac..cd58063 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1939,6 +1939,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, @@ -2047,10 +2048,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; } /* @@ -2085,12 +2094,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: