From patchwork Wed Jul 25 09:44:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 10543775 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 40B881805 for ; Wed, 25 Jul 2018 09:47:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EA4129AD6 for ; Wed, 25 Jul 2018 09:47:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22F3F29B0F; Wed, 25 Jul 2018 09:47:22 +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=unavailable 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 BC34629AD6 for ; Wed, 25 Jul 2018 09:47:21 +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:References:In-Reply-To: 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: List-Owner; bh=GeqyRhVwuogORtdJzo/d/mfH/iGi9TNNIQ3hOphGqJY=; b=UD1MG4YPdef6/H yRZI1n2ZYbTTGyhYBDBZgDoYyCxv2sevri/A05IES+ZY8CMRI0pO0Tpl/j0Co4C6Qy5SetWJ90/bu yhv7gIiVvuTkbjZvPfDk81/Iet84LxeAUOLny85poZSw4khWPXH5gUIdr2KyiXmSX7KQ9uAntQ24y CiWCQTH/oAa/Ou6x3LLyoXQ0z5e4hPd2zkK6uPVg9l+yaSGw8U1EpFPebZmLu2S2me0azzg2WnWaK RDD3xD/uml4chALvEX154ByjqNNR9zLLC2ZQpCdA3B4FA4IIAzlO3ff7GTgLx2HZb6s1ElkiM3DQ7 UKn9setopewJZ09tW6KA==; 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 1fiGO0-0001yj-CB; Wed, 25 Jul 2018 09:47:12 +0000 Received: from mail-bn3nam04on061d.outbound.protection.outlook.com ([2a01:111:f400:fe4e::61d] helo=NAM04-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiGNw-0001xD-Nv for linux-arm-kernel@lists.infradead.org; Wed, 25 Jul 2018 09:47:10 +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=oBNdgngxV6F5slvk6l8KUn4Gw+nIUof/U1bct/+gEzA=; b=p2XdC4YrqSl5GmLZFxLH/x2LWmQjEQtxHtviB0BsPaM7hd/DXlI+r7C+rLlQlvbRJPJY6wImJsgDhZDo2Fm8Nao2iUP14up50xBFQzsInoZ29v2GQs44SgOiSbZ4coXwSnOJ5NRoihATqs1iFo0KyLQVCMsZ8YTPjxiIAbVLL1k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by BY2PR0301MB1574.namprd03.prod.outlook.com (2a01:111:e400:526e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 09:46:52 +0000 Date: Wed, 25 Jul 2018 17:44:37 +0800 From: Jisheng Zhang To: Adrian Hunter , Ulf Hansson Subject: [PATCH mmc-next 1/3] mmc: sdhci: add adma_table_num member to struct sdhci_host Message-ID: <20180725174437.64e888a9@xhacker.debian> In-Reply-To: <20180725174235.1ca764cf@xhacker.debian> References: <20180725174235.1ca764cf@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: TY2PR06CA0015.apcprd06.prod.outlook.com (2603:1096:404:42::27) To BY2PR0301MB1574.namprd03.prod.outlook.com (2a01:111:e400:526e::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 994cd71e-74a4-4993-6478-08d5f2138d70 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(2017052603328)(7153060)(7193020); SRVR:BY2PR0301MB1574; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1574; 3:DZaNYVBpuwHWmj1qyggoofzvY3LFUPW38YQ0C3uA+9AsYTQGtfJURLqjPCKJ/BnfkOahKctmoJsLXNNGHENswDJAHH2hwpYDkaU0Sb/U0+UgR0KZLG/H0DtQP0Rt+og59wuCO8TRqz57hJR/tJLb8AQlcvzPpd0Q7Rw7x6cHKVWUGD5AoeWePq4nmQbxf6JfyuVwYjldCHvRCQMI3crBfxyYEyEsYMrgmxd9clYn4B1oMqIA0rv79Bihf3b+aPId; 25:c7gIskuMkW8CFsRWJPUUOjvAxGOuGJs0u6l2vgofYqqIekHqf75i9XGmZdMjk2EFMMRRLXfxkgmfP8rz1/B0xUiS/H5L+9FhfDgmrwPrOgY6hQo/eA6MaZfi1XBvH1oCMhJrPTPKWvnM9Em04oNcXRy6QtTmUKRBep8cX22X7NTa6WxuJ4PXROFNeljQimqhYW91ee/6rUe/Q7aaJy3CozXmcnmPUilvHZpTnSPURdizkZgxGzxxxLLyNdO7dCw3hi9Guy+O0aN1QRFKbXQh60HVOfVihvs4Z1aylK0gRtdk3/0HziLPXQl9RJMtx56HmIfbZ5cgzLkjXyvcOSr5cQ==; 31:uyLJ4KNw4BnLESKlIMKExF9AwsR5biTAEiUHB2fW31StAYXwR0Pemgszl92kuoCN+tHIwDX0OOBsNwGYGZariiq+ZxojFH/KFgRf9KaBGDH2Sa9lAG1r7k15cRltvAf2tdV4ay4DG4jOW+nHI7wPOtZ2YVBd+0sZwsLtrxWlFMqFaDMHPqVAkdANxsevk+/McBMFGnj/s/DplEdwPiS+rVRjB0chgksYILzcu323WEA= X-MS-TrafficTypeDiagnostic: BY2PR0301MB1574: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1574; 20:vfdYzV0/XD59UY2lS3DExAo02Ygo7fDZNt8wANwbVKAtn3cOsh3mrG/4hYQymzJHql0fg1HxiVNNrng6WxgsxzoYirDPBlyfnF794dj2zUkdPcuN90tCw7j70RQT1b+ypO/pkoqswlvzrJ5NycBh1W8ER27xwVO15AGp5BS0DpGIPMBm7POgQ4aeCMv1KPdprzZ+YgmAdTBSGWYXFLWr10z7OmfooOGgzxVqgkZtrktIbYlyrkewv0EzN83UHkfcvEw/6jTylcXRCaRRzMFpd6tsLwoVPXPe7VIfgIi7entjA1Y23jcar4z7X/mr6yLz0m87McfocDoW+tLx0c3iKIqUmSssdSaJNAwd2dQ0dJaSUjO10bRE4kOK4jmeFYzOAa5poEcY3fzDsSCnDOzQS103Pj5VCWLkfvnCohcn6I7/zyozL0mrzObIbkv7HDmFP5cpfHACGWmISh0Tjxt4379Dy/JkrnVY74IBpSVJMMhADood17jIj2iI8wRrHEOr; 4:eZw3Fh7vi65xbFoW7+HEu42tGmfzJBCSIBE/85ga+HaEzZbF4PYoKS9n9w8FukSJKUbvv6t0jhKWNqv6Pn1yHbbi94gilcEG2P86WUcXC8r6qbfh1FDW1Uef7CmWeH1O+q/aZvQ+fqCqTijkT5W635yqeTvHThOq0qo3RTERfNNu8mYsHWTbKD7fOw9xpUV/pVQAegm8fpxXvz6f+cuSyyCXHcbemP0CaQVsDA7rgjvhM8a5oQrHzn+Yo+v4RitOqs1JXxWgkiEIzsNQjYvJ6Q== 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)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:BY2PR0301MB1574; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB1574; X-Forefront-PRVS: 0744CFB5E8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(136003)(39860400002)(376002)(396003)(199004)(189003)(6116002)(52116002)(72206003)(230700001)(25786009)(106356001)(5660300001)(478600001)(53936002)(4326008)(68736007)(305945005)(6666003)(105586002)(7736002)(76176011)(7696005)(66066001)(6506007)(47776003)(55016002)(26005)(186003)(16526019)(2906002)(33896004)(81166006)(8676002)(8936002)(81156014)(86362001)(3846002)(486006)(446003)(97736004)(50226002)(50466002)(956004)(11346002)(9686003)(1076002)(23726003)(476003)(386003)(110136005)(316002)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1574; 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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xBq5EmbDdfmMiFAtSgdippbcNn2cKq0ePq4+6QZB/QihwPrfDYew4txSzx1ELQlKWAeqgjBR+azMTe6WOYaeuZMAAIBMdeJb2fJPgJQuDzyfdMuLH7zDX6mwDejo4IVqoZTVlcwliWJt18IyBWss/jJlii5BE+6OLc=; 7:Uj8laCsjevaqlSgqUShUt338JSx8XkC5CrzCdO6S15OZqV8MU6F+dPgs/Oc3f67i3RNXHfDHhhXQLyQvmvOPoCqvdXwlOxEqjQySzwiPDy7C0CRpIdzk2Tr3dZpqF1DbnyAWg2ZBEPcLuS+ZJUFbdp5jxr4QjkaQ8Ey/77eS7DQGSWiFJZRVflfHkwHeq8YsoBWUX2RVuH7Q+sEVbixZUGx8Jemyrd8IBt48282qFHEhuwoAoWnTF7OmKZPmmuKl SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 09:46:52.0555 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 994cd71e-74a4-4993-6478-08d5f2138d70 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB1574 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180725_024708_926731_EDC3083D X-CRM114-Status: GOOD ( 10.90 ) 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 This patch adds adma_table_num member to struct sdhci_host to give more flexibility to drivers to control the ADMA table number. Default value of adma_table_num is set to (SDHCI_MAX_SEGS * 2 + 1). Signed-off-by: Jisheng Zhang --- drivers/mmc/host/sdhci.c | 17 +++++++++-------- drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a7b5602ef6f7..14dd4a49e03b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3316,6 +3316,13 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev, host->sdma_boundary = SDHCI_DEFAULT_BOUNDARY_ARG; + /* + * 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. + */ + host->adma_table_num = SDHCI_MAX_SEGS * 2 + 1; + return host; } @@ -3561,18 +3568,12 @@ int sdhci_setup_host(struct sdhci_host *host) dma_addr_t dma; void *buf; - /* - * The DMA descriptor table size 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, - * all multipled by the descriptor size. - */ if (host->flags & SDHCI_USE_64_BIT_DMA) { - host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) * + host->adma_table_sz = host->adma_table_num * SDHCI_ADMA2_64_DESC_SZ; host->desc_sz = SDHCI_ADMA2_64_DESC_SZ; } else { - host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) * + host->adma_table_sz = host->adma_table_num * SDHCI_ADMA2_32_DESC_SZ; host->desc_sz = SDHCI_ADMA2_32_DESC_SZ; } diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 23966f887da6..d55fd7033e93 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -563,6 +563,8 @@ struct sdhci_host { /* Host SDMA buffer boundary. */ u32 sdma_boundary; + u32 adma_table_num; + u64 data_timeout; unsigned long private[0] ____cacheline_aligned;