Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2271394imm; Thu, 16 Aug 2018 07:30:03 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzXPG5KBBL4hJ7HUJO28mWJvUXZKUVIINiYyxS/cO+6yp3Nb3n0Tju2gAcFxGZ38xwRZ+5J X-Received: by 2002:a63:5106:: with SMTP id f6-v6mr28578629pgb.95.1534429803344; Thu, 16 Aug 2018 07:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534429803; cv=none; d=google.com; s=arc-20160816; b=NcR4edb6CS0qLszbAsKnRTfV/4nEL7NmUeQhWbfcV/i4LsEv+HaYXl1LHeB8T0ELyn 6uelTBaIDIISOYW+Ortjr6hGVG+srP95/3DoVEUWCT3tH9nY6gWpoAf4urWZPchLuqzx /6q4R/c8nQQeolhB0Tr58Iz7adzqE+i8DW8iLtE0r2CyfXmMyAcRgfqOHGUeLI6S/CWu Lw+Oz08a9Ab946srkBaIGcl9qbLXRtjZgfNCwvF9tfNTDTRnwVu0wxFHISZIizKLGawf UHqRKluarVHq65UpNMZrxa5xVhHeGfCrczz0eZXaODeLtn3OhqSPLbsQyAW0jWsBQxrJ 54HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=NP825gJ8JNuiSBQ93C487DDun4LcomGeoIeRKjPEd4E=; b=uH1GdnhlnnVqC3oF2oM6drbCuXnI5ULNoqL9938lGSkMlZYhYFO8CYWTi4l4Fa98ut 3tVWh7lh+pGU6HFFr0AlgT2SS6fy+/VdUA6FiCXxH+ANN4AYA2slW2jXfluARPKXIMI6 p2blyguTL5SEYzQy9yLjr4gJRuXdyMlzv6HcMm9MtbvWFobZ3leLdvBtzxdJja2LiDEE vDv2C0hh0CPoyJurnm7ua54iZqFHcHi+IlCaYOCS515AiCGbGce5UDca5ORdMRE9Fxfx 7zn/oSHmKDV0FfYUFXDg2di/9sDuXPAVLZPUZnG2mARe0IYbhC2cVd1cYiBB8hvNjLcM PEQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iDGPLbmI; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15-v6si28110563pfk.146.2018.08.16.07.29.24; Thu, 16 Aug 2018 07:30:03 -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=@linaro.org header.s=google header.b=iDGPLbmI; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389645AbeHPKwY (ORCPT + 99 others); Thu, 16 Aug 2018 06:52:24 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:45427 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387985AbeHPKwY (ORCPT ); Thu, 16 Aug 2018 06:52:24 -0400 Received: by mail-pl0-f65.google.com with SMTP id j8-v6so1688931pll.12 for ; Thu, 16 Aug 2018 00:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NP825gJ8JNuiSBQ93C487DDun4LcomGeoIeRKjPEd4E=; b=iDGPLbmIJ0zPSpBy4lvB8EsQDHX7bRIdNAnDQFxtLduf3kOyfVH3f5adiNBSpZKDBF xc9JfZ8EY3ZitZ6p8O7WEMmc+zDD3UHkLp1TQehl7w+U3SRwy50JXNAeh2P7vY43BRSr gZ10x2M0XlKL5jaMHAvZ4vh37FymuwrLdcOuA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NP825gJ8JNuiSBQ93C487DDun4LcomGeoIeRKjPEd4E=; b=fv0Smzx6cnrNhNLa3EL6F7Ihjz3DPPYgzqADMBoWVHxv9hoRAsoY15mNqHNR40yy5L I+wJ5nMhXJvoDJOp5fqW/YTQz4jzVAwJ7itjeENCbRz/J2vnIzXSBgRq2X2CSHa+e24s cXie0lmJw7Hapl/mJPPxvbUoM6F0siHUbBG7sj2m/kDzPgzWnBYlS+fS1+pzTO9bHldv w8H0iRlaP1Rz4OZTiUBx5sMiR+r35PxofVmX6VvDaSkZhPa+KtpobAB3IMA0FMuFeixx UHsAC9k4fyhqjNCru9BnqVoOF+qsL2sybrPwMxULSpel0S8KKKgtHUq/zm2oFE3Tl17Y xl2g== X-Gm-Message-State: AOUpUlEwUV8t3Q5vvoWGgpQpMpQtO7OVdSqj0Fd7PWiFfx0VMvncJo5f VMGHqGuvbz8rugmNUb1p4bWvHg== X-Received: by 2002:a17:902:7d94:: with SMTP id a20-v6mr21648113plm.19.1534406142962; Thu, 16 Aug 2018 00:55:42 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id i25-v6sm50838137pfi.150.2018.08.16.00.55.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 00:55:42 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Baolin Wang , Billows Wu , Jason Wu , Chunyan Zhang Subject: [PATCH V5 06/10] mmc: sdhci: Disable auto-CMD23 if stuff bits is set in CMD23 argument Date: Thu, 16 Aug 2018 15:54:20 +0800 Message-Id: <1534406064-10065-7-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534406064-10065-1-git-send-email-zhang.chunyan@linaro.org> References: <1534406064-10065-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; + 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 -- 2.7.4