From patchwork Thu Jul 26 07:10:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 10545325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E8ED112B for ; Thu, 26 Jul 2018 07:13:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBEA42AD71 for ; Thu, 26 Jul 2018 07:13:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF6032AD78; Thu, 26 Jul 2018 07:13:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8F9A12AD71 for ; Thu, 26 Jul 2018 07:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZcaPrGoV9sDKL8Q3CEiWPaTfycYi0Nn9k5wAYhsNW0g=; b=Y4oGs5VTQc+eVK uutEU/nq3DZkdd3VI0jefjlKa0e9SPB7u33OhSGmXx7s1Td/yo4OZCvm5sxKPte/k2+fCsAXkGDP/ g5WP3kq/eYgcZVhjxZAK4b6nAXlgense0a9XCmafqd88Xyh/je//xOgoMzyYdJbbvDyKrdYet7S5O yatMvYgcXSMwYA91leXNcgOYFICHlolf76kzHgKiE31UKnxmpPezYGz2yyRFeYbqQSvnHNoWDG7TD A8wr+lgWjMMDpZzqS9I6W8SOMXOtKRXjmfNqV7eBKR8GizAXyEW8V3g6PjoWBLcImbe14qrM8lw87 iI817Z+cavXZKmDg10/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiaSP-0007sC-UA; Thu, 26 Jul 2018 07:13:05 +0000 Received: from mail-sn1nam02on0041.outbound.protection.outlook.com ([104.47.36.41] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiaSN-0007rL-AB for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2018 07:13:04 +0000 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=2EWOMrdTDbe4cRpWZDbzRTm7CRntqQXOyUE8yJ16jKg=; b=h3o8OVjReyB9249hgURhr+Gk8y3/m82yjcChyVDIGiGvGgyzR73zRKXK0DqKzCHM3n5Kl/lL4dwrMtD8f89SzCyDY8RPnwUFCsb518HI4koHsaZ3MBPaZypCrMmLR8M7ypD8LAanQ5mHaZIRmc7g4om1wFMZ4meA3MRsKemwInQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by BY2PR0301MB1576.namprd03.prod.outlook.com (2a01:111:e400:526e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Thu, 26 Jul 2018 07:12:48 +0000 Date: Thu, 26 Jul 2018 15:10:17 +0800 From: Jisheng Zhang To: Adrian Hunter , Ulf Hansson Subject: [PATCH mmc-next v2 0/3] solve SDHCI DWC MSHC 128MB DMA boundary limitation Message-ID: <20180726151017.4da1e336@xhacker.debian> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: TYAPR01CA0164.jpnprd01.prod.outlook.com (2603:1096:404:7e::32) To BY2PR0301MB1576.namprd03.prod.outlook.com (2a01:111:e400:526e::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15777732-ab34-4f78-77a1-08d5f2c732a9 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(2017052603328)(7153060)(7193020); SRVR:BY2PR0301MB1576; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1576; 3:OVB5oH7NRY1kIFOv3dY4SLkGaVfvfp+O0hMf7hul1IwM49VuyJVMp5CiDJr51M/ZOyqNx7KBXI1H3NBUgMc6H9qmnMflbbRCpDJIDIxnp0JroLGYtuF4Y3nHncoWPo4qEpzmnniKaLVYWnSGrMm7Bed1xvOwu6ok71BIlfpfUA2eUfEhKlIyJN6ctG7bmnPhwQa+CoFXQEbgGu/0vbjV7IP2MzutYgpZpey++Wo/FJqGYbXHk7oUzim1cNHdVmkD; 25:9ZzcAIKa+7kbakdmp88ugRsFndMkOBP7NEWUY+xiMQlFtkVK9+OuyV1FcrnD4B/L+W/nuWfik1lWIRSfs2RrqBBBqtLDWHGiPdjxHYcYt0BcO1G/bUtYpiG91cNyULxEz4GmfCnqlcCHnP2l8dR8+ugeo6EWynoKnTfUC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Ff+5wePM985/wGwc25nTybOAvEncXzc7/2eokz32imuJTSttGKvwQrN+7CUgWqIQAKXfINCxa36+couokiU4ut1TewhcY8i6Uzv7iRlcO1HL6ZhsUlmkt2BySygyiID4P5W3A6P3b3eiITXqDEW12jNs7ReRkEfBIBKb89gfazWrMdDUGzEiwZdsaZW0QXuzOUmQ== 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:BY2PR0301MB1576; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB1576; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(366004)(346002)(136003)(376002)(199004)(189003)(2906002)(217873002)(8936002)(97736004)(50466002)(105586002)(53936002)(106356001)(86362001)(110136005)(81156014)(47776003)(305945005)(956004)(8676002)(6666003)(81166006)(7736002)(5660300001)(66066001)(1076002)(68736007)(55016002)(3846002)(25786009)(50226002)(230700001)(23726003)(4326008)(9686003)(33896004)(72206003)(26005)(6116002)(6506007)(386003)(14444005)(478600001)(476003)(316002)(486006)(16526019)(7696005)(186003)(52116002)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1576; H:xhacker.debian; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1576; 23:A4SuhaLlb4svuTiszatFF9oEz3Iu3lv9BbvEg9O?= pp+JBWJZX8nbTiCOEW6XJn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3NgnPFOHIO4KXO0wACFsxCpwRK1s6ZQfnD9hUrJlyNcrL+dMYfcVz8PHXYenUy53RSzJ14=; 7:NCOqXuh2T4YrBZxqZlVxX8nU1lSR+mZKWHt8maRnmZjycF6iA3cYj1HwM8Q/BztHFen8ADY/BrDgKX2CgEBSrdWncgAdcTGR19r8/7PSZ0QQQnWWOkWy9kA4FZRfkAbHXah6rVfXKisfo8LjNvs6c1s8eZMX5HR+SlPLGziHPZJVkQuavxPrWbiq8fRl0YI/kp8UE29UyLcMSfBSV6nJX7+fHAruhLvUSa4OFZ8vgaKZjtsrBGzlwLF74hz52oa9 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 07:12:48.9860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15777732-ab34-4f78-77a1-08d5f2c732a9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB1576 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180726_001303_543443_C17D264C X-CRM114-Status: UNSURE ( 6.11 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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 | 42 +++++++++++++++++++++++++ drivers/mmc/host/sdhci.c | 48 +++++++++++++++++++---------- drivers/mmc/host/sdhci.h | 8 +++++ 3 files changed, 82 insertions(+), 16 deletions(-)