Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1514474imm; Wed, 8 Aug 2018 19:31:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyO+gmwbiZj2G68BgB7XG/6jBlArgab1ZMQvGMo/Dwy5kdxuXcp/hz22i40UnGnEmjZzLgP X-Received: by 2002:a65:4587:: with SMTP id o7-v6mr230944pgq.317.1533781902244; Wed, 08 Aug 2018 19:31:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533781902; cv=none; d=google.com; s=arc-20160816; b=iUAaJVeYkUlak2I3m1XFpTHYhLXQ+urEHyUQ+ecngeyrJNYyQaGXEVFb1pMLGqLU32 8RBQMFrgao1CBXAZ2/5iOaWeRsDMJdeC8Pdvr7vSOl+Wx8Q7YAHLsjFoNPGxcP7+JjsF Sg7lGUwXgkaEEQ9ltc+8G55pA67VXH11PhZp5gUIoGvSlaLeUWLooBGXBWhiqKqjMhyF JLr7BmvY/tlkYt/vlfT2Lyy4EbmtYHIJsJC9bHfWVdABly7TntRK6fST93jsFSF5KYzp XWBmtJ0j0Z8P64QkLed/fDCXS1AoFzE44fvhPw8wD0X45uI5ftHx3Q49IF1n0KHUQtsL lweQ== 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=Skpc6a+ZBvHSTVFtrzB4Mbf3KftALJPhSRmd5YnY8bQ=; b=TR1aMGsdQzgI4e48b3akxXhAFQRbYoLNO2/0L9CyesLcOEN/iSTH4jav9RXY3BD9ZI 8c8sZRqmWqZiEMycnkxhaQoq3QqT1kRT5osSANOilrjPf0SIrofcNrOWJGkWE2zm2MXm UAWxetqRhpn2ZQEo0WYcU23AsD31CJNMlgjHKp05/3TRs3lcPUz4gErMcaNrMc05WRMC oA2Weqwr+tccPhklr9Q6J+vvOT+mlWaCNVOkX9OS+kye5cY728tRIcbweQuGYMVF47oc DPLsxa4FR77snGMufwvJUyotYTiAoBSi4n8TJlxLYuOrnKDDR+TLR6y/LpcMItL7P/KC llsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=fTmm+udA; 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 q12-v6si5838349pgg.532.2018.08.08.19.31.27; Wed, 08 Aug 2018 19:31:42 -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=fTmm+udA; 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 S1727375AbeHIExG (ORCPT + 99 others); Thu, 9 Aug 2018 00:53:06 -0400 Received: from mail-eopbgr690051.outbound.protection.outlook.com ([40.107.69.51]:36420 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725878AbeHIExG (ORCPT ); Thu, 9 Aug 2018 00:53:06 -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=Skpc6a+ZBvHSTVFtrzB4Mbf3KftALJPhSRmd5YnY8bQ=; b=fTmm+udAMZI8LDgYLKSPij0sG7TWEsSQinW9huttcVnjuQrT6DPEutvzr2WMC3u+m3FV+5AczlvyEN7QjN/tbBoqdzOIntYfIHPjuKNgPZ562neCYMscN3IeXCdXHosb8IV0RcENcDaYxQ/pqUHQJVloa7XosVQ42cnv7SSj0H4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by BLUPR0301MB1571.namprd03.prod.outlook.com (2a01:111:e400:52a9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.22; Thu, 9 Aug 2018 02:30:33 +0000 Date: Thu, 9 Aug 2018 10:27:59 +0800 From: Jisheng Zhang To: Adrian Hunter , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH mmc-next v3 0/3] solve SDHCI DWC MSHC 128MB DMA boundary limitation Message-ID: <20180809102759.191d211e@xhacker.debian> In-Reply-To: <20180730104228.28b58bd0@xhacker.debian> References: <20180730104228.28b58bd0@xhacker.debian> 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: TYAPR01CA0119.jpnprd01.prod.outlook.com (2603:1096:404:2a::35) To BLUPR0301MB1571.namprd03.prod.outlook.com (2a01:111:e400:52a9::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 620b0aed-1034-4a84-ff1b-08d5fda0160c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BLUPR0301MB1571; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1571;3:1j0vnUDXRtW9ZrgSxFuB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QvwGXnuocfsl/N4J3d/qePsdjlrlJKl7BcVdbsan9f8SgKtczFHvEQdZQyp24jFSQJnnmX/CLRwmVDXCYLInb6C9bgxjgjyt5ta1GhVmp3BQg0xpQjt0j5Ee+OYSgRyqhxneqGOenVZ5vf9fa21dHK88EsyeRozDvSWQjQOyUSWq73yDsqFfIFhCmyurtIaX4fFzag1NgJovjd+X7jvFMnK19PT8UpyF1+eehNHUX8O68tbFnJjllCvqU6zElTzkhWxCK3rlHTXQKYNzNOZg/TstgVQRK7A/CSuLOSWN+pyLTMoXJjHIWBFaLM7hB7+/N2YhmGbi;4:E6eolSY4f6NiRJ9JB5X+JqU+DORk6IrpU32C6WyNEOXm7HcaeF1IZXUEcWTngnK5ux3KorwtL1rQwAQC0h/g5TfKTANyFLATrTrRbldxaKFhN/56XoqYR0Y64d+rKECj69L4BFYwhiWBp/HeP1nocVsskZv3ijt3jtyv0v9daqSqGyksNP+sfxJYpzJJZJ+SKrE2wa1rxG8UEl+kuDVbW5Is8q6V4U0SBe7DhfVrj+PEtq4wLoByr+HLeDopKCpoSGrXVFhmBFj0091jW4/waA== 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)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:BLUPR0301MB1571;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB1571; X-Forefront-PRVS: 0759F7A50A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(39860400002)(396003)(136003)(346002)(376002)(189003)(199004)(51874003)(76176011)(5660300001)(7696005)(52116002)(33896004)(14444005)(50466002)(6666003)(47776003)(53936002)(68736007)(50226002)(476003)(446003)(11346002)(26005)(55016002)(386003)(72206003)(6506007)(66066001)(8936002)(217873002)(110136005)(316002)(486006)(9686003)(956004)(478600001)(8676002)(23726003)(229853002)(4326008)(97736004)(25786009)(81166006)(230700001)(81156014)(106356001)(305945005)(7736002)(105586002)(186003)(16526019)(3846002)(1076002)(6116002)(6246003)(2906002)(86362001)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0301MB1571;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;BLUPR0301MB1571;23:MrNJ3c2YjxmlnUu6389PQsKDS/nfEzREc3ajpwi?= =?us-ascii?Q?o9bHRs0Q96LVPe6kmZfjc4ySfZ6IE/ikBDKgIu3agFiRRkj7DvwY2vCKp7pg?= =?us-ascii?Q?ezSVFDTbP6AmZiOKKesgMaWKwYRJgkBjnMeV341oUAeiSkBAtuxwHt9ETC+y?= =?us-ascii?Q?FA9IjWm8HETiXlQ6JKbTL5vxwgwrcj1ZRp5ZoEXzHgDBvjvqzNjhxaAD5UmU?= =?us-ascii?Q?8FjGayar7aLqQpxnvWmfOkcaVL+HQ6RrOREoOHmfiOsOPKwYb33/7Ui+2per?= =?us-ascii?Q?3/lT6/+7DBzdkj/AIiEdarITtEoGpW8ufj8mueR0gnoUi6elBiqzv5sJ+3qy?= =?us-ascii?Q?8lNAKCseQr6Zm49q6e4+S08m6u4Ru6OY9OC03ez0a5ux8lqqfiLnctJsmbrq?= =?us-ascii?Q?qx4Dq8K6pMhzbGhSNwMr0i3ikj9FOH3nM0wua/Mmxkfhfil0RIu9KdP4Cfl/?= =?us-ascii?Q?tBVHS7NvEYyzJrEvYKuFuvWI1NQq7eq691YfHQW0q0OHvicGzSTWschIEXU5?= =?us-ascii?Q?DwSJlzQvxSZSekCxS63ClI9nfCBza8jrBR8w8pjPL9D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QgItZ/hKgDpr+HRGFf8TDF/m8rzRKqXglrDWxRI625/prJX0MqndY8QzE6pYyHwbSf21mGQJz8ZVMfayR1BtbkSTJ4BMawUwI/Zo1YzBsfDTPbQpsQvYWIKHTR5LlWBF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2018 02:30:33.3243 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 620b0aed-1034-4a84-ff1b-08d5fda0160c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0301MB1571 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Adrian, Ulf, could you please review these patches? Any comments are welcome. Thanks in advance, Jisheng On Mon, 30 Jul 2018 10:42:28 +0800 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. > > patch1 adds adma_table_num to struct sdhci_host so that driver can > control the ADMA table number. > patch2 introduces adma_write_desc() hook to struct sdhci_ops so that > driver can override it. > patch3 finally solves the 128MB boundary limitation. > > since v2: > - make use of "likely" to check (!len || BOUNDARY_OK(addr, len)) > - explictly include for SZ_128M > > since v1: > - fix BOUNDARY_OK macro if addr+len is aligned to 128MB > - use DIV_ROUND_UP to cal extra desc num > - fix !len for dwcmshc_adma_write_desc() > > Jisheng Zhang (3): > mmc: sdhci: add adma_table_num member to struct sdhci_host > mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops > mmc: sdhci-of-dwcmshc: solve 128MB DMA boundary limitation > > drivers/mmc/host/sdhci-of-dwcmshc.c | 43 ++++++++++++++++++++++++++ > drivers/mmc/host/sdhci.c | 48 +++++++++++++++++++---------- > drivers/mmc/host/sdhci.h | 8 +++++ > 3 files changed, 83 insertions(+), 16 deletions(-) >