Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp882934pxb; Tue, 3 Nov 2020 15:27:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKlbhO3cOqL6iJzx69FHNCv1oJqCOLQWtMFPJLJHvp4Rk1XLQ5zhdiUrA4X+LAon4aNo/f X-Received: by 2002:a17:906:580e:: with SMTP id m14mr21634217ejq.237.1604446044480; Tue, 03 Nov 2020 15:27:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604446044; cv=none; d=google.com; s=arc-20160816; b=1Fw5oAUWWFu7KUJBiHaQI5FN4eSQ0nClbgARVSIfmtnPXqu2WPfuA6mGklp/x2W39c qZN6hguVKUv2arN+VFOijS/NeERyF7eHHeyyIRUMGKYrWQm13lsoWFylI+bYi8c4FvKm TpMnyM4xlkaDVanjNcC+f+Q0qlJx2V43NxWRwEOwUCUg7qp0x1i6sF8mM4LW5TDrFvQR 5DsuvXX2sfSPnSzP2CDiiZ25pVXnJxY/TzyeBf/UXFnwTyP7MuAeISrSDOT52xiUrjHO e2g/u74RJlaeuf+LzaxyxoOLYjn0IWBF0RPw2X9iqSoxrmV3y5jYRdraIa7A4oGa/WVT 3ibw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FR7kwLmGDRM/TTP10BynjaodyvnyC9J6MmhbJsjvVLY=; b=x8k7pxvKAuLDPBXEMwHUhXQmpC7uvqsF4aLGiquE3zz9GmaeOVBB4TLAI93jzzC9hZ hsSdOLU35aj5It/A8D54ym8lKzo1rUKlGdmL78NH/7+Gth4e2vryian9F4eZLTMkqV0Y pgs4nJPNq8e/gd6L06YqzXJ8fKB1oRLu4asK9eXSjz6OeQHrjdrmiyQkgpcbFZ8IXh/F DyJFmhPKPtj2sEsY6l8YSqgc92BuZa7CtVtpsuEssyMZu6KhaqZE0NqKVK9HR4olpWrb PuLBZboIPl9uLwrMkminWdW5NpCUEFYj5YbuXFMLQ/zsiHsnYF74y26WotraxThJO6DQ E10A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s8U74sAQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si103177edq.262.2020.11.03.15.27.01; Tue, 03 Nov 2020 15:27:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s8U74sAQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733099AbgKCV1P (ORCPT + 99 others); Tue, 3 Nov 2020 16:27:15 -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: linux-kernel@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);