mmc: msm_sdcc: set max segments to max SPS decsriptors

eMMC4.5 specifcation defines the packed commands where
block I/O scheduler can club multiple read/write transfer
request in single packed transfer request before posting
it to block driver. Clubbing multiple transfer requests
in single packed transfer request may require block driver
to support more segments in scatter-gather list.
But as of now, msm sdcc driver is supporting maximum 128
segments in scatter-gather list which seems to be not enough
for effcient packed transfer request.

max segments supported by driver (in SPS DMA mode) are only
limited by the max number of descriptors that can be
queued in SPS Descriptor FIFO for a single transfer request.
So this change changes the max segments supported by driver
to max SPS descriptors.

Change-Id: If2f7d7eea59eb14b82a1a361f5216fee7ff8104e
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index eeca25a..4040c32 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -138,8 +138,7 @@
 	unsigned short ret = NR_SG;
 
 	if (host->is_sps_mode) {
-		if (NR_SG > MAX_NR_SG_SPS)
-			ret = MAX_NR_SG_SPS;
+		ret = SPS_MAX_DESCS;
 	} else { /* DMA or PIO mode */
 		if (NR_SG > MAX_NR_SG_DMA_PIO)
 			ret = MAX_NR_SG_DMA_PIO;
@@ -148,28 +147,6 @@
 	return ret;
 }
 
-static inline unsigned int msmsdcc_get_max_seg_size(struct msmsdcc_host *host)
-{
-	unsigned int max_seg_size;
-
-	/*
-	 * SPS BAM has limitation of max. number of descriptors.
-	 * max. # of descriptors = SPS_MAX_DESCS
-	 * each descriptor can point to SPS_MAX_DESC_SIZE (16KB)
-	 * So (nr_sg * max_seg_size) should be limited to the
-	 * max. size that all of the descriptors can point to.
-	 * i.e., (nr_sg * max_seg_size) = (SPS_MAX_DESCS * SPS_MAX_DESC_SIZE).
-	 */
-	if (host->is_sps_mode) {
-		max_seg_size = (SPS_MAX_DESCS * SPS_MAX_DESC_SIZE) /
-			msmsdcc_get_nr_sg(host);
-	} else { /* DMA or PIO mode */
-		max_seg_size = MMC_MAX_REQ_SIZE;
-	}
-
-	return max_seg_size;
-}
-
 #ifdef CONFIG_MMC_MSM_SPS_SUPPORT
 static int msmsdcc_sps_reset_ep(struct msmsdcc_host *host,
 				struct msmsdcc_sps_ep_conn_data *ep);
@@ -4009,7 +3986,7 @@
 	mmc->max_blk_count = MMC_MAX_BLK_CNT;
 
 	mmc->max_req_size = MMC_MAX_REQ_SIZE;
-	mmc->max_seg_size = msmsdcc_get_max_seg_size(host);
+	mmc->max_seg_size = mmc->max_req_size;
 
 	writel_relaxed(0, host->base + MMCIMASK0);
 	writel_relaxed(MCI_CLEAR_STATIC_MASK, host->base + MMCICLEAR);