From patchwork Thu Jun 11 22:08:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 6592771 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0411C9F2F4 for ; Thu, 11 Jun 2015 22:15:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13597205CD for ; Thu, 11 Jun 2015 22:15:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04C932061B for ; Thu, 11 Jun 2015 22:15:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752207AbbFKWP0 (ORCPT ); Thu, 11 Jun 2015 18:15:26 -0400 Received: from mail-yk0-f177.google.com ([209.85.160.177]:34088 "EHLO mail-yk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750999AbbFKWP0 (ORCPT ); Thu, 11 Jun 2015 18:15:26 -0400 Received: by ykfl8 with SMTP id l8so8874867ykf.1; Thu, 11 Jun 2015 15:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=OjNj0xtlx6LugiQxikMhfy0SZYs/ybun9zZewFQIGps=; b=ecX9DoEGcJ6vu9e5PzH/BZ7wjhxrj6KHYzLjlWA0jUY9V/ha1K4QZExtdEyixqidRa WFRs7yf3NTVFbd2NjR7TG2JusOV1T94m4g7xi45/p1Q13Qbn+yGK2zFaCqGsuHpG91o7 +88+yJw76YVlfhQkBIvvc99+XKP+Uf2gIaKmY4OylIHhWrLTOPGxRv0o7mfE8u8claS5 eSXEbPixnqpCJLP6VAr7cz21340XgrvUip1mB9lYBUQLXl+XywavD/hfh2xOWn9wFypb suD1MaQBTFCYLpJzixEaTxA+AIvV3/nDJ+CAMYGkcSmfzLyCZxQE1sF91NLPk4RLola5 T3/w== X-Received: by 10.170.157.87 with SMTP id y84mr14717551ykc.28.1434060530720; Thu, 11 Jun 2015 15:08:50 -0700 (PDT) Received: from localhost.localdomain ([201.82.153.71]) by mx.google.com with ESMTPSA id c23sm758959yha.45.2015.06.11.15.08.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Jun 2015 15:08:49 -0700 (PDT) From: Fabio Estevam To: ulf.hansson@linaro.org Cc: aisheng.dong@freescale.com, kevin.lemoi@savant.com, otavio@ossystems.com.br, kernel@pengutronix.de, linux@arm.linux.org.uk, linux-mmc@vger.kernel.org, Fabio Estevam , stable@vger.kernel.org Subject: [PATCH] mmc: sdhci-esdhc-imx: Do not set MMC_CAP_1_8V_DDR in the 'no-1-8-v' case Date: Thu, 11 Jun 2015 19:08:23 -0300 Message-Id: <1434060503-10260-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam Since commit e2997c944dbdff3f ("mmc: sdhci-esdhc-imx: add MMC_CAP_1_8V_DDR for mx6") the driver sets the MMC_CAP_1_8V_DDR flag unconditionally on mx6, but we should not do this when the 'no-1-8-v' property is passed via device tree. This causes the following errors when accessing eMMC on a mx6sl board: mmc0: MAN_BKOPS_EN bit is not set mmc0: power class selection to bus width 8 ddr 4 failed mmc0: error -110 whilst initialising MMC card So only set the MMC_CAP_1_8V_DDR flag when the 'no-1-8-v' property is absent. With this fix in place it is possible to successfully mount the rootfs from the emmc on a mx6sl board which has 'no-1-8-v' property passed in the device tree. Fixes: e2997c944dbdff3f ("mmc: sdhci-esdhc-imx: add MMC_CAP_1_8V_DDR for mx6") Cc: stable@vger.kernel.org Reported-by: Kevin Lemoi Signed-off-by: Fabio Estevam --- drivers/mmc/host/sdhci-esdhc-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index faf0cb9..b562faf 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1005,7 +1005,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) if (esdhc_is_usdhc(imx_data)) { writel(0x08100810, host->ioaddr + ESDHC_WTMK_LVL); host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN; - host->mmc->caps |= MMC_CAP_1_8V_DDR; if (!(imx_data->socdata->flags & ESDHC_FLAG_HS200)) host->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200; @@ -1094,6 +1093,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) /* sdr50 and sdr104 needs work on 1.8v signal voltage */ if ((boarddata->support_vsel) && esdhc_is_usdhc(imx_data) && !IS_ERR(imx_data->pins_default)) { + host->mmc->caps |= MMC_CAP_1_8V_DDR; imx_data->pins_100mhz = pinctrl_lookup_state(imx_data->pinctrl, ESDHC_PINCTRL_STATE_100MHZ); imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl,