Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1817837imm; Thu, 23 Aug 2018 09:13:12 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda0OIcS3/Bt+ELFI2j6EF4tT+RtVPBe47P3qchWQ629GQFyairjxc6RzX+3DKWw0cPiP/0/ X-Received: by 2002:a63:fc05:: with SMTP id j5-v6mr6852675pgi.1.1535040792463; Thu, 23 Aug 2018 09:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535040792; cv=none; d=google.com; s=arc-20160816; b=BTZov6hrUXCx++Yy9QNRgJito63kCw3OJDbsSxURBdlna+rQ6rmE8tY5TdaqSEYKgS E4PSHuStqIzjZPtUsebYCtFm++oxCP22BI3N3CHUogqSsBQUGuzVfvEdZDu9Zsy1ZzES hV3VJJ9PcLOZdonDajuxRRajykNxcNsi4YLnUKx/tJgEM2u+0sYD1LbDFeUxG9teaxfJ 4p5owWxQACT2kHng8ECh05LeNv9ZNriH2HgvtkWbPlbmKx8i0PdVIigunwQG9bRaaCDv CSRq3VuGK0SrQd1C9LgdCfSRuuglMjWb06xpKBuzefa+1Xb428/jz1IUpwIBm6vXHKxY aHaA== 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=DYSlMkdu8KYr9RIEd3mAyLWvSguHabdgDqiatOOL2yY=; b=QbTcYfH8BDdnJJ4oweGBI4illgCFDDMmJCG3euwY6lekwbZVSVsLRKBJWY3l0zw0Wd NMAhRK3GaorQUjwKLBy14aO53RajOg/VVlkUzoFLD00F+cw/iiSI81zZnaytC77tQSkR SFhCmkqrDhOgorh+Ld2CrDe4pp/mFOaLECg+4htLIOqgmBN2ceOWhDHRioIOtmbSxapt 7YRGeQNewwh2QAAgw1vVRu6Pk4Itr0r0X4F4PsZMk9DKmmjyGGK0VIjE3Yxz5ZFnjCNe xcSgnS0RmpiQaR1nJ2Tg/D248PNfLJRaAjhXBYEEtdoOl1Y+7pb79jEymN7qfD+ad9iA WS0g== 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 w68-v6si5156657pfw.308.2018.08.23.09.12.57; Thu, 23 Aug 2018 09:13:12 -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 S1731594AbeHWO6R (ORCPT + 99 others); Thu, 23 Aug 2018 10:58:17 -0400 Received: from mga17.intel.com ([192.55.52.151]:32019 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726246AbeHWO6Q (ORCPT ); Thu, 23 Aug 2018 10:58:16 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2018 04:28:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,278,1531810800"; d="scan'208";a="256604866" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.137]) ([10.237.72.137]) by fmsmga005.fm.intel.com with ESMTP; 23 Aug 2018 04:28:58 -0700 Subject: Re: [PATCH v4 1/3] mmc: sdhci: add adma_table_cnt 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: <20180823180549.78e508db@xhacker.debian> <20180823180700.3432c4db@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: <082e4ee7-3b6a-f4a0-0db9-bfa63e05ec16@intel.com> Date: Thu, 23 Aug 2018 14:27:16 +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: <20180823180700.3432c4db@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 23/08/18 13:07, Jisheng Zhang wrote: > 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; >