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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,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 25DA7C3A5A8 for ; Wed, 4 Sep 2019 18:14:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE6E92087E for ; Wed, 4 Sep 2019 18:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620885; bh=2yoVyZHUw19o1kpTAXlMkoYYOYXEkWT1PtvYSd40/5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AgoOL/mJIjhtGvLP1bA05IBt9CWMMYcKuB7yqneXr2Lz7HxmsUhNl39idA2xP6kwx Z9eXJ51kP6we5O2SrYCR0tsvpHhuzky3yKM3rOpDNWGUfDj9yrYLaXlqM2TwKmyyYH 5YVQJWGNEtEy5Sr9+bAD9K0MbZRRdUEPzRsaZxrQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731827AbfIDSOn (ORCPT ); Wed, 4 Sep 2019 14:14:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:60008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390568AbfIDSOm (ORCPT ); Wed, 4 Sep 2019 14:14:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 B8F38208E4; Wed, 4 Sep 2019 18:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620881; bh=2yoVyZHUw19o1kpTAXlMkoYYOYXEkWT1PtvYSd40/5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RC1Vp6dnuiCEE5kf4Juga0VnWi4NS2AFiA07slEp1C4MBDJVTDNmkthFJFP876gxi cSArSQOOpHZa8hPp1xDUPqeDpQU6GCdTx5AAqX2ILJmWxVwSOqEorSdMiWRIE0OVAP Dtq3S53m4ZBFy7ZQRajIxZ2H5avrz1NaKiny7O9M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunyan Zhang , Chunyan Zhang , Baolin Wang , Ulf Hansson , Sasha Levin Subject: [PATCH 5.2 129/143] mmc: sdhci-sprd: clear the UHS-I modes read from registers Date: Wed, 4 Sep 2019 19:54:32 +0200 Message-Id: <20190904175319.453014946@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 2f765c175e1d1acae911f889e71e5933c6488929 ] sprd's sd host controller supports SDR50/SDR104/DDR50 though, the UHS-I mode used by the specific card can be selected via devicetree only. Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller") Signed-off-by: Chunyan Zhang Signed-off-by: Chunyan Zhang Reviewed-by: Baolin Wang Tested-by: Baolin Wang Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-sprd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index dee30aa23cf72..9d0f58a665276 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -320,7 +320,8 @@ static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) static const struct sdhci_pltfm_data sdhci_sprd_pdata = { .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | - SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | + SDHCI_QUIRK_MISSING_CAPS, .quirks2 = SDHCI_QUIRK2_BROKEN_HS200 | SDHCI_QUIRK2_USE_32BIT_BLK_CNT | SDHCI_QUIRK2_PRESET_VALUE_BROKEN, @@ -389,6 +390,16 @@ static int sdhci_sprd_probe(struct platform_device *pdev) sdhci_enable_v4_mode(host); + /* + * Supply the existing CAPS, but clear the UHS-I modes. This + * will allow these modes to be specified only by device + * tree properties through mmc_of_parse(). + */ + host->caps = sdhci_readl(host, SDHCI_CAPABILITIES); + host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1); + host->caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 | + SDHCI_SUPPORT_DDR50); + ret = sdhci_setup_host(host); if (ret) goto pm_runtime_disable; -- 2.20.1