From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E48EC2D0A3 for ; Tue, 3 Nov 2020 21:27:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 091A620757 for ; Tue, 3 Nov 2020 21:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604438835; bh=UcQyCLTgQwryco3Bwhib+f4CDyGs+CCQGb+72ObgDws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hAjvaPzJnhzPkyWmrt+fKEWasp+R2LrD1KqPJmY0plG1ImorTYq9wfL1XqXSphlrY fjayTNoJFkJlJ7D7pMejFbxfp+ChrUSbXS2qPcvXvcNmmNS+D+g7tHl4DbWikU8eXu 993FwGvVqKjZ1KFl58cnijRKh+y+abIY5VP6aKjc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730024AbgKCV1N (ORCPT ); Tue, 3 Nov 2020 16:27:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:37328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732408AbgKCVBE (ORCPT ); Tue, 3 Nov 2020 16:01:04 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69A6D21534; Tue, 3 Nov 2020 21:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437263; bh=UcQyCLTgQwryco3Bwhib+f4CDyGs+CCQGb+72ObgDws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s8U74sAQf803XeeRA6sTMOA7kZfgNBSroS+CyW5Rr/Lnm4IeoPb5riQdrr/1kUnM7 nu0bej6CzPbUM1wwNRqJzBDOFf9+gjHPAyMFu7Guhx19b77J+0nta4o2BTxHWiPvIc 55ANezPziRhUHJZCoBLGD+DDEEzMKHCdcFNZSObs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jisheng Zhang , Adrian Hunter , Ulf Hansson Subject: [PATCH 5.4 198/214] mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true Date: Tue, 3 Nov 2020 21:37:26 +0100 Message-Id: <20201103203309.204457298@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jisheng Zhang commit b3e1ea16fb39fb6e1a1cf1dbdd6738531de3dc7d upstream. sdhci-of-dwcmshc meets an eMMC read performance regression with below command after commit 427b6514d095 ("mmc: sdhci: Add Auto CMD Auto Select support"): dd if=/dev/mmcblk0 of=/dev/null bs=8192 count=100000 Before the commit, the above command gives 120MB/s After the commit, the above command gives 51.3 MB/s So it looks like sdhci-of-dwcmshc expects Version 4 Mode for Auto CMD Auto Select. Fix the performance degradation by ensuring v4_mode is true to use Auto CMD Auto Select. Fixes: 427b6514d095 ("mmc: sdhci: Add Auto CMD Auto Select support") Signed-off-by: Jisheng Zhang Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20201015174115.4cf2c19a@xhacker.debian Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1162,9 +1162,11 @@ static inline void sdhci_auto_cmd_select /* * In case of Version 4.10 or later, use of 'Auto CMD Auto * Select' is recommended rather than use of 'Auto CMD12 - * Enable' or 'Auto CMD23 Enable'. + * Enable' or 'Auto CMD23 Enable'. We require Version 4 Mode + * here because some controllers (e.g sdhci-of-dwmshc) expect it. */ - if (host->version >= SDHCI_SPEC_410 && (use_cmd12 || use_cmd23)) { + if (host->version >= SDHCI_SPEC_410 && host->v4_mode && + (use_cmd12 || use_cmd23)) { *mode |= SDHCI_TRNS_AUTO_SEL; ctrl2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);