From patchwork Sun Aug 26 11:52:01 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: 10953 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 8F96C23EFE for ; Sun, 26 Aug 2012 11:34:20 +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 33483A182BD for ; Sun, 26 Aug 2012 11:33:57 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j25so3776090iaf.11 for ; Sun, 26 Aug 2012 04:34:20 -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=EYStInKd2DXtcT6jGaiqsG5cKpk4YnP699XMl9dWLpE=; b=ComIfQSYib0V03lwAkjUT6Dc+7GovZFFEzfSZBjWKKRLesDzn1lo0mg/ohYzpT1soa bEQDNqW7550ta4it7sKP9jBKrAhUHiBCYzuPrfjIlrVv6Um4lSceE1CYEhgJWDAtTPe/ ceIdGUQ0UXJUPlhoezefSv/etYSaUNyrxdXfPel5p+M7R9DSf6rVJFZG5U9V/y90tuH1 K6gq9/twrXT8qvGSXiVWZn1vUBJHbJHZLDHLdSkb0qNpN1E2WtJmj9JjNdDGheuxVuMH RZSJKv15JU4cxupKuZM5E2jQzNaRO0Wp9P3U6di+/Pgs0OLMVbE/ji8ggpMGUo4M5rvf /eNQ== Received: by 10.50.182.162 with SMTP id ef2mr7123303igc.43.1345980860004; Sun, 26 Aug 2012 04:34:20 -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 ex8csp396426igc; Sun, 26 Aug 2012 04:34:19 -0700 (PDT) Received: by 10.68.240.66 with SMTP id vy2mr9103573pbc.73.1345980859452; Sun, 26 Aug 2012 04:34:19 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id ow6si24966071pbb.183.2012.08.26.04.34.18; Sun, 26 Aug 2012 04:34:19 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9D006XB1GZK000@mailout1.samsung.com>; Sun, 26 Aug 2012 20:34:18 +0900 (KST) X-AuditID: cbfee61a-b7fc66d0000043b7-3c-503a09b9e3cf Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id F6.4A.17335.9B90A305; Sun, 26 Aug 2012 20:34:18 +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 <0M9D00AQQ1GN7UA0@mmp1.samsung.com>; Sun, 26 Aug 2012 20:34:17 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: 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 v4 3/9] mmc: dw_mmc: allow probe to succeed even if one slot is initialized Date: Sun, 26 Aug 2012 17:22:01 +0530 Message-id: <1345981927-26359-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1345981927-26359-1-git-send-email-thomas.abraham@linaro.org> References: <1345981927-26359-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jAd1dnFYBBj0TGC2+fD3BZjHl8BcW ByaPO9f2sAUwRnHZpKTmZJalFunbJXBlHP24l7VgEm/F2sM/WBoYN3F1MXJySAiYSFyeMYsJ whaTuHBvPVsXIxeHkMAiRol/H/4xgySEBNqYJO6eMgGx2QQMJB4tfMcOYosIOEksmTuBGaSB WeAlo8TMXTPZQBLCArESR6/8BytiEVCVmDCxFyzOK+Ap0fmzjx1im5LEht6jYJs5Bbwkbixq ZYdY5ilxfMZ3xgmMvAsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBPv/mdQOxpUNFocY BTgYlXh4BUotA4RYE8uKK3MPMUpwMCuJ8H7fDxTiTUmsrEotyo8vKs1JLT7EKM3BoiTOy99n GCAkkJ5YkpqdmlqQWgSTZeLglGpglJ5//e/spcrbC/ey297sLc18OmH3lCse1r7TMzfk+5nO smAvuMJtdDvgxOUpR3grwh8fUNx3tcrojJ7K1IUClw122ixge+X7+fxpYzsewd2qCfP3m1xh Drk15/o9hgffC4xUfri07Mt9Gdd8W+qssXzjSTWOoGrFRyLy517XrFuoZXRslVBuqxJLcUai oRZzUXEiAM4QxD77AQAA X-Gm-Message-State: ALoCoQkxMIG5J2uQCjXLJ3X0aDm8uYNGYuOZ6iKQ802YWnEsgn/dCuf4Hwn3908cm+W4YBqFS+TI 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: