From patchwork Mon Sep 17 18:16:37 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: 11465 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 688AD23F9E for ; Mon, 17 Sep 2012 17:56:48 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id AD6E5A18E3A for ; Mon, 17 Sep 2012 17:56:47 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id k11so9550081iea.11 for ; Mon, 17 Sep 2012 10:56:47 -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=kr7LHb2/lgPu0u60nnJR2TktsH9B9fxAIiFX1W0R5MjvTPmjnl5sPVgdvxmRsKYRBC IoK6pTDz8AgsSO4oUKXr7x58IfB52KxhWBGoKMHUQeJsvGZ1WK9vpr4Rz+tb8AdNKnVg NXkcxu4LLR7NcUMlSXwTaGf3gOIpNx6FKxsMEQlPeS/LMFleaFZ/Zm5ca4z0WAjDJ2sG ivGl304Jzm+UkuktFEoBn4j4c5VHVuUZdTD733jL7SRr6GIFvywgfd+0vYox44JHMe7Q E/AhvJSkOWC4A4xLi+HV/ZxphiFgQLCr4ClHqtq2FeEUl6rcCtOb9tOMSWibxKr2Wd/E OzDw== Received: by 10.50.0.193 with SMTP id 1mr5703188igg.0.1347904607490; Mon, 17 Sep 2012 10:56:47 -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 ex8csp329889igc; Mon, 17 Sep 2012 10:56:47 -0700 (PDT) Received: by 10.66.77.229 with SMTP id v5mr21175073paw.60.1347904606716; Mon, 17 Sep 2012 10:56:46 -0700 (PDT) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id np8si16471439pbc.221.2012.09.17.10.56.46; Mon, 17 Sep 2012 10:56:46 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.33; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.33 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 mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MAI005339UEK530@mailout3.samsung.com>; Tue, 18 Sep 2012 02:56:45 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-d9-5057645dbde2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 9D.5A.03860.D5467505; Tue, 18 Sep 2012 02:56: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 <0MAI00MTJ9U8PO50@mmp1.samsung.com>; Tue, 18 Sep 2012 02:56:44 +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 v6 3/9] mmc: dw_mmc: allow probe to succeed even if one slot is initialized Date: Mon, 17 Sep 2012 23:46:37 +0530 Message-id: <1347905803-22742-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1347905803-22742-1-git-send-email-thomas.abraham@linaro.org> References: <1347905803-22742-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jAd3YlPAAg2P9AhZfvp5gs5hy+AuL A5PHnWt72AIYo7hsUlJzMstSi/TtErgyjv3lKTjEW7H5zG+2Bsa7XF2MnBwSAiYSK/9cZ4aw xSQu3FvP1sXIxSEksIhRYvGZeSwQThuTxLIrO8Cq2AQMJB4tfMcOYosIOEksmTuBGaSIWaCR SWLjwp1sIAlhgViJx6sbmEBsFgFVicmTP4E18Ap4SvSdnsAIsU5JYkPvUbAaTgEvienbD4HV CAHV7F0xm2UCI+8CRoZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmbGMH+fya9g3FVg8UhRgEO RiUe3oSg8AAh1sSy4srcQ4wSHMxKIry3BYBCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeYU/BQYI CaQnlqRmp6YWpBbBZJk4OKUaGKeGscysblZ13dtrsdbE5mbm13uHHmUeZjV+1F5js4rnp9ph GUvOzSJntjZ3zTlx7mwPe17GMd2NkppteYp1bl1RaUtXqhzqW9zoVFL/9veSHTl9dxVmaB5o vX76luCqB7/XXatLurHpLbP4fvP3k204xNbPSrIr/2z87Zjnud98864/XvjvuboSS3FGoqEW c1FxIgCIRGTy+wEAAA== X-Gm-Message-State: ALoCoQlXYc9yHLd0RgM/vHoF9JpSAN+/C4fQSVnWD4xJWyTlAV+YHZ+7A8mwKrxkaw1w1P/2H3F7 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: