Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1825559imm; Thu, 23 Aug 2018 09:20:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxZEohg4s/gWBcfIlZUd1uZ6fTyDDwx+gA2zHmo23uQDtFIKRy/V0BV6ytoevfzuSFDuxUw X-Received: by 2002:a17:902:28a4:: with SMTP id f33-v6mr58938734plb.297.1535041235547; Thu, 23 Aug 2018 09:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535041235; cv=none; d=google.com; s=arc-20160816; b=vN2MWicB9JmU2u0CCTmlqcmqE7jHN28bcKtoVkNJ3FWvlDyCyas79H+gGhu/HBRYKu p/8xEHG52zG2UzXad8rrnHdlaUsqvsY/sK1Ye9aR31MvRITKrg40mBXzVzPuVSHHkr2D 5sDVFAmkfGEqNuwjkGJEzsdB5U9P1iM7cjeQ0CznlemjsDrSXoeZZeQOIVseAEucBD5V 4Ycr1Dnv5Gn+dDgjk+Wx/RuxfqO2ngweLI+RZuFnf8LN5MvlxUw0Ga9KsgE5j79mevt3 z8OojFUrzi/RSzhQ6+tHcRJSf+ZkCGYI5LMNXmsZgnkAH/z8/tzWP7i9SvGHrO5qPVwE 1cEg== 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=qq5xevLEGMOtvgPmhenn3QzNsqL+TpQva4mdCYCYKi4=; b=NeLwAz2EebbTbOnoC7FnoQpjEvLNA6pHUrdASyGT2DvPIlh8vClf+YLphEVj/GBL8s Pup8J2kxuarDrueRZG3ERa40+ivvgKLHyoA174uphEKDfg7xsuUEa/Pt5kK1RpSFmI59 s0BCUraAp8L0n+vrBeWN6Mf8ITOBIk+Hu5GllR235rXM9ZhbiYd3A7yRdtsAsSTBQ7Vx ztqhQkc/phSCTzsizMshNkdaIXPvfw/h+8qwsgbdH86+BiNSQsMuIEudf7EWOnyvUM74 joJaZBxCJnjQCbU8Qvg4R3H417SIE4ASiKq1KP/1jCFSQYxhHFfbye9zZZAjE3boCnuO WcRA== 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 59-v6si4558265plp.87.2018.08.23.09.20.20; Thu, 23 Aug 2018 09:20:35 -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 S1730883AbeHWQ0d (ORCPT + 99 others); Thu, 23 Aug 2018 12:26:33 -0400 Received: from mga09.intel.com ([134.134.136.24]:47814 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727714AbeHWQ0d (ORCPT ); Thu, 23 Aug 2018 12:26:33 -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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2018 05:51:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,278,1531810800"; d="scan'208";a="256621695" 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 05:51:52 -0700 Subject: Re: [PATCH V5 06/10] mmc: sdhci: Disable auto-CMD23 if stuff bits is set in CMD23 argument To: Chunyan Zhang , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Baolin Wang , Billows Wu , Jason Wu , Chunyan Zhang References: <1534406064-10065-1-git-send-email-zhang.chunyan@linaro.org> <1534406064-10065-7-git-send-email-zhang.chunyan@linaro.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <9de08b30-cb92-01c6-caf3-c4abc3591dcf@intel.com> Date: Thu, 23 Aug 2018 15:50:11 +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: <1534406064-10065-7-git-send-email-zhang.chunyan@linaro.org> 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 16/08/18 10:54, Chunyan Zhang wrote: > For version 4.10 and aboves, SDHCI_ARGUMENT2 is also uses to indicate > 32-bit number of blocks, it doesn't support stuff bits in argument of > CMD23, but only block count for the following command (CMD18/25). > > Signed-off-by: Chunyan Zhang > --- > drivers/mmc/host/sdhci.c | 9 +++++++++ > drivers/mmc/host/sdhci.h | 1 + > 2 files changed, 10 insertions(+) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index b3328ee..a72ad0d 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -1729,6 +1729,15 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) > } > } > > + /* > + * For version 4.10 and above, ARGUMENT2 register is also used as 32-bit > + * block count register which don't support stuff bits of CMD23 argument > + */ > + if (host->version >= SDHCI_SPEC_410 && > + mrq->sbc && (mrq->sbc->arg & SDHCI_ARG2_STUFF) && > + (host->flags & SDHCI_AUTO_CMD23)) > + host->flags &= ~SDHCI_AUTO_CMD23; I would prefer this be done in sdhci-sprd.c by hooking ->request(). Someone sent a patch recently to export sdhci_request(). > + > if (!present || host->flags & SDHCI_DEVICE_DEAD) { > mrq->cmd->error = -ENOMEDIUM; > sdhci_finish_mrq(host, mrq); > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index d34971ac..daf8c1e 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -28,6 +28,7 @@ > > #define SDHCI_DMA_ADDRESS 0x00 > #define SDHCI_ARGUMENT2 SDHCI_DMA_ADDRESS > +#define SDHCI_ARG2_STUFF GENMASK(31, 16) > #define SDHCI_32BIT_BLK_CNT SDHCI_DMA_ADDRESS > > #define SDHCI_BLOCK_SIZE 0x04 >