Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp505529imm; Wed, 15 Aug 2018 00:42:51 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyCO53U6Fqrjj1R9GN/CaotxsEp9b2tB394OACPcslf91Kj6MFyeIUuDt1lxcjnTcygtn3l X-Received: by 2002:a17:902:b697:: with SMTP id c23-v6mr11482693pls.88.1534318971772; Wed, 15 Aug 2018 00:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534318971; cv=none; d=google.com; s=arc-20160816; b=MXdD//v2/Ekb1ZP1oeyNkublEGM2HmqaL7wR+bQ2kG3YEhG3sa+nc5ylN9xV5YfzVH d58u9TDSWbkO4wriyehRbuvNqWhkY9sf/DxOtJkqrbsb5E+BC7gzTn1ihmOedXsLcy3S d1zAC15OaI92MNK1mkovsfWOgjX836v74LR+sgmYEdZL6qe15e72AAJ7mBL2J3HcP8VZ KJ/z7zQTgACCXL5NFO7nXWNrzLcr8il9ODLstmmSXmErxA/DZUFU8Ov/YounlzeUD3WK qcQMoEaiPV32BAdjGNoc0mRHstHGHPy7xiPMlu6EWzlWQB7IeRwnL1E/3hYQV7sMwCzc axdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=SOr/IJdk21TParulMCWa9cYVqQMPtZztgDYaPx0Qhkk=; b=oUYtKm/z1578lppnWULLOTGw6IcRsqHshQyL8E4zbDWLqyRKCRvc2d0BhRBaQOdTRf +kRnG2jP1km/kAacrvghEzGH9VV7EZhoabE6XFHXOQM2XE2UOP8mLOyWnGsA9Nc7stHs qPUlge21QBj41sQjQH+IRth3BeOMjfkMtlon2ICBI7VOjGOFkR3wjbDDORJPZGnAVhV9 X0JmOpGSnfybosmnL8to6TYe9MPnmWFpMibQz9Iy7uxBRzj8MPqnpVs+YImt38g1P66H 2fNUz1MUKwAvR8PKv5mpPwCUXc+IoXPEb9AM/KWL3XGSBBRMp/NzZYBvNWBeHEroke/J /mIw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o69-v6si25731907pfo.342.2018.08.15.00.42.34; Wed, 15 Aug 2018 00:42:51 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728900AbeHOKcn (ORCPT + 99 others); Wed, 15 Aug 2018 06:32:43 -0400 Received: from mga05.intel.com ([192.55.52.43]:7240 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728583AbeHOKcn (ORCPT ); Wed, 15 Aug 2018 06:32:43 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 00:41:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,242,1531810800"; d="scan'208";a="248967102" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.72]) ([10.237.72.72]) by orsmga005.jf.intel.com with ESMTP; 15 Aug 2018 00:41:37 -0700 Subject: Re: [PATCH mmc-next v3 1/3] mmc: sdhci: add adma_table_num member to struct sdhci_host To: Jisheng Zhang , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20180730104424.44fa39a5@xhacker.debian> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <553759fd-cf6d-a79d-1670-8bf94079725e@intel.com> Date: Wed, 15 Aug 2018 10:39:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180730104424.44fa39a5@xhacker.debian> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/07/18 05:44, Jisheng Zhang wrote: > 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 * 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_num = SDHCI_MAX_SEGS * 2 + 1; Let's make this adma_table_cnt > + > 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; Could use a comment > + > u64 data_timeout; > > unsigned long private[0] ____cacheline_aligned; >