Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp131195imm; Thu, 26 Jul 2018 00:16:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcg58X7GOBGoFbaooWkKe1g+1fkKEAQ32hl8s1MXHeQl6uXQG7aBw6P27heFfMCObOf7TXr X-Received: by 2002:a17:902:7b97:: with SMTP id w23-v6mr886661pll.66.1532589363941; Thu, 26 Jul 2018 00:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532589363; cv=none; d=google.com; s=arc-20160816; b=s2mu1JsYOMkyAYwyvcucRITiG0x60JqvUm+l5acGMUD6mrbkCuSWJlpVMLU+an4FH3 iWyXE9kd6y3fhlrRIxpTgrr4dyhJ1GH9KZ+mKci0JswjLu7xjpm5CXzZ6kIGaIM1PeQD wTDAEwqhg3tcDSR8EAwQenWcEbJd1SNybA6pEIY5EMlP0ElVjdC9sN2wxI0fyNbOr8lJ u8X9oInr0ie/XU95hHwekUV4y3Fst0BlxHxgommBL+oR9oqq47/u4sO1oVAuQkL/bz2E k8J3KSphXMNEOCrXgBo+MdaG6Dz9RNSIpOcMguLPe/BeTTWHx8nuOXpG2NEJjcqG5l4a xTZA== 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=oBNdgngxV6F5slvk6l8KUn4Gw+nIUof/U1bct/+gEzA=; b=ybdwMp4hGrpfSbK+c2IvNreNsobYB4kZTyS+LBtH5PIdK6tyBUzWfNUYGZogyA9Kfz +6U8lcQmX9MXB3RGBw07FKWgz71oI1kZ4budvNGb534d/OTyI6sn+QjK3O+ei7q4Wp6c ZHrbs7VT4uPVXQ6yCWLdgM0IIpyalrWktsL2RTFWaURwh/hFoV9BYGb4coeM9MKrIBus 7PC7Q0UNwqYL/th5jAfjpm+uqrjG0WGIcsikJBrIwUpLS21oeOTJ34QDGlRau9Bp3TVt 65SwI4FO2Mi9FnAdg6aKYEHrem15Fb7jlHZkfTb7u8O9SpUbvIky5OAdPkvw1A77qwxb 2uLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=fXmEopCX; 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 f32-v6si599917pgb.506.2018.07.26.00.15.48; Thu, 26 Jul 2018 00:16:03 -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=fXmEopCX; 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 S1728938AbeGZI34 (ORCPT + 99 others); Thu, 26 Jul 2018 04:29:56 -0400 Received: from mail-bn3nam01on0062.outbound.protection.outlook.com ([104.47.33.62]:4026 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726621AbeGZI34 (ORCPT ); Thu, 26 Jul 2018 04:29:56 -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=oBNdgngxV6F5slvk6l8KUn4Gw+nIUof/U1bct/+gEzA=; b=fXmEopCX4mABPyVvk9vh4L+fVKlq3mWoef2IGthBeJ2kUKECQizKDyi5ykeH/pMJ3X3OsdnQR43+2uJGO25elChiwj4mGABOJ8k/TvippHoNVi3H8Q5TT7+Gz/SnqBsTGtwI5VTIB+y/wd9Mg2aATHwr5Wv6BBpF1qx0JY8VGUA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by SN1PR0301MB1583.namprd03.prod.outlook.com (2a01:111:e400:5232::17) 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:14:23 +0000 Date: Thu, 26 Jul 2018 15:12:07 +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 v2 1/3] mmc: sdhci: add adma_table_num member to struct sdhci_host Message-ID: <20180726151207.6d8898f4@xhacker.debian> In-Reply-To: <20180726151017.4da1e336@xhacker.debian> References: <20180726151017.4da1e336@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: TYAPR01CA0129.jpnprd01.prod.outlook.com (2603:1096:404:2d::21) To SN1PR0301MB1583.namprd03.prod.outlook.com (2a01:111:e400:5232::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8042e27c-022a-4c7c-3830-08d5f2c76b31 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(2017052603328)(7153060)(7193020);SRVR:SN1PR0301MB1583; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0301MB1583;3:EEt/8wOGbKDPia+zkKto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K/JiQgW5m6SWg+dWaR2EvqRpwlG/KPc3PFXRdCLe/8h4CNqVqE/epKfhzmZ0vla1FWqgaXx7v9bQFd72CNGTd1qEZE+74baltyeEesB3nw0iLvaMwpaNbkWW4Rc16khOvyXNyPdCmwKqeZFp+ovd1Cto3uYr3kDaa1o5M0rIxsU8STjvPdxvh19Gjfmdexbe9vgOY9YKLGzphTJgGrvm+qMSyNW6sBbTnjMX1nMGm+0c1RIkvPCFTIDKXCBYASrthnJXoKcQbtCND/V5+/AzgG6dkG+c64Kb1kqzwuiQjXppIfYkx5z0kkZ2b35uZ3u4n9L8LFhEDa/;4:Du1Ju6g2Hg9QOFfcymY/gBjxexFDLg2xrWY3HSbA0GPFmMj8vlZXsJA0v2E2jzFXGXkYRX3ypA6517nrp9NmzEmLjMsFb3Ipc/k4K3FkO0SVeQ+2tSx6wU0IRIKGPDE0wRO7FK/xzTILzivz0hG2uJwTPfN4wFJJqKYAERlQiJ0Rr338y/fgFfolxZAw7HFgrfU7svZeU447xPeOhBeuF3hXgtdjqXVJOi1ARv+YHLhyGgitYZDU/VMncz6px9/LecaUxGptpwuVJGFH/e0Ong== 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)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR0301MB1583;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1583; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(346002)(136003)(366004)(396003)(199004)(189003)(16526019)(26005)(5660300001)(186003)(68736007)(486006)(2906002)(97736004)(50466002)(7736002)(316002)(476003)(72206003)(86362001)(478600001)(11346002)(305945005)(6666003)(110136005)(956004)(106356001)(6506007)(3846002)(6116002)(9686003)(50226002)(23726003)(446003)(4326008)(1076002)(55016002)(33896004)(105586002)(76176011)(230700001)(53936002)(47776003)(8936002)(66066001)(7696005)(52116002)(81156014)(25786009)(81166006)(8676002)(386003)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0301MB1583;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;SN1PR0301MB1583;23:gubZaA1GcO4sOgegN4wAxzQ2crdzo2DaJEdy6hZ?= =?us-ascii?Q?Z35UhRZXFV2vNO7ipQZqGcFQ7MpEdhioM8KYdFANf6Jdf7dBMDpu34M/tN7O?= =?us-ascii?Q?8o1m0DNL+A7RS4UIXgnblxjSVTelGIMMpB+uNNfzqpZZi4JYBtrUsPwiA7aY?= =?us-ascii?Q?BChjRywSJcqG+i06GnbNDfSfm5o69mm03+7GkwJ7am6D2AV/2oNHbyF4G28m?= =?us-ascii?Q?xMGyIC8VOFVvTTtD9Sy1BsLBwNdA7qo7IPpVlVz3csZUCNqucND5NiQjz2kG?= =?us-ascii?Q?TuBfg7Tjkme76IzokX1UWBrXvvNSK44SCs3o2obPffggAPtKxrzoXPmz2X2x?= =?us-ascii?Q?IYF/P0TZ501LuT3Q4WVKvMxliR7prD6Cu+uOn/CgyQ5euF2Occ8VW7lg18gG?= =?us-ascii?Q?+DoyZ7Tnle/pvepaVL/rhxJT1hb0hfgx/yAiUqyK7VEMjV0w1UX4wVbEi2yC?= =?us-ascii?Q?G2ZEcxzVdFoAhmmeJbV3Q8AhatEvAIM0WyD3/2JvUyrsrhk9v8BdZRI1Idh4?= =?us-ascii?Q?Mw7QHwx6nZ+z33bI/ccwE3K3PFHjbOZ+BZludaRzO3wcBNJ/22yp0X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Vr8tTgDUJA35+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 07:14:23.9183 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8042e27c-022a-4c7c-3830-08d5f2c76b31 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1583 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.18.0