Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6888674imm; Tue, 28 Aug 2018 02:51:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYxG6e2YFiOEO5GAhX6rR5GI81L+S4hByWPozQ1tKWj5bJUbbERH83IQQ/mfiAnoBPueWJ6 X-Received: by 2002:a62:57dc:: with SMTP id i89-v6mr755409pfj.45.1535449874861; Tue, 28 Aug 2018 02:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535449874; cv=none; d=google.com; s=arc-20160816; b=SOe8n3lRE9fCVah0Ir2/WjdvwUcbx1haVWaJBIZPoii6Ljh/WMjvzYLFDRbR9rMHVI 9H3N+CQj0+vxOQK0ylR/UYTW0WeZiJXZL1V4FagJudpdJ/NPQ/1ikJ7ZTUnfRfscMUMC mPSVezVVafmPPnc2IM/3L9AwB8UYyFkRo50WEqHBySA0YSGr6SQy9Oi+WNL1St6Ch1rp 2PEVJLUP2bxkkxYf6LCAuMHhVWvOk7tysEU+1pePxjH0vTwX+JtNvHytWbuuxPjogQa2 K+DPxNc5sDjnLXQnkMaxxaSVjCcTcIVdIl3g9SYGy0iGAqXNNZBgQkfuWdBpG7o3rfGa /dgg== 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=Yvprez3azRSi1qUZTkuWZTzIjc29OUayx4JB5SrF0mI=; b=S2iJhFv3A4xYM0q6CyuZ24XW1/NUgM9ZMTBVjVFwPZmG5JivCQ+pxz3BZqZposDze5 c/a0fD/mhja6twgEOJRmHYm1ottyeuA4Gv3zNm69l7tWlz08ftpM7lQxJm0TQRHUhabr 25ikKXUZrU0jGvns5KCtgEHV8D/zM4f/FbBO/SnJdtO62n7eCegJEViGMIAK8OzKVCTO ktMxZgR4rry2/hBG0rwSDrghrJoup7AAc7zOtmVY7XjLiqdrK+6eVX3ufNtj9RyJS/jA pXValTC6vt948mieDPg0wofPStcaQoODKewz+Zoy0Ihr70HnSwjpnsfHL2NoAl+1DccU LyTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b="ZM0Jrs/L"; 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 c17-v6si708082pgm.15.2018.08.28.02.50.59; Tue, 28 Aug 2018 02:51:14 -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="ZM0Jrs/L"; 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 S1727790AbeH1Nka (ORCPT + 99 others); Tue, 28 Aug 2018 09:40:30 -0400 Received: from mail-sn1nam01on0050.outbound.protection.outlook.com ([104.47.32.50]:63990 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727747AbeH1Nk3 (ORCPT ); Tue, 28 Aug 2018 09:40:29 -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=Yvprez3azRSi1qUZTkuWZTzIjc29OUayx4JB5SrF0mI=; b=ZM0Jrs/LxAza53Ha+CS/OWozCFwhrCFKzr8+9DcUxhA+Bajn/alSNXREzOOFXL6YPet49HZqdzNxeALgza1r33XAMrkI5HZll48E317EWA8Eyu2hdomgL/IYfbbkeos6nQgDUDqlTI/IMfk8/yjtaOw3N/4asvk2aIq7Z/s1obY= Received: from xhacker.debian (124.74.246.114) by SN1PR0301MB1582.namprd03.prod.outlook.com (2a01:111:e400:5232::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.13; Tue, 28 Aug 2018 09:49:36 +0000 Date: Tue, 28 Aug 2018 17:46:35 +0800 From: Jisheng Zhang To: Adrian Hunter , Ulf Hansson Cc: , , Subject: [PATCH v6 1/3] mmc: sdhci: add adma_table_cnt member to struct sdhci_host Message-ID: <20180828174635.4bba02ee@xhacker.debian> In-Reply-To: <20180828174534.00fb5e24@xhacker.debian> References: <20180828174534.00fb5e24@xhacker.debian> X-Mailer: Claws Mail 3.17.1 (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: TY1PR01CA0198.jpnprd01.prod.outlook.com (2603:1096:403::28) To SN1PR0301MB1582.namprd03.prod.outlook.com (2a01:111:e400:5232::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec7faa7c-b4d7-4e4b-5784-08d60ccb916a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN1PR0301MB1582; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0301MB1582;3:KrZM2ycC0D+T8XfGsPMQ6fRaymIq4dN+6az3QC3F0RVmTTpTAbs0AbWiGW7RIrODtC+YZYUfTPHAk1ZqdXc7Vd9XI4AbWtLPBRl0QHmEAsV897/T/AJ1/CYzb27qs5CIHU5zExxeVu2mm91nUTnpLwlO0udhyQaLlfdN/nntuukask6s+Lsybv3sXimSAPJ2C8ihb+hnubz7bpdpY5mqAi217vHb6MSVQ+o4e6YPcCm7FBTheaiTXuVjA13eY97e;25:vqbdGaBnlnN6s1XrsDzpoWeocZ8D17UgiPFQmfUL3g4Rq8oB7au036Xpk0EqDXVcwUop3T6oJhdy8RKpg0JOrh3ZPiy2D8EIethDAr8aLQcfFCTCGj6RiG+egj6zI7fw9s2Tswq67qsKbj4ugT8XURxUrMLzuwmZ5/BS2mkXxuTeFT+1A4hl0DUWg1r9Zx0Pq4dQk7TOzHIIGUdwtv7sxmO2W9JSAjF6+g6Ry3wnyW2AaUtfWlum1ls71SpN+4XIKYYN5LJg7aLnbUhWcRsQENpKmHCBdIWEAMHXi528W/be5gMQUpPFfr8IqdOLubSs9Ke6KXjydPN7/rZ5nXzDTg==;31:AfojAZRVJU2bZkdoA7hDvNQHEwUiU4jYI1SL8Fi+bLhUfhF0molXskaNrCvQn9CWNvZXpOuf96xqEVGb36aarUCAowjK63yr8ueCV/cb7l77OebMfilF9UDAUeFJcAjW6kHMGTf2vgY3KFVbdbxHFU/lYkBPyTuuY25OHT6YyCA/plTyDK7Z42m8NSBIepBF0KF4A6sV/yAPAoT2CRI1jztENLos/vxgDP8J4I90Gvk= X-MS-TrafficTypeDiagnostic: SN1PR0301MB1582: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0301MB1582;20:sNOiMhvDRwHB5SEwguS2Q8pLG3bz+8gHxBA2JykWi4RVd5rNNoctY711N2CIrsf/cnZeIdbz3u0ygBnqv5/huaKtUwZJE5R/oB2IxSLwxOE2+4+xz5UxwxhyXdhelJaRnlvKhui1pY+A+2HXmeOq+e+cYGY24Xqv6WtrGZa68u+jkFGRfO5nVqS3bCAvSu+CXysFZpSzEQmQI8fxWU8haw3dzwLRi7bq1ooxk4eSPEc7mINwFM2517J/FOsMVVOgukbPingryMee2yWA2H3qVNntVnIj5wg/i3/EzBg0/QTN/QYtfUZt/DXP4P9hgu5dhbwMnpkF2QdXxRcBNfpE0VunFcAsa39YIQf34XM552lnJzYscwdQ1iK4Qr8/djNGsLR+BnXpNbO40rciBtlN+GcobOPGxEkUp7zPFThfF8unksRFlfwzB752sn/qOXxfNNXFVpjU7lM8OGgiadx6hDexs9EIvKvlFXRDiMIFr/scklb8j3VICem7NHa+lIGD;4:GsqhprybCCJCqXOesvVjAElgE6l2FC83l/eOkORceBycn+yKz4MkGhU0vyzmG3QgIMHifqZvMy3+LGZbUr2XR1bWfJo0o2BktTkWjfJALVCzp7g8rT+qZ1aGQWUgiFuTIOyLiJQfm3exkZQv7b2lkoEK7D52a8i3qiLv5nIU5ziZ3lVIyk9kZahdhJ41GUuxWA9k7PdYnE/CwZ22DW6lgksLCtqy/VdaF0QleU6q61w9XPRGpxAdcmIrQfUfgxnUXiAo2G4G+ET4uoNqhOdadmAoJneOuLzvus+dT33jqHwAGb3AG+WM1Ym+tldy3nlF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:SN1PR0301MB1582;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1582; X-Forefront-PRVS: 077884B8B5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(39860400002)(396003)(376002)(346002)(136003)(189003)(199004)(50466002)(230700001)(68736007)(956004)(478600001)(446003)(72206003)(5660300001)(2906002)(11346002)(110136005)(1076002)(54906003)(23726003)(316002)(476003)(6116002)(3846002)(9686003)(55016002)(25786009)(7696005)(33896004)(52116002)(76176011)(105586002)(106356001)(50226002)(26005)(486006)(16526019)(186003)(7736002)(8676002)(8936002)(305945005)(97736004)(53936002)(6506007)(386003)(4326008)(81166006)(81156014)(47776003)(66066001)(86362001)(575784001)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0301MB1582;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;SN1PR0301MB1582;23:ACgJkqnzwhWea39heknPzISFdgFhnO/6K4a+v0s?= =?us-ascii?Q?mdDZ3IoJl49hhYzBeA6Vo40wUgpPbxzl0sPvF7R0477WZKUU2RGm8d5pNaiF?= =?us-ascii?Q?QL3JS84lNohP4NO+2/ji5NBwy5T93JqoN/3hbsbAILdeKnQhuRKdOPDAz0sP?= =?us-ascii?Q?WkxxKljfTomuHdAuUuDHz8FzEzjd3tuTR8lgeXUHtDM/8EW46a7LX1viAr5/?= =?us-ascii?Q?ekoF4z60BT05KNWgC6wyCcNyaAc5aKZFyMF19Rpo8odgM5r7e1HWE6JdKK5T?= =?us-ascii?Q?Z6XcSH1FBnsYAIcZJUVpV39ruGcuF6q8T8SJqNe4qkBpLBWq0BFyvk8UJwL5?= =?us-ascii?Q?qGdAdMhbNVYXzyUB5TW/zY+CS73zUBBru8lPAqbmnG0u3+8KRWF1AIG3ZBXO?= =?us-ascii?Q?s7kIAAUg6YjOtrh2KapMcsMGgDlk2KK9y1Y3GrLo9+9edve89p/HIm0QhXxo?= =?us-ascii?Q?aBF2UCvNmi5HzPO1o98XfEl+Gru0TjkKkfzpNLaTHQTICOCiy9CuHoaIHnAO?= =?us-ascii?Q?A7B2FvpdyoN35FNRM+wfeAEfr450eSIf03OmQC/F67HfNyhIue35DgEEuqRj?= =?us-ascii?Q?bEgheKxLrB54Cdpgirl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SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2018 09:49:36.2531 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec7faa7c-b4d7-4e4b-5784-08d60ccb916a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1582 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds adma_table_cnt member to struct sdhci_host to give more flexibility to drivers to control the ADMA table count. Default value of adma_table_cnt is set to (SDHCI_MAX_SEGS * 2 + 1). Signed-off-by: Jisheng Zhang Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 17 +++++++++-------- drivers/mmc/host/sdhci.h | 3 +++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1b3fbd9bd5c5..52ccf4644384 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3322,6 +3322,13 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev, host->sdma_boundary = SDHCI_DEFAULT_BOUNDARY_ARG; + /* + * The DMA table descriptor count 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_cnt = SDHCI_MAX_SEGS * 2 + 1; + return host; } @@ -3567,18 +3574,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_cnt * 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_cnt * 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 f0bd36ce3817..25bddd21de31 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -563,6 +563,9 @@ struct sdhci_host { /* Host SDMA buffer boundary. */ u32 sdma_boundary; + /* Host ADMA table count */ + u32 adma_table_cnt; + u64 data_timeout; unsigned long private[0] ____cacheline_aligned; -- 2.18.0