From patchwork Thu Sep 20 14:43:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 1485831 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 11EBFDF2D2 for ; Thu, 20 Sep 2012 14:45:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932157Ab2ITOop (ORCPT ); Thu, 20 Sep 2012 10:44:45 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:52363 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755882Ab2ITOmc (ORCPT ); Thu, 20 Sep 2012 10:42:32 -0400 Received: by mail-ie0-f174.google.com with SMTP id k13so3502236iea.19 for ; Thu, 20 Sep 2012 07:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=X8y+z+rUjQD7+qMTe8i1QWwxqQ3xIuQk2M5XD6T/vqI=; b=J/xSrrIUCLwzBCS89+Gl+4CFKvv89azGam8b1ZwzWk16xzSfedDMZI9Hrv/+ypw1ew RB+qcWy3+WYNrQca5U03VGPPTlUsag+S1sDTdbd0/ljbQ0Lk3RVQZzNOO3ukEgqHgoAO wrn1Llp0jBwWaTPcbLnnqIkSNKTIiNStDwdM+ZsHjG6raMZ2rrGCTcVaOunmg2hb0h3F klliJQwtZ2lvsbPXKrGtlPKrKoMf3PgIFyYd1tWnSdOn0rNRpy+Bv+5NYdsdgmZmORFk O1vPVXFfTVDwZCf+mXC6L7J3Cm6e7YkVdj57o0rBbDKEnj5Tk/gMi5GRBrvKYnlNI6Tw FylA== Received: by 10.50.181.161 with SMTP id dx1mr2510769igc.71.1348152152064; Thu, 20 Sep 2012 07:42:32 -0700 (PDT) Received: from beef.ohporter.com (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id p5sm15288242igm.13.2012.09.20.07.42.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 07:42:31 -0700 (PDT) From: Matt Porter To: Tony Lindgren , Sekhar Nori , Grant Likely , Mark Brown , Benoit Cousson , Russell King , Vinod Koul , Rob Landley , Chris Ball Cc: Devicetree Discuss , Linux OMAP List , Linux ARM Kernel List , Linux DaVinci Kernel List , Linux Kernel Mailing List , Linux Documentation List , Linux MMC List , Linux SPI Devel List , Arnd Bergmann , Dan Williams , Rob Herring Subject: [RFC PATCH 08/13] mmc: omap_hsmmc: limit max_segs with the EDMA DMAC Date: Thu, 20 Sep 2012 10:43:41 -0400 Message-Id: <1348152226-13588-9-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348152226-13588-1-git-send-email-mporter@ti.com> References: <1348152226-13588-1-git-send-email-mporter@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The EDMA DMAC has a hardware limitation that prevents supporting scatter gather lists with any number of segments. Since the EDMA DMA Engine driver sets the maximum segments to 16, we do the same. Note: this can be removed once the DMA Engine API supports an API to query the DMAC's segment limitations. Signed-off-by: Matt Porter --- drivers/mmc/host/omap_hsmmc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index c82d0ab..61b54ee 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1885,6 +1885,16 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev) * as we want. */ mmc->max_segs = 1024; + /* Eventually we should get our max_segs limitation for EDMA by + * querying the dmaengine API */ + if (pdev->dev.of_node) { + struct device_node *parent = pdev->dev.of_node->parent; + struct device_node *node; + node = of_find_node_by_name(parent, "edma"); + if (node) + mmc->max_segs = 16; + } + mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */ mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;