Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp397277imm; Thu, 30 Aug 2018 01:25:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY4GHDdej7YA9xZGPHys9/IzzHnOM7nqks/wm8HVDjNrFwpH8Q6z88gpnKdEA/5R9JF30gN X-Received: by 2002:a17:902:d24:: with SMTP id 33-v6mr9036667plu.211.1535617511183; Thu, 30 Aug 2018 01:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535617511; cv=none; d=google.com; s=arc-20160816; b=sbwSpQdSNTO+AtkTdYUcL7X7LdZ4BpDqLn0Utb4xMgCragCK6D/xSMfMK6yCY62/C1 R1wCftL0nQjneQOj7wxJ6ScMUZC0o8OtcRWjK2hkc0AmrgFaZuDbLBjROXmwsRQy6vTb cQ6i8OK9OPA0GJBW/dqw5NFTlCZeqQBP/19Em8fugDi6xXKcsBXwyiG7oocABvBHz4yV JFS5kU6L1Q9h8BKaC8mA4ACRAtiDLQLj9WSb72AGQcArn5YpQbgDFddt2JnQIRCUUt5y VfwLLHVo+UCsMgGdSK9i/kI3KZdTdFeDpZU0Ciu4WyBr9yU6AxSc0lWCGntYhSBLqwXx CquA== 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=rO/DKR3rI7qewrOYYN0VxXn/N0BiKZbXaxDC6xVvEO0=; b=JrkiRX7uV+B5+NJEx4Al8XMkdLrYkNzHDFN4vAjzE0hvOTy4HHl6QZ4N3xPhHEUhC6 7BMRoxYPYVD6iQTdtCTU1onlTGH2l0P7lG6IvWV5Ku/8iqxDZpY6Jct+Ble2Bwo24T+7 xAM8uKK/Jfd4IJoTv1iqEjZK4s9TsIXgQa70K+2A/6x8z+cqIESGH+I/CCxpgpAQLk66 +BFaqVvPzvC23s3ASci5lN1VvbhxShqK7GEBVD6alSWTCUVjWdV8cMkZsNHwlTremAOR KZlZIRplLAlfoLoFDe95bhvKBD5oF5ihZQubvxO7seu+zKH8HfyjQwdbXx5knIKEUZBf /l5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IVcFyRb7; 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 e39-v6si6122567plg.386.2018.08.30.01.24.56; Thu, 30 Aug 2018 01:25:11 -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=IVcFyRb7; 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 S1727950AbeH3MYp (ORCPT + 99 others); Thu, 30 Aug 2018 08:24:45 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45500 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727720AbeH3MYo (ORCPT ); Thu, 30 Aug 2018 08:24:44 -0400 Received: by mail-lf1-f66.google.com with SMTP id r4-v6so6484505lff.12; Thu, 30 Aug 2018 01:23:45 -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=rO/DKR3rI7qewrOYYN0VxXn/N0BiKZbXaxDC6xVvEO0=; b=IVcFyRb7qj7hwt+dtxVkeCNtJGvF1Hsr+2RXQY+w+ohWxiVgKG+pco1OsTfcapm2/z f8Gk7iDMV4O3BZoO54oZaZgmQdCCOysifUPHlD+vySVaEyylrcW0A8pHYtXY8aLKqp6n AbpGmavW7zSZD1ncdRs0pVmhbVyxoJIQA2Dpi+EAGmsWxh9gkT+1jLNv1pSzFxoNgYiE XrMtU2s4b4fkeEbEQsnxZ+s+2CZB874IqlklurhJTUciifR/5v699pZ+H0fvBy7N19GN 4rnmn/SgjDWXc72zDkqh8yJ3QH+CNBrw3+mwc/YIQVRen4KF3SaMUAoRWw2Lqn6NAPKJ vCmQ== 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=rO/DKR3rI7qewrOYYN0VxXn/N0BiKZbXaxDC6xVvEO0=; b=BQeZ2dI6pLCCYNwR2zeZM8J1PGtQjsOXoZFAS3oKxDP4Atn19VyBteXMwU5kwmPSwh T1RpsAlrEOyeAKLF0DGOPtKwRykBvxNnH7/YawFv9aBGsbH2Yppoe8bZvlCbkxig/j3b yABkNQwbP3KaEs4+XiQCC4vAzla1jWP5TKy2M7qUtZUb3pERDjp82bUDReu/kGYbjskZ yjhQUg03YCQbYCrfxGKfZZ4LP89cDRDoonKtnUo9wQ3+fQKLT0e30O6qOPU6M4140Zlu n6AYMesULVLOiQjMks66z1b+4k42AtV36w/JccE6Q3HeCcsfU2GssuBhs0U7j1Xs8x9Y gDqQ== X-Gm-Message-State: APzg51AQsX7TI7LhDKLXdYCe2665G3CyLZNp9wT4tMfOGt924tpISYaR PLtGmPfFfnNq7wk7Ug8zXBd2hV5CeNrrSrHsswg= X-Received: by 2002:a19:cf05:: with SMTP id f5-v6mr6942194lfg.73.1535617424278; Thu, 30 Aug 2018 01:23:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:6318:0:0:0:0:0 with HTTP; Thu, 30 Aug 2018 01:23:03 -0700 (PDT) In-Reply-To: <145ef368-3aae-c6ae-14c9-6e8f50503dcf@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> <145ef368-3aae-c6ae-14c9-6e8f50503dcf@intel.com> From: Chunyan Zhang Date: Thu, 30 Aug 2018 16:23:03 +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 15:51, Adrian Hunter wrote: > On 30/08/18 10:04, Chunyan Zhang wrote: >> 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. > > Yeah you are right - I was thinking SDHCI_USE_SDMA and SDHCI_USE_ADMA were > mutually exclusive. Thanks! Many thanks for your review! Chunyan >