Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4800225imm; Mon, 18 Jun 2018 23:29:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIp+Urg98VmG6vLnsqjVHKVMQe7Un6U6xqRcvzhKFYUchHjsivRhqT8jJ1/Z80iW1sxOQQv X-Received: by 2002:a62:8b0a:: with SMTP id j10-v6mr16642477pfe.28.1529389753187; Mon, 18 Jun 2018 23:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529389753; cv=none; d=google.com; s=arc-20160816; b=ZdisjF1q8wFYPsA8Bn1kE7a0uain+QbEKXyxlhtCTYwJINORz/cxkr+fRBmv0D297G DdOMbx5B/ru0sN6uq7pL/PV+JTcz+Q/ZE5CPQ/LurPXO8YJgzBQb78zzAZKbnPYbsVrp 8hrltQrmDV15cTOb1tM1IUqwijfBVBYrxuiBxH/QSgpAzIkQr9JqKBDEkqcMUwu6W3lu 8HpZybQXTfkzI8cFh6N79uV9MbDPmHNtFt2j/8Cw9PZOBC1enGlbt4rV0bWduZS/JAEV af6lSCOFAgdtwHDnBhXzEg15M/x0c0kZ1f5RSmQz2ejxqwuMQKPTKTv3isCgrevjviTu X7CQ== 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:arc-authentication-results; bh=SAhObleLGqUjygphleN11vsYkhEpBmkbpspeuqAFP0Y=; b=kf9b3HJEHT1fa7LYpxfvFcwsbvvE7i1AJOO9QvSJuqxmHiIcFcPinyg4LrCwAKvlkS 73O9XuuT1eW9UcreVl9EqDi1VSW4Nvi1jenFtPA1yo8m27udIyqLLp1Y3lgGJipTzcNk RZ8oavTJeFOceMZL0i/ktRyrxWMHeng5fMYyPpvJXF9XLlxyOzK0PfwR0+dd72H1Sg8h vThLGcVW8zRbTxI8dq/M+mrfUMPlltt1OSG28kNleGFjPAnIeCNUpIdlC/MqYK89nmzD U4m+JQDpP16UUPq5jeyPFrV0XRbHnBD7O8hEhHmvJnAUOqLDXgv7exJ5BBc6DVn0yEW8 0u3Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f26-v6si15349881pfn.366.2018.06.18.23.28.58; Mon, 18 Jun 2018 23:29:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937236AbeFSG2T (ORCPT + 99 others); Tue, 19 Jun 2018 02:28:19 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:56342 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755560AbeFSG2S (ORCPT ); Tue, 19 Jun 2018 02:28:18 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=kurt.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fVA7h-0000c1-CH; Tue, 19 Jun 2018 08:28:13 +0200 From: Kurt Kanzenbach To: adrian.hunter@intel.com Cc: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, kurt@linutronix.de Subject: [PATCH 1/1] mmc: sdhci-pci: fix eMMC controller issue on Intel Baytrail SoCs Date: Tue, 19 Jun 2018 08:31:19 +0200 Message-Id: <20180619063119.3955-2-kurt@linutronix.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180619063119.3955-1-kurt@linutronix.de> References: <20180619063119.3955-1-kurt@linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes the eMMC controller doesn't respond anymore on Intel Baytrail SoCs. The resulting error looks like: |mmc1: Reset 0x1 never completed. |sdhci: =========== REGISTER DUMP (mmc1)=========== |sdhci: Sys addr: 0xffffffff | Version: 0x0000ffff |sdhci: Blk size: 0x0000ffff | Blk cnt: 0x0000ffff |sdhci: Argument: 0xffffffff | Trn mode: 0x0000ffff |sdhci: Present: 0xffffffff | Host ctl: 0x000000ff |sdhci: Power: 0x000000ff | Blk gap: 0x000000ff |sdhci: Wake-up: 0x000000ff | Clock: 0x0000ffff |sdhci: Timeout: 0x000000ff | Int stat: 0xffffffff |sdhci: Int enab: 0xffffffff | Sig enab: 0xffffffff |sdhci: AC12 err: 0x0000ffff | Slot int: 0x0000ffff |sdhci: Caps: 0xffffffff | Caps_1: 0xffffffff |sdhci: Cmd: 0x0000ffff | Max curr: 0xffffffff |sdhci: Host ctl2: 0x0000ffff |sdhci: ADMA Err: 0xffffffff | ADMA Ptr: 0xffffffff The behavior was observed on an Intel Atom E3825 performing lots of reboots. The issue seems to occur if runtime power management is used. Found by utilizing ftrace. The erratum VLI10 for the Intel E3825 states, that the eMMC controller incorrectly announces that it supports suspend/resume. However, that shouldn't be used, as the controller may incorrectly transfer data between memory and the SD device. Therefore, disallowing runtime pm resolves the issue. Tested on the E3825. Signed-off-by: Kurt Kanzenbach --- drivers/mmc/host/sdhci-pci-core.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 77dd3521daae..df89381944cd 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -870,6 +870,21 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_emmc = { .priv_size = sizeof(struct intel_host), }; +/* + * See Erratum VLI10 from Errata List for Intel Atom E3825, Link: + * https://www.intel.ca/content/dam/www/public/us/en/documents/specification-updates/atom-e3800-family-spec-update.pdf + */ +static const struct sdhci_pci_fixes sdhci_intel_byt_emmc_no_runtime_pm = { + .allow_runtime_pm = false, + .probe_slot = byt_emmc_probe_slot, + .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 | + SDHCI_QUIRK2_STOP_WITH_TC, + .ops = &sdhci_intel_byt_ops, + .priv_size = sizeof(struct intel_host), +}; + static const struct sdhci_pci_fixes sdhci_intel_glk_emmc = { .allow_runtime_pm = true, .probe_slot = glk_emmc_probe_slot, @@ -1470,7 +1485,7 @@ static const struct pci_device_id pci_ids[] = { SDHCI_PCI_SUBDEVICE(INTEL, BYT_SDIO, NI, 7884, ni_byt_sdio), SDHCI_PCI_DEVICE(INTEL, BYT_SDIO, intel_byt_sdio), SDHCI_PCI_DEVICE(INTEL, BYT_SD, intel_byt_sd), - SDHCI_PCI_DEVICE(INTEL, BYT_EMMC2, intel_byt_emmc), + SDHCI_PCI_DEVICE(INTEL, BYT_EMMC2, intel_byt_emmc_no_runtime_pm), SDHCI_PCI_DEVICE(INTEL, BSW_EMMC, intel_byt_emmc), SDHCI_PCI_DEVICE(INTEL, BSW_SDIO, intel_byt_sdio), SDHCI_PCI_DEVICE(INTEL, BSW_SD, intel_byt_sd), -- 2.11.0