devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
To: Balaji T K <balajitk-l0cyMroinI0@public.gmane.org>,
	Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>,
	Benoit Cousson <b-cousson-l0cyMroinI0@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Devicetree Discuss
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	Linux OMAP List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux MMC List
	<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux ARM Kernel List
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: [PATCH 1/2] mmc: omap_hsmmc: set max_segs based on dma engine limits
Date: Wed,  6 Mar 2013 23:16:38 -0500	[thread overview]
Message-ID: <1362629799-22485-2-git-send-email-mporter@ti.com> (raw)
In-Reply-To: <1362629799-22485-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>

The EDMA DMAC has a hardware limitation that prevents supporting
scatter gather lists with any number of segments. The DMA Engine
API reports the maximum number of segments a channel can support
via the optional dma_get_slave_sg_limits() API. If the max_nr_segs
limit is present, the value is used to configure mmc->max_segs
appropriately.

Signed-off-by: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Acked-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
 drivers/mmc/host/omap_hsmmc.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e79b12d..f74d2ef 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1769,6 +1769,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	const struct of_device_id *match;
 	dma_cap_mask_t mask;
 	unsigned tx_req, rx_req;
+	struct dma_slave_sg_limits *dma_sg_limits;
 	struct pinctrl *pinctrl;
 
 	match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
@@ -1935,6 +1936,13 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 		goto err_irq;
 	}
 
+	/* Some DMA Engines only handle a limited number of SG segments */
+	dma_sg_limits = dma_get_slave_sg_limits(host->rx_chan,
+						DMA_SLAVE_BUSWIDTH_4_BYTES,
+						mmc->max_blk_size / 4);
+	if (dma_sg_limits && dma_sg_limits->max_seg_nr)
+		mmc->max_segs = dma_sg_limits->max_seg_nr;
+
 	/* Request IRQ for MMC operations */
 	ret = request_irq(host->irq, omap_hsmmc_irq, 0,
 			mmc_hostname(mmc), host);
-- 
1.7.9.5

  parent reply	other threads:[~2013-03-07  4:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07  4:16 [PATCH 0/2] AM33xx mmc support Matt Porter
     [not found] ` <1362629799-22485-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-03-07  4:16   ` Matt Porter [this message]
2013-03-07  4:16 ` [PATCH 2/2] ARM: dts: add AM33XX MMC support Matt Porter
     [not found]   ` <1362629799-22485-3-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-03-07  5:29     ` Hiremath, Vaibhav
     [not found]   ` <41fde401c8e646689123d7c6d3a2dffc@DLEE71.ent.ti.com>
2013-03-07 14:12     ` Matt Porter
2013-03-07 14:39       ` Hiremath, Vaibhav
2013-03-07 14:46         ` Matt Porter
2013-03-07 14:51           ` Matt Porter
2013-03-07 14:53           ` Hiremath, Vaibhav
2013-03-07 15:00             ` Matt Porter
2013-03-07 15:03               ` Hiremath, Vaibhav
2013-03-07 14:59           ` Hiremath, Vaibhav
2013-03-07 15:04             ` Matt Porter
2013-03-07 15:50               ` Hiremath, Vaibhav
2013-03-07 16:02                 ` Matt Porter
2013-03-08 12:29                   ` Hiremath, Vaibhav
2013-06-14 19:54                     ` Joel A Fernandes
2013-06-14 22:26                       ` Felipe Balbi
     [not found]                         ` <20130614222537.GA25428-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-06-14 23:43                           ` Joel A Fernandes
     [not found]                             ` <CAD=GYpYfMAZeV1RUC=DqhYGZaKiiukpTZg7bhO582eKwimS9aA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-15  7:23                               ` Joel A Fernandes
2013-06-15 15:05                             ` Felipe Balbi
     [not found]                               ` <20130615150500.GA27629-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-06-17  6:20                                 ` Tony Lindgren

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=1362629799-22485-2-git-send-email-mporter@ti.com \
    --to=mporter-l0cymroini0@public.gmane.org \
    --cc=b-cousson-l0cyMroinI0@public.gmane.org \
    --cc=balajitk-l0cyMroinI0@public.gmane.org \
    --cc=cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.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;
as well as URLs for NNTP newsgroup(s).