Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp468966imm; Wed, 29 Aug 2018 04:41:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZP5mRteS+twlNDRzz3Yu/V8kZquBbmfsDK0Rd31zlhBjlAvtoF82SH3764wMbsSR7NUC3G X-Received: by 2002:a17:902:aa83:: with SMTP id d3-v6mr5575592plr.242.1535542910893; Wed, 29 Aug 2018 04:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535542910; cv=none; d=google.com; s=arc-20160816; b=Xklc9vAxUN0ObJujJ1ro3XuB4JxOmMsFym1abvYAI3SfkDTf9PW2zTqIrfHqCnmjzb WS8eDmtM2jqSn2IDI2KP8L+7h/NKnBeOX1K4ENt5vGIAHh1mxd+m3BY1cNEe091R/g4g wa00mzzY//xd4EQU2OUO3pqZf140s6Gvx4ps/ujqxlgAx73nsb2ulVBQ4OMIPxpV6rPo VLCCYzCvB5+ThJ1i3cQCYXWmA5y7rHcKpXzsqGf2fuiKw9l/62uo5/Ikbe3Djegtu33Y r1vJRH0r/ZvzJg4qPTARp7E86MxJOLWPrK85TDgehNojQbeIHdpD0LV8Xf78IuFPuNjd D0zA== 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=O6nPK4MQRv489teoD6NAtY0Cincq038TN6BWCgLw7dI=; b=OpscXB8PG0689Nef2oK+eypTt4ib2QAzQZM0eMkgWwYbnfpamGhSLPI6lz+8KJKtP5 3RJMThM0YfybuZ+sp7tzrtuGVU+Gq5FHZS5+QCGn3kKKO80IzJ8vrhDZdwNStVeL5XdY XSRcXbB4Tdv9PfYoRwCO6tOB7TG2TD12nDW/1r9L/MJqwIV2JwLtXnoz53DjbQxx3XFe 2u6RVzYO3WHu6iIU/SUAdRiR0G10UjZ3TijumGPpGQMSVLy0/sQyZZEjQQZ4KDey7eP/ cj0TayKZ0HLtX0qvIc2CNysg280t4MR1HxUMBzKpnxHFGb26KNB7bLmAtXjwf+dSL16Z klVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IN4XQDqe; 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 x17-v6si3503798pgi.243.2018.08.29.04.41.35; Wed, 29 Aug 2018 04:41:50 -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=IN4XQDqe; 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 S1728447AbeH2PhA (ORCPT + 99 others); Wed, 29 Aug 2018 11:37:00 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:44878 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727312AbeH2Pg7 (ORCPT ); Wed, 29 Aug 2018 11:36:59 -0400 Received: by mail-lf1-f66.google.com with SMTP id g6-v6so4000010lfb.11; Wed, 29 Aug 2018 04:40:28 -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=O6nPK4MQRv489teoD6NAtY0Cincq038TN6BWCgLw7dI=; b=IN4XQDqevk5NgZ1FtUoE5C6xHGaJcjIIr1tzoWok7bHqq3YqR+weVaKDGmrqQub/oG qJ5My3EuL6/+Pl25K3FBWmcss5KVD4WRIqEWtf1vfMENgK7k5U1NuqGsfD9a1dpylOiA Hgx+Kv1GudoFM4cTKgHz+soBNHZNyVz2tdaqlGit7kUn5vcWU21iSKvaYLSbZ9gwp6Me IkLY6ttjOAuEoTholf2htvnwprDPh/RR3N4cGz9YHK1KrNw7+EgUGKzn7O++M9y4mQBu 2t9XtH1c57TXwBulwY5RyIZasn4i0qndNvE9yLB7gMsaF6X2YEq6Zv/1gB0RiHmwmJs9 LTwQ== 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=O6nPK4MQRv489teoD6NAtY0Cincq038TN6BWCgLw7dI=; b=ht1YyAR4ZxASw1LNHOTgEZyvuOJjGMSx6BjxCRmhPCMSSsndIRg5B8qR2fRlV+k/1D hYM4UWcxwcYjREi/OXVYttFje7WXP2ZUJfy8zVCbsYRidN8DiDWG18CBpvDSdwXZYbi1 FaSt5XYuc900/iC9tZGEOHl88UBc/upEQG7R/WqUCaYQNX+cYFisaU4QLe22zzuCjBoY 7Ofg0uu5+Op5q5YVN+oKiyDKRy8Hie/8Lyv67VqyhQXawVE1ppRp8dU1HKfdJgMMQ1Y/ EFh5rAo7ab2yYjQzBZ8YNXUB5lFOU+M1ONwZdWysbfVoQGtQBVW4Zkoytt6KFgRuWTQ/ HLww== X-Gm-Message-State: APzg51BjNNTRJGy3n6NJSUOJKiZqP0NVtkM1exfxEfFUNsJUE38JC/MJ 1X2DaHPG06ZpEBwCQoYqvAk2I8IxnQuu9YeyQs4= X-Received: by 2002:a19:9355:: with SMTP id v82-v6mr4038700lfd.134.1535542828071; Wed, 29 Aug 2018 04:40:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:6318:0:0:0:0:0 with HTTP; Wed, 29 Aug 2018 04:39:47 -0700 (PDT) In-Reply-To: References: <1535526184-32718-1-git-send-email-zhang.chunyan@linaro.org> <1535526184-32718-8-git-send-email-zhang.chunyan@linaro.org> From: Chunyan Zhang Date: Wed, 29 Aug 2018 19:39:47 +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 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? >> host->flags |= SDHCI_AUTO_CMD23; >> DBG("Auto-CMD23 available\n"); >> >