Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp357466imm; Thu, 30 Aug 2018 00:06:39 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb2P3EP3XYdAsJzXgoT2tC/l855naBiYxx3yyooA3j/511l9P1igGBUteG1apzHsLoDzlIv X-Received: by 2002:a17:902:da4:: with SMTP id 33-v6mr8941002plv.193.1535612799596; Thu, 30 Aug 2018 00:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535612799; cv=none; d=google.com; s=arc-20160816; b=E/4pkzN75voPCvmzfizEusSRywh9TQFVTEJTlm4YSF5hpVLuBEpeeMm34ijGx35hbd PNRo8gF2T8wprmOWrH5pdZPV6RggqsSmuZ2wkfgym43WnA1sK4n6GDvwYDH4DxmzWJAW JjjrUBRATxioTZLIMGFzUvdGDgVR6Zpg+ih+uCdLLENd5XkNSMZSrSsYmowWjNcrlIyj x7vPgToOoajftQ5jfHRVZCWFoHyfCj38tSRj5F3dlsMx5XB53BReLWSxWKx8uvSELcpG ZP/wy8m8glYJLl8W6abO/rLOmRawSzXVsAwOA4zvNm6rPiP47Wkb5+j9CcOFJ9/LouX5 juXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=lgktf0Fo9cMvRg/9sqhU40GJcSPvbDJT9ACm4qVK9jc=; b=KXTtAbbs7cyZZeXi1ll5PQnJfbkfILy6HVnqmAKIXDpGKLJtAh46Kx7/p03ZTQNrHs BNMw7TlEXndzo53y8JjTGpjFR3ptDjBhAdihMdt0R4AUzFCwVALeu051cNLKeFrKigIt 1QUPVtYhAHHnJdASB6b79zxKjR2Le7clkVlRp9obdfXzs/TPeGpGJR0+WYzgZErCyhf3 TVd8xgTVWruwu/qDVmfNsHlx9iMFVsevgLU1wW1LeFB74ZUlLn1UcrXroFX3gCpttv5y 6d3XsHIexrJVVTSz3gkhyz1fJE4V+FG1mKYipdYqF86Ug8QggkS9BXSssF+b8xSHJEGi oBYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vMp6SN5B; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g27-v6si6483358pfj.283.2018.08.30.00.06.24; Thu, 30 Aug 2018 00:06:39 -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=@gmail.com header.s=20161025 header.b=vMp6SN5B; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727601AbeH3LGB (ORCPT + 99 others); Thu, 30 Aug 2018 07:06:01 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:46035 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbeH3LGB (ORCPT ); Thu, 30 Aug 2018 07:06:01 -0400 Received: by mail-lf1-f66.google.com with SMTP id r4-v6so6319314lff.12; Thu, 30 Aug 2018 00:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lgktf0Fo9cMvRg/9sqhU40GJcSPvbDJT9ACm4qVK9jc=; b=vMp6SN5BUekZVgD7uG9Q9Ei5VAknoFFtYSoaj9e8t0bTxReGyg2IuSE6RI331Zn5Bm /o80neUR61Vki+BLE1Y/IpYs6r9Ot8eFW8FDuFHvHtTAP94zhKzT02XuNV0C/duclSLb nygSWhbrCFqtmx1d/GtXcV9qFsGmtcNzv5vm0xiV1++iUn4HOsc2il/+a0BZCPUKGGdS 7vunNOLHTGkbd6sUrYa1ecq0DLLZxnti3vJnidRoidwxDQ8A3TF91Q0KdXyDoNAT+S1O BdQBRHJjGw+ifA57A3SMTQ4cUVDvejHmqJJ2dFQzvcSRzP1Of1hrYqCY0Tvk3FDw3Hwf M7Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lgktf0Fo9cMvRg/9sqhU40GJcSPvbDJT9ACm4qVK9jc=; b=bcLRuH9Vfjkeg0l1emhyK6v8BKw3foN7xuCIPX7Y3BvaLxoO5IO00k9qmxfbhD995Y oheMypQ15Ks+3UcWeJqbJrhej2MnOCx0xGw/EiNyNd/8ePm5cuL3o15aKwzrODJT9Pgq Xi2L5+vLNfZEfbF4NGFu88B4dXyNHqXKAQJpOPc4XoGRGY+7RfdsnaER/xTAAgqcRB7G gaBvGX14bkomGUz4qiO4z0dAWQ8smSWa0pCN6vXqRU516CopxUF+J6CQhRNNzPi1RdSo 27ffc+nqlvX9maBQpkYuXOil5P/XGJ1gq/J85Aj9+iiGl/muJ6d/qMLuSKc3qnijwPkA Me0Q== X-Gm-Message-State: APzg51CRCxD85AN9uFiTqhMhTNTil4bV2oebkDb1t9NG3JqU15WEy4Vt TvjH9tVTgMoxe5tcdTmZvBmWAiuE0ibhNBYh8Ho= X-Received: by 2002:a19:9e85:: with SMTP id h127-v6mr498784lfe.89.1535612718108; Thu, 30 Aug 2018 00:05:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:6318:0:0:0:0:0 with HTTP; Thu, 30 Aug 2018 00:04:37 -0700 (PDT) In-Reply-To: <48e8ec2c-c3e3-ad08-2c1e-a0feb9ba0820@intel.com> References: <1535526184-32718-1-git-send-email-zhang.chunyan@linaro.org> <1535526184-32718-8-git-send-email-zhang.chunyan@linaro.org> <48e8ec2c-c3e3-ad08-2c1e-a0feb9ba0820@intel.com> From: Chunyan Zhang Date: Thu, 30 Aug 2018 15:04:37 +0800 Message-ID: Subject: Re: [PATCH V7 7/9] mmc: sdhci: SDMA may use Auto-CMD23 in v4 mode To: Adrian Hunter Cc: Chunyan Zhang , Ulf Hansson , linux-mmc@vger.kernel.org, Linux Kernel Mailing List , Orson Zhai , Baolin Wang , Billows Wu , Jason Wu , Chunyan Zhang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30 August 2018 at 13:59, Adrian Hunter wrote: > On 29/08/18 14:39, Chunyan Zhang wrote: >> On 29 August 2018 at 18:59, Adrian Hunter wrote: >>> On 29/08/18 10:03, Chunyan Zhang wrote: >>>> When Host Version 4 Enable is set to 1, SDMA uses ADMA System Address >>>> register (05Fh-058h) instead of using register (000h-004h) to indicate >>>> its system address of data location. The register (000h-004h) is >>>> re-assigned to 32-bit Block Count and Auto CMD23 argument, so then SDMA >>>> may use Auto CMD23. >>>> >>>> Signed-off-by: Chunyan Zhang >>>> --- >>>> drivers/mmc/host/sdhci.c | 8 ++++++-- >>>> 1 file changed, 6 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c >>>> index 62d843ac90..ac92e0f 100644 >>>> --- a/drivers/mmc/host/sdhci.c >>>> +++ b/drivers/mmc/host/sdhci.c >>>> @@ -3834,10 +3834,14 @@ int sdhci_setup_host(struct sdhci_host *host) >>>> if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) >>>> host->flags |= SDHCI_AUTO_CMD12; >>>> >>>> - /* Auto-CMD23 stuff only works in ADMA or PIO. */ >>>> + /* >>>> + * For v3 mode, Auto-CMD23 stuff only works in ADMA or PIO; >>> >>> ; -> . >>> >>>> + * For v4 mode, SDMA may use Auto-CMD23 as well. >>>> + */ >>>> if ((host->version >= SDHCI_SPEC_300) && >>>> ((host->flags & SDHCI_USE_ADMA) || >>>> - !(host->flags & SDHCI_USE_SDMA)) && >>>> + (!host->v4_mode && !(host->flags & SDHCI_USE_SDMA)) || >>>> + (host->v4_mode && (host->flags & SDHCI_USE_SDMA))) && >>>> !(host->quirks2 & SDHCI_QUIRK2_ACMD23_BROKEN)) { >>> >>> This is over complicated. We can use auto-CMD23 if not using SDMA or if in >>> v4_mode i.e. >>> >>> if (host->version >= SDHCI_SPEC_300 && >>> (!(host->flags & SDHCI_USE_SDMA) || host->v4_mode) && >>> !(host->quirks2 & SDHCI_QUIRK2_ACMD23_BROKEN)) { >>> >> >> So no matter whether SDHCI_USE_ADMA is selected, right? > > Yes I think you mean like this: if ((host->version >= SDHCI_SPEC_300) && ((host->flags & SDHCI_USE_ADMA) || !(host->flags & SDHCI_USE_SDMA) || host->v4_mode) && !(host->quirks2 & SDHCI_QUIRK2_ACMD23_BROKEN)) Otherwise, without checking (host->flags & SDHCI_USE_ADMA), if using ADMA and SDMA on v3 mode, auto-CMD23 would not be selected. > >> >>>> host->flags |= SDHCI_AUTO_CMD23; >>>> DBG("Auto-CMD23 available\n"); >>>> >>> >> >