From patchwork Mon Nov 20 19:56:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10067173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C67F6038F for ; Mon, 20 Nov 2017 19:56:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0425529434 for ; Mon, 20 Nov 2017 19:56:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECDA62943A; Mon, 20 Nov 2017 19:56:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B97729434 for ; Mon, 20 Nov 2017 19:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752427AbdKTT4x (ORCPT ); Mon, 20 Nov 2017 14:56:53 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:47083 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752398AbdKTT4w (ORCPT ); Mon, 20 Nov 2017 14:56:52 -0500 Received: by mail-pg0-f67.google.com with SMTP id z184so8201388pgd.13 for ; Mon, 20 Nov 2017 11:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to; bh=g4jKf9QcNf6Z3iq/hnSpbUox0NaTJjJJ4NyjunGGT/k=; b=hRmufYtXV7iE4VFVLDp1QAOyCQ9K9d93zncaocFdewa0DbrQia1aqdaooZIA7mR/Yj BzNpLzcuXkdwk+62YpDxnOc1sYaO56BlIXIvrm+bOl+5tFtz6m1g/uFBOUSoEuq6hhME 8qi0QzNSpfwFa7kOhHS3XAneUlq8obeZ+ul7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to; bh=g4jKf9QcNf6Z3iq/hnSpbUox0NaTJjJJ4NyjunGGT/k=; b=aTYMDUU1ZXM6iVZjHSukpJ5SnxOAgeoXDas8WbZM074zTg+EcM3vTVBQABqCHn2PR5 vue8vRGNmS8bHyanzN2nfQV8f0GsTjb/QTGl6QWkViUgLfGbmDeSY9v9uMhAwzjt00Fg OHXM0HUyDv6UaVV+LtZfAwsY59hDzAuXYCvTRYYn/3j+PTQMdWz1O+yW6qa2Rnfl4jxr Rm55MhNS4wjRjHGqn58U0fdhwZPm9b5oQKnUh27WmEFc6hO/gXchIASr4tIYzhhY7VUy 2c1Gs8bXGCGJNQefQNvjquxqqMC1DlkBxZTngfxHHjzHrMiLtJ0OIRzOPpg/ED6ZgqKy 0QPw== X-Gm-Message-State: AJaThX6uCH3NFqx26ADPJeMUTaI63IyDnHpw8J1vL66UCW2SLMNRmOXX 7ijd9K2buLL6bneEc+Gpr1cSKw== X-Google-Smtp-Source: AGs4zMa8Ao1UDubzldjuZujZp5hsoB9nveDghbdV7QN7m8Vvrn4bSJqd48vlyCUmFqKdtLloxOfDjw== X-Received: by 10.99.95.12 with SMTP id t12mr3600978pgb.40.1511207812116; Mon, 20 Nov 2017 11:56:52 -0800 (PST) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id d8sm23644868pfh.178.2017.11.20.11.56.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 11:56:51 -0800 (PST) From: Bjorn Andersson To: Adrian Hunter , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stephen Boyd , Sahitya Tummala , Vijay Viswanath Subject: [PATCH v2] mmc: sdhci-msm: Optionally wait for signal level changes Date: Mon, 20 Nov 2017 11:56:47 -0800 Message-Id: <20171120195647.22677-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171120183451.18966-1-bjorn.andersson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Not all instances of the SDCC core supports changing signal voltage and as such will not generate a power interrupt when the software attempts to change the voltage. This results in probing the eMMC on some devices to take over 2 minutes. Check that the SWITCHABLE_SIGNALING_VOLTAGE bit in MCI_GENERICS is set before waiting for the power interrupt. Cc: Sahitya Tummala Cc: Vijay Viswanath Fixes: c0309b3803fe ("mmc: sdhci-msm: Add sdhci msm register write APIs which wait for pwr irq") Signed-off-by: Bjorn Andersson Tested-by: Luca Weiss --- The offending patch is part of your v4.15 pull request, so please pick this up for the -rcs. Changes since v1: - Fixed spelling of swichable... drivers/mmc/host/sdhci-msm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 3fb7d2eec93f..c283291db705 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -29,6 +29,9 @@ #define CORE_VERSION_MAJOR_MASK (0xf << CORE_VERSION_MAJOR_SHIFT) #define CORE_VERSION_MINOR_MASK 0xff +#define CORE_MCI_GENERICS 0x70 +#define SWITCHABLE_SIGNALING_VOLTAGE BIT(29) + #define CORE_HC_MODE 0x78 #define HC_MODE_EN 0x1 #define CORE_POWER 0x0 @@ -1028,11 +1031,22 @@ static void sdhci_msm_check_power_status(struct sdhci_host *host, u32 req_type) struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); bool done = false; + u32 val; pr_debug("%s: %s: request %d curr_pwr_state %x curr_io_level %x\n", mmc_hostname(host->mmc), __func__, req_type, msm_host->curr_pwr_state, msm_host->curr_io_level); + /* + * The power interrupt will not be generated for signal voltage + * switches if SWITCHABLE_SIGNALING_VOLTAGE in MCI_GENERICS is not set. + */ + val = readl(msm_host->core_mem + CORE_MCI_GENERICS); + if ((req_type & REQ_IO_HIGH || req_type & REQ_IO_LOW) && + !(val & SWITCHABLE_SIGNALING_VOLTAGE)) { + return; + } + /* * The IRQ for request type IO High/LOW will be generated when - * there is a state change in 1.8V enable bit (bit 3) of