From patchwork Thu Aug 16 07:54:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 144331 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1760578ljj; Thu, 16 Aug 2018 00:55:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzszxBjHMtYgEEvtgAonLGVCI7wGOSr69apdyQuCsvqiua95RLbhZMWGUHzrE6XSfW2llDd X-Received: by 2002:a17:902:7587:: with SMTP id j7-v6mr27511574pll.256.1534406145951; Thu, 16 Aug 2018 00:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534406145; cv=none; d=google.com; s=arc-20160816; b=fqKKD8fdLlFsPKoWz288FxBhaOxpNJJz+AJFV4ERKmklwR1vZc84o+1ANwqmWQvvLs HeT5VIUeiKWsZUMLa+IXlpZ8BedPtoIUeWQ55nMkjffogAsHy0yI4G9UkOWne+kE0vPq Pp/aKYu0zewQoVUEPlHWMxLviUTeF0RTA9AUEYljWorn2JUg9Lw2bkXqMl7T75pYDoqW F0QRDLwjo8W504aoCyMHfaRnrjqQxwg00w+c4X00rbA3sXM61HxoqiA1Pv0mB3593iUN z+Dqc6VWRcKJp+zstOGhX8N0XKLGAAgxr+dtZPcVC1U4Tho3QFSsCCb5ALVEhSJWWqSq moHw== 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 r29-v6si24354997pff.24.2018.08.16.00.55.45; Thu, 16 Aug 2018 00:55:45 -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 S2389648AbeHPKwY (ORCPT + 32 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(+) -- 2.7.4 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