mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Liming Sun <lsun@mellanox.com>
To: Jaehoon Chung <jh80.chung@samsung.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Liming Sun <lsun@mellanox.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/9] Revert "mmc: dw_mmc: deprecated the "num-slots" property"
Date: Fri,  6 Oct 2017 15:21:30 -0400	[thread overview]
Message-ID: <8a128c02687629bee2cda9ca02ca5895be8202c4.1507315433.git.lsun@mellanox.com> (raw)
In-Reply-To: <cover.1507315433.git.lsun@mellanox.com>
In-Reply-To: <cover.1507315433.git.lsun@mellanox.com>

This reverts commit d30a8f7bdf6498e47bd3a6f31e5028f239deb208.

The Mellanox BlueField SoC requires multiple slot dw-mmc support.

Signed-off-by: Liming Sun <lsun@mellanox.com>
---
 drivers/mmc/host/dw_mmc.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index ef36e05..150cd05 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -3018,8 +3018,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
 	}
 
 	/* find out number of slots supported */
-	if (!device_property_read_u32(dev, "num-slots", &pdata->num_slots))
-		dev_info(dev, "'num-slots' was deprecated.\n");
+	device_property_read_u32(dev, "num-slots", &pdata->num_slots);
 
 	if (device_property_read_u32(dev, "fifo-depth", &pdata->fifo_depth))
 		dev_info(dev,
@@ -3252,12 +3251,18 @@ int dw_mci_probe(struct dw_mci *host)
 	if (ret)
 		goto err_dmaunmap;
 
-	/*
-	 * Even though dwmmc IP is provided the multiple slots,
-	 * there is no use case in mmc subsystem.
-	 * dwmmc host controller needs to initialize the one slot per an IP.
-	 */
-	host->num_slots = 1;
+	if (host->pdata->num_slots)
+		host->num_slots = host->pdata->num_slots;
+	else
+		host->num_slots = 1;
+
+	if (host->num_slots < 1 ||
+	    host->num_slots > SDMMC_GET_SLOT_NUM(mci_readl(host, HCON))) {
+		dev_err(host->dev,
+			"Platform data must supply correct num_slots.\n");
+		ret = -ENODEV;
+		goto err_clk_ciu;
+	}
 
 	/*
 	 * Enable interrupts for command done, data over, data empty,
-- 
1.8.3.1

  parent reply	other threads:[~2017-10-06 19:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 19:21 [PATCH 0/9] Enable dw-mmc multi-card support Liming Sun
2017-10-06 19:21 ` [PATCH 1/9] Revert "Documentation: dw-mshc: deprecate num-slots" Liming Sun
2017-10-13 19:28   ` Rob Herring
2017-10-06 19:21 ` [PATCH 2/9] Revert "mmc: dw_mmc: remove the unnecessary slot variable" Liming Sun
2017-10-06 19:21 ` [PATCH 3/9] Revert "mmc: dw_mmc: use the 'slot' instead of 'cur_slot'" Liming Sun
2017-10-06 19:21 ` [PATCH 4/9] Revert "mmc: dw_mmc: remove the 'id' arguments about functions relevant to slot" Liming Sun
2017-10-06 19:21 ` [PATCH 5/9] Revert "mmc: dw_mmc: change the array of slots" Liming Sun
2017-10-06 19:21 ` [PATCH 6/9] Revert "mmc: dw_mmc: remove the loop about finding slots" Liming Sun
2017-10-06 19:21 ` Liming Sun [this message]
2017-10-06 19:21 ` [PATCH 8/9] mmc: dw_mmc: Support two SD_MMC_CE-ATA cards Liming Sun
2017-10-06 19:21 ` [PATCH 9/9] mmc: dw_mmc: Parse slot-specific configuration Liming Sun
2017-10-16 14:35 ` [PATCH 0/9] Enable dw-mmc multi-card support Liming Sun
2017-10-17  1:36 ` Shawn Lin
2017-10-17 15:52   ` Liming Sun
2017-10-20 14:06     ` Jaehoon Chung
2017-10-20 15:07       ` Liming Sun
2017-10-25 16:47         ` Ulf Hansson
2017-10-25 16:50           ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a128c02687629bee2cda9ca02ca5895be8202c4.1507315433.git.lsun@mellanox.com \
    --to=lsun@mellanox.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®