Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3468404imm; Sun, 29 Jul 2018 20:03:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdw/xz8x/MpgnMWh0i8f2ArqkgwUl2GXYDbTXqr61z4swcSFYZxsOyONrcRiLDRfqNbrhYY X-Received: by 2002:a17:902:7c8e:: with SMTP id y14-v6mr15065281pll.265.1532919804564; Sun, 29 Jul 2018 20:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532919804; cv=none; d=google.com; s=arc-20160816; b=ztMcJz5KSANPYhH8DyqPW7Ks5mO+KFQdwEOYmXYSgGzx1JGYFIVZ0+TH96xi8PJArA lYudOtpPpxFYcwQeJudCx6LJb7uZquD9g3bgGmmKwh4t/ucY4Wlr/QHoinDvfZMXDcCM vkwtQUKZqSWo6PpjsNn4kmHRKPxhDiwsxX2QTB095yoYit5e6AjQv/CMPAPgJKQ8yKV7 NTSHU2Tl4vKy86b+FwuArLUmjK5yWndBekHC7aNdjbKyr/T1KjNgrsGqVi2h18pW0AH0 sH57NrnS+QHRtx0oK6tAu0fwcnzXvrJjA13EIwfjTJO2hGjZNgTTVxu8v84Z9lezqdr1 Dvzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=aqODxSvCxp6OypKADJ4tK4n38xgRhLNsiHX0CUOsLj0=; b=ONZaDVSosk1eM7QudHO48HExvJd9cQ1sAeScE46uvkm3x7Qfw4tKVGdULuCdGpDPpl 0S7Cu29Zp5yEOJWlnJXv2zFjmquEl4o2g52JXrlLkTvEQTcOg7SXF9kp7xDZe9g7swWT aTppicqQnXYB/9/H3wqpUTCtepmftbvjsAHN/gLrUAu1T2r667Asa0i4CjYBPlqO4gm4 SL4iLv+dYJ/n+bwRoY0gQkDenJE0gZVRBfhUYLAzue7XHKu/Y1Dt1FIykapvIzJ7rZNm dHYFPuj/0Epf/EjwCRpPQEqN4xSgrGBqJqurvVlCGTGajot1KdKKF9tu693d7lHYFrpm /Z3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=k17qR0Mf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si5846150pld.256.2018.07.29.20.03.09; Sun, 29 Jul 2018 20:03:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=k17qR0Mf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726093AbeG3EfK (ORCPT + 99 others); Mon, 30 Jul 2018 00:35:10 -0400 Received: from mail-bn3nam01on0060.outbound.protection.outlook.com ([104.47.33.60]:3768 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725833AbeG3EfK (ORCPT ); Mon, 30 Jul 2018 00:35:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aqODxSvCxp6OypKADJ4tK4n38xgRhLNsiHX0CUOsLj0=; b=k17qR0Mf3xWfUHomnXV68esjm8NDkD9Af6UGNkXhLA/AEWbpGzmcAdKr8Ci247yLMYsdo7Q6c6Mm6pmBqTfUyuhqTsX2gdjc0MOPgcHuAd/Oa/bHVG7OQX666y5GOZvM/fBfk9a92QhEs10Yt6DsWfmYThkE2C45OWPdnpNIbKc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by BLUPR0301MB1569.namprd03.prod.outlook.com (2a01:111:e400:52a9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.18; Mon, 30 Jul 2018 03:02:15 +0000 Date: Mon, 30 Jul 2018 10:59:54 +0800 From: Jisheng Zhang To: Matthew Leon Cc: Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH mmc-next v3 3/3] mmc: sdhci-of-dwcmshc: solve 128MB DMA boundary limitation Message-ID: <20180730105954.6c365a7b@xhacker.debian> In-Reply-To: <01010164e91d7bda-aa616cbf-7bb2-4fe4-85e5-a18e16433fde-000000@us-west-2.amazonses.com> References: <20180730104228.28b58bd0@xhacker.debian> <20180730104636.1a3e6c81@xhacker.debian> <01010164e91d7bda-aa616cbf-7bb2-4fe4-85e5-a18e16433fde-000000@us-west-2.amazonses.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: TYAPR01CA0059.jpnprd01.prod.outlook.com (2603:1096:404:2b::23) To BLUPR0301MB1569.namprd03.prod.outlook.com (2a01:111:e400:52a9::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e18babfe-5e2a-458d-e82a-08d5f5c8dbeb X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BLUPR0301MB1569; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1569;3:lB497oJDkjbr0jq641ADuznNuSmKRzWbX7eS1j4TSdCComuAaotrtYKTg4ztMBWuj9FnnTIhMADiNePZtpUIYWv0tkrmqlr/Y2VSyV8fKfGMc7p4Ri3H6fvpwGRfOnUVGgmvLXq5zgFAh1ZoODNvTeypnzbncb8d//I3SUQ3hcfzwn3h8mnSShIInizp5tgQoWOahy730/FrXwbK9vGnvUMO7A/DHk9/XTV6Z6hczBD4abrvMUJorgzIIYTL3Hub;25:pOOLhm2OWJjYp2A21iPREczsZAIllr94uVZC4eN/3RkCaIHyob0vHRR0yYX9ImL7O8mmf+vRajmrtx0htnlA4lw1vcsHXE+8kw33Pkr62MeZRTOcKzLBf3SmMRxkXRBybafE9vPg1yWmB8kkwhS7/WPJYK9Rj+eeUFVKdd/XQjTmm9cDcTbuLvgnepRiQpG3XuwD5YtzQNeCzfjrZFm4x3SmVYiz+D3VhT+1L8HguXobhUb4WlcWqa5l1bHzVnFCuhjWCrzioo7wlgePjbdXIoNQZjp27+9QenwBJ5UnOTJFZ4eCSG8+eLRvY1OzQUiaMkwS/spWLXNC+z1JzdMJFQ==;31:2X4agZ9tlKy57n8Gh4vc+FEqo5miD/KAYWwolAoD8hQr2oR37k+RqDWCrkDH3c180Pl+0MJ5b/t7SAbsQhx0OtFp0sbhJ2XiCEwDz3eDpH+4R/nCBZVEfgFJrYpjJOKGBP0shUP7AWw2GpS9rW0GsoIY4vkO1nyyaqMXVRL9mXPCtwflvFFTMFVQDZqOTmwnYTKfhFG2/3mgm3XJAgw3ke+DEnNcB5nPnOHwJpWAyDU= X-MS-TrafficTypeDiagnostic: BLUPR0301MB1569: X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1569;20:4KLgtecgZOm4juYqRoKZMvByRtRgr6vAFMFzf6y7SFxU+u8BMb2bUuogZoysA20+wTMFG8alnULTzvLKm9b0cdROj0zYpXW1LUwtRMm6+pRNaRC6YKT6O0adVdogzCnA4CyMHjvcHyrLOoan3f0Eddy7n6eRwWUxmJM8zaHZsGoKDCwr8uoySp2wzgOFigDsR1VdKgF6j4Ssayae4VIW5KHuT5vaWvgvFpNeKj9V8VcIWjrD5nrJriGezLVGp6/sS3zE6onTWsdkNRvJGSNiweZzv4MDhYUwNGcl7zTckIfqdY5im5O7TvbTJf/w5COnCtvHMiquqqx9y9pNxWyMj07VRMnS4MSc9vjFHf5gAuJTMw6IszRpPLCmCjWT1ZQWP0omEFyslPy0MZIaerSnq8BVUykUbu10enaBbaAfO5prRWRzfIv7gq4gOVmO8Jk8PTuQ23r6mIOmKHuE4ck4h5du9WipKIgwbDBO7qmHunmduES+4z6MPusGM5OWGXw/;4:2ZIp2l37vLQAVdyjuJAGsf3Qy73HWCUphe5BnaUNggA8F0NSq5UdKd7ScHz9lvu0BijfvpvrU8IM0CqZrCSl6fZxUzx0kfEcimEJt3wkywcrXlFwS1tGALAmMFq4bQg7O7upNP4UmqyoGeX0KFsS9xrbnBcyFEopv/6fBNQS8PVAvC5guqn7tyLergrvT8p0J1HKUTrisE3Zas/Tg6FVlx584k6XUICX0OqHYUpbTrub2qqrRGhti22jwRhilnpV/TTn90/kq15bVT69do8AXQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:BLUPR0301MB1569;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB1569; X-Forefront-PRVS: 0749DC2CE6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(346002)(376002)(136003)(39850400004)(189003)(199004)(6666003)(11346002)(305945005)(316002)(26005)(50226002)(1076002)(47776003)(55016002)(6916009)(9686003)(53936002)(50466002)(8676002)(186003)(486006)(81156014)(16526019)(446003)(81166006)(72206003)(8936002)(230700001)(956004)(7736002)(476003)(68736007)(386003)(23726003)(66066001)(6116002)(106356001)(3846002)(105586002)(97736004)(229853002)(14444005)(478600001)(76176011)(52116002)(2906002)(7696005)(33896004)(6506007)(53546011)(25786009)(54906003)(4326008)(6246003)(86362001)(5660300001)(133343001)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0301MB1569;H:xhacker.debian;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0301MB1569;23:N+j7Q62RaPNw7bqzEZeizc686TpzHn89ikj2PGe?= =?us-ascii?Q?wZDYPhNZ79choaGwcSrPawkWzxmz4qanrxpHO0kQBWrOW1eGGJuW3Hst0vtI?= =?us-ascii?Q?E8Yu27RrJkoqOg5LLDvk9mEeUyj6SxkfQWF2Og0/fEpabe7bk78D0lM8PFBG?= =?us-ascii?Q?q7qad1GlYxmNTrQ5e5PspziwLAnN/c4qbndEWG6aQnxYN3i67DRnbfu3X/Vj?= =?us-ascii?Q?llmNTVjbJEqI5b5nfGT0TeTLT6kmITNdnGjR23vPo+0WzACQz0xD5uXNRZSV?= =?us-ascii?Q?c/LIOytF4AF0ZvXacUixZzsoaea7QKhFVLUKjch8D70dEf6mqLskCqAhhwfc?= =?us-ascii?Q?w/g1yAQx32S6toJj0IR5wfjfYVQv+E34TTGrsKvmR35BCsNIL3Bju2QF9fnG?= =?us-ascii?Q?1f0L3y+MHx9aU6NzxkMoUZMMeWcMA72n6Q6nCTKizm+Efxd9wuPRtQ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XnKGqY=;7:H9Ofo6lHmBuQT4xMjsrlkqeq3MmwZydJ8zbqIv+RgxVt9K9zM5ZZZqPZHPQSeAMUL4jexRQlOsa4F7u8DlrkBqcUBizqUMq9joaH+nqUMJzBDYTiVjZMxaepCb7Gr68X9M2JQ1A8vfewmNxYmNWI4GNx49KlLdyFDVHYXsw416Q3UpA/mCzOzQFVAeLI0hVkm6LSg/qo5A2eaSktunTSGS+oRpVdYbcqrlwTlFybEXwqUclew+0C2aYm4utqQ6dD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 03:02:15.6121 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e18babfe-5e2a-458d-e82a-08d5f5c8dbeb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0301MB1569 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Jul 2018 02:56:20 +0000 Matthew Leon wrote: > Hey Jisheng, Hi, > In LKML, we'd better not top post. > Shouldn't we be splitting until all DMA blocks are less than 128M boundary? > I am a noob, but I think we should be prepared for boundaries that when > split in two, will still be greater than 128M. Feel free to disagree but > please explain why I may be wrong. Thank-you. the limitation is "DMA addr can't span 128MB boundary" rather than "must be less than 128MB", they are different. And the max transfer size of one DMA desc is 64KB. thanks > > Sincerely, > Matthew Leon > > On Sun, Jul 29, 2018 at 10:46 PM, Jisheng Zhang > wrote: > > > When using DMA, if the DMA addr spans 128MB boundary, we have to split > > the DMA transfer into two so that each one doesn't exceed the boundary. > > > > Signed-off-by: Jisheng Zhang > > --- > > drivers/mmc/host/sdhci-of-dwcmshc.c | 43 +++++++++++++++++++++++++++++ > > 1 file changed, 43 insertions(+) > > > > diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c > > b/drivers/mmc/host/sdhci-of-dwcmshc.c > > index 1b7cd144fb01..e890fc8f5284 100644 > > --- a/drivers/mmc/host/sdhci-of-dwcmshc.c > > +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c > > @@ -8,21 +8,52 @@ > > */ > > > > #include > > +#include > > #include > > #include > > +#include > > > > #include "sdhci-pltfm.h" > > > > +#define BOUNDARY_OK(addr, len) \ > > + ((addr | (SZ_128M - 1)) == ((addr + len - 1) | (SZ_128M - 1))) > > + > > struct dwcmshc_priv { > > struct clk *bus_clk; > > }; > > > > +/* > > + * if DMA addr spans 128MB boundary, we split the DMA transfer into two > > + * so that the DMA transfer doesn't exceed the boundary. > > + */ > > +static unsigned int dwcmshc_adma_write_desc(struct sdhci_host *host, > > + void *desc, dma_addr_t addr, > > + int len, unsigned int cmd) > > +{ > > + int tmplen, offset; > > + > > + if (likely(!len || BOUNDARY_OK(addr, len))) > > + return _sdhci_adma_write_desc(host, desc, addr, len, cmd); > > + > > + offset = addr & (SZ_128M - 1); > > + tmplen = SZ_128M - offset; > > + _sdhci_adma_write_desc(host, desc, addr, tmplen, cmd); > > + > > + addr += tmplen; > > + len -= tmplen; > > + desc += host->desc_sz; > > + _sdhci_adma_write_desc(host, desc, addr, len, cmd); > > + > > + return host->desc_sz * 2; > > +} > > + > > static const struct sdhci_ops sdhci_dwcmshc_ops = { > > .set_clock = sdhci_set_clock, > > .set_bus_width = sdhci_set_bus_width, > > .set_uhs_signaling = sdhci_set_uhs_signaling, > > .get_max_clock = sdhci_pltfm_clk_get_max_clock, > > .reset = sdhci_reset, > > + .adma_write_desc = dwcmshc_adma_write_desc, > > }; > > > > static const struct sdhci_pltfm_data sdhci_dwcmshc_pdata = { > > @@ -36,12 +67,24 @@ static int dwcmshc_probe(struct platform_device *pdev) > > struct sdhci_host *host; > > struct dwcmshc_priv *priv; > > int err; > > + u32 extra; > > > > host = sdhci_pltfm_init(pdev, &sdhci_dwcmshc_pdata, > > sizeof(struct dwcmshc_priv)); > > if (IS_ERR(host)) > > return PTR_ERR(host); > > > > + /* > > + * The DMA descriptor table number is calculated as the maximum > > + * number of segments times 2, to allow for an alignment > > + * descriptor for each segment, plus 1 for a nop end descriptor, > > + * plus extra number for cross 128M boundary handling. > > + */ > > + extra = DIV_ROUND_UP(totalram_pages, SZ_128M / PAGE_SIZE); > > + if (extra > SDHCI_MAX_SEGS) > > + extra = SDHCI_MAX_SEGS; > > + host->adma_table_num = SDHCI_MAX_SEGS * 2 + 1 + extra; > > + > > pltfm_host = sdhci_priv(host); > > priv = sdhci_pltfm_priv(pltfm_host); > > > > -- > > 2.18.0 > > > >