Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3457833imm; Sun, 29 Jul 2018 19:46:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdQZDeUFn1G8i227nxmri/KOlnmwAy44XeyUvqf7ZqHmEZv4e4jHE/rmRR3WXxbj9PkI86g X-Received: by 2002:a17:902:7e43:: with SMTP id a3-v6mr14676081pln.151.1532918813082; Sun, 29 Jul 2018 19:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532918813; cv=none; d=google.com; s=arc-20160816; b=vFtBTJo4DhxYU+rN2xeFEiE0wfTha+xGXIiSrFDeNBAsAyuYvQCWBmOMtTajpv2aIj nrWyFanXCyOwKRJSC8w52t3LkJD0XtcbugXd100+8mj8GS1xmhrJPtX7CPMhZiT4MINt h4keFwH+2/HfMJ0Wvd9EGgerAZO3HI2RC4xBKBV/Hl7QZ/9eMX96ueVnpxaa0E07Mh7j j6MpGIfKG82F3fhdLtYDDIdeRmLNruakkFkV7eHi5gd8Xl95qYcgCv0aC74hXYroDNeZ BzEgce0L9PX7fiiQQ2szKgIeuNshjuF1mcmZE1t5Llpbk8xGbmHYjLcL+YDFJ4DDApBx 94QA== 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 :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Ag0sO7GhFanVPdPoiiE8JctHsWhlnU6zp5wE/Nd4VVI=; b=0ytTWDkhvkNf5kf0pWUb8jOPS3zV1nr0oQA4nEGA2n/RIGgzhO23CM0lJosN0FafHq YCcN/slzA63ICEgUhq2u30cqmADvJ0hOm5a/tIBJlPCAtkRDcfJHmfJZcR4Y6M9IpzUv MYERvEgijp+UUiMyZoKASwBBVPuHGGRu6dG+4LYjtUHcoSolNUjcY9WDJeWrWWTQp/pY mIAK4J3K+7w1znYposIhNeO5Q1D5RTMK1FrdGC9XEd5UauGu6VaacNNUx4GCw276IR8M Af7cICn2kszjfozSN83LHqYOcAy9FSVlwJgHQOSH7yWTZz9f4Lt/x3njKT/EqP4ispau CQ3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=xRj+sWg7; 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 z4-v6si9977279pge.173.2018.07.29.19.46.25; Sun, 29 Jul 2018 19:46:53 -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=xRj+sWg7; 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 S1725874AbeG3ERu (ORCPT + 99 others); Mon, 30 Jul 2018 00:17:50 -0400 Received: from mail-cys01nam02on0087.outbound.protection.outlook.com ([104.47.37.87]:41782 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725748AbeG3ERt (ORCPT ); Mon, 30 Jul 2018 00:17:49 -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=Ag0sO7GhFanVPdPoiiE8JctHsWhlnU6zp5wE/Nd4VVI=; b=xRj+sWg7fJTEyS2oRI7oh5qUbAwvkzLduatSiq56hH+UnRa1vRvjCOhiUK4bhX6Cz1KkKXwEdEbwUFzVgz30QYi9ejp4VeamW2iQhALbguUMaYhUTIbVSFsQFuNqQNor100xRDvsOAPmAYhO3ggI7QRhUcr4gge+sS8Nv22Zhq8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by BLUPR0301MB1570.namprd03.prod.outlook.com (2a01:111:e400:52a9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Mon, 30 Jul 2018 02:44:58 +0000 Date: Mon, 30 Jul 2018 10:42:28 +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: [PATCH mmc-next v3 0/3] solve SDHCI DWC MSHC 128MB DMA boundary limitation Message-ID: <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: HK0PR04CA0019.apcprd04.prod.outlook.com (2603:1096:203:36::31) To BLUPR0301MB1570.namprd03.prod.outlook.com (2a01:111:e400:52a9::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73c60931-f0fd-4d40-62c7-08d5f5c67159 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BLUPR0301MB1570; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1570;3:TlvbDBqh2qqJtYRyYL6T6RDKBjLCvpZ9n8gEdiAevABROnixFtwUZQTaO07x951+/eUkYCYJ5S4mJNfE2aMFT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u9G3UbAWgoWVxC7sBjNBPs9kWJqva1KEWUOeaWA4PcuajXpYFpkomjIHXvkSnGh78oI5Vr22feEDNNhuRcj3i1iiJ7IAek7JpzFFwEZ/PL1er9alz8uHKSMmWt312YSa6UO/1R+OY0MKm/tPvZWYKE7O6QZn3e5dEnmJchdugqhOeCQk2jS0muRKZhcNnVvF4U36mJ4Pxqnjq6aafDXo1oU+hocpn/Ys8/4/tj7V1T/WS3hXDrQb/GORpnpIai0vcSS0WW9XJnI;4:40wxViXlumjTbVZ650mMWAqKbs+PncoZWl5caHTOQJokL+wdrw8Mi4cFcJMNDCjwiGnT6S+uFtkLVZBsztJilA2IgdLE+Ig3se68HZsi4jNWJsYHAGfDCZyg0zGP4J0xyAIAgfNviAVtBEuGg9uHJyOWeYmv50jDYvfCWsZWgBPd99f0QVuEuosUAPJRKd6Yyb1aXuGLCGzo90NN8ecjNmU1WHqbx0oABVUm2EZOPGWEJt/fhR+ozHZzYaztZ2QVp5JG0lOr5991bmocI+fXtw== 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)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:BLUPR0301MB1570;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB1570; X-Forefront-PRVS: 0749DC2CE6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(376002)(136003)(39850400004)(366004)(396003)(199004)(189003)(50226002)(8936002)(105586002)(66066001)(106356001)(4326008)(47776003)(478600001)(86362001)(25786009)(72206003)(2906002)(7696005)(52116002)(6116002)(6506007)(386003)(110136005)(9686003)(1076002)(97736004)(50466002)(5660300001)(230700001)(217873002)(23726003)(6666003)(3846002)(14444005)(476003)(486006)(68736007)(956004)(316002)(26005)(81166006)(81156014)(55016002)(16526019)(186003)(8676002)(7736002)(53936002)(33896004)(305945005)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0301MB1570;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;BLUPR0301MB1570;23:1/TS0SelPztvxyXQe+0xdwReMGUiUOzSXe/n5sa?= =?us-ascii?Q?mSn7wKQiY6KQ9xv4I7M0uWndrs//5C37fOA6XlABM8DUFFocMcP9SVgQ26AL?= =?us-ascii?Q?8VCXsXw6bLG818AEPtwu94oLDsyjBM0nItD7B0QqK3RSdbT3jskhUejcL4Hd?= =?us-ascii?Q?jNfOyKuqMLWRYDSX3L2MOUcBpuSBiOkvywCNTfT+QnwqILxqAy2kltjEVujY?= =?us-ascii?Q?YVQsqO3V0C9fDG9cTdSyRTGSQOT7Tgu/yBekY3SFL/LBHch1SXUlq34VzQu7?= =?us-ascii?Q?KL/qcQIfr6SYOdnyIgsLk3BiA2IzzJQ1TsexVi7j2VGKQ2ukY3poucIeCL7r?= =?us-ascii?Q?11TY/U+h+vQ6Li2UKaufvUbalsdLxARRZlu2VsS4tOCPU9P3Yokb+etKKMWD?= =?us-ascii?Q?psaIvHHFieOpqVZyxJAgY51f3nH4LaV6EJVoRKQi4FkXuYcRmEnxmvuIEJmX?= =?us-ascii?Q?kt+Gj9KjMkE3t0bDlsVWoLro5G4/Khy38vWqf4CicSJSDF2jc0KFrofkXMgO?= =?us-ascii?Q?FnEy7kufWxpINOBVaktxdgYkym1cPU5/yQWxgze1Zs63UCdErNfiLQ1UoPzv?= =?us-ascii?Q?s/yUkmn6hcevk6797xFec1wfnweKuKciSzIH/LNGEaxgaIYQMlbOYcfJa72b?= =?us-ascii?Q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IqEpSsbZvWkWIVO81pxqEB5S0= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1570;6:htfZTpBLv1CdaUxhPoLbCITVDMgjyt/ucd0cFCdIyQIjwADK5Zqt/Ea9mTBV+BbgMrzZSNNsS+ymN6MCmZlO86Xe9CDYo6JKvpkS9cBsTK7HgYT0bzFED/a3HjefllZetL5tq9dOJLWwft5Eg6qFe3NT7B5isEGVzgBYCndWhQk8jux3cEwVsoFIz52PZ++f2/ymAtFNoLMTtsaFaruwIjATv6BNNzlx4x6gyhgHugLa6FG6SERN541CLS9q+rkCAhlrXPTKXAMgOF8OxxrwXe0JlcEYCjK25+UVdoSdk23p+SgXpWA8eqZ67IdY9zF0k7wusj2q99us4218vcOwa/PYzgoFtBrrCvwn3H9cnXRBfUf0Xe+9KoMRB3XT+vy9uyiSO2WTr5/Jkz1zvWW7HQOkP/pdqqUohrVgVsl8HFbeZ5euG30L/wIahIqghDGu0f6nqgw4BTw1ob0KzpwRHA==;5:ZKhdtSutW/0XZBdux5dmq15071GnH/eNJ9pHYFFZMkSlI9CHhbKrAEjOQFmsBLFPcry04t5dQ7eLmVrN5huawyp+jNUD+rKdJal1rL9MnQ8RMp9wQNI8PnH6NVbuKBbnSC56XfeZivGRjvhkZuUMkE/C32IWUxOF3LyHeiTWviE=;7:ohRvfS7CxX7LE8/OBWPEwuQsDPvHk4stcKas7SdY/wkfOqsDRG2NDUBGnIxzyhsyxSWHdNRlvD2tFcLPWYA5Edy/VqmUizqx4+tCcjekgyDayeMhQklF9yQBQtEnIP6nguWG5eaOl87/lC0RVu3x11ZwVVYOw2fB07ONLLarzhxQ+ab6CbjOQaZi/uvnotuNr6HfmVb/vXZplrh9tGIVn7RcgJCFyZQUUWUt6UaSDmFyxcwMAPydXJaD4WBTg4p0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 02:44:58.0711 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 73c60931-f0fd-4d40-62c7-08d5f5c67159 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0301MB1570 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.18.0