From patchwork Mon Nov 20 18:34:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10067031 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 50B9C602B7 for ; Mon, 20 Nov 2017 18:40:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44D4E29014 for ; Mon, 20 Nov 2017 18:40:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 398962902E; Mon, 20 Nov 2017 18:40:35 +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=unavailable 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 B2EFE29014 for ; Mon, 20 Nov 2017 18:40:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752455AbdKTSfB (ORCPT ); Mon, 20 Nov 2017 13:35:01 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:38141 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752774AbdKTSez (ORCPT ); Mon, 20 Nov 2017 13:34:55 -0500 Received: by mail-pf0-f195.google.com with SMTP id r62so7892615pfd.5 for ; Mon, 20 Nov 2017 10:34:55 -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; bh=MeYmEV8brmhrQsaQFIjVH3Uok0xq5qFQFwZP1JfFmts=; b=KhFlIU71/BgnVad/jG5HNWPTKT4CyufLd2OLpz1IwemZbw/28VHlOxPjr+L10RpgPu 8ydZ2uIxkbN+wS+OEb3YF4xrnF8CTLqfD4x9pSgmuZl/vgfy+Fjjp6ZoMEr8Nqz0L6Bl z4BvtXPqmGWoaxJ+Ap10QydULcfs9L+Egvj5M= 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; bh=MeYmEV8brmhrQsaQFIjVH3Uok0xq5qFQFwZP1JfFmts=; b=ZAIR9uIufnjYth3QD4TuEVNuJoQC9c+NkfMcw09KWnqKZ28n9H4tG9EnZC5O0tjhTw WlvAeVFWieCh9JqnjBAo6AGOFWSU5PvEyMvH34Ad8WaUtUH/Fo10hDCk5bC2m5V8lJ+K 9hHs4b7XUEthAVk710iEofBLKZq39kcKZmwR4PB4H/QheYglAj8b7uyBZAAFlVm8HGSQ ZVSaOM9gTsVKlWlIPk5xTTrvMixHR462Dd29bM49MqADk37teqWAqGzef960CCu9rGq3 Ra7dZiPcjxmHDD8rq6tpzRnEnXKoSdHt3ldrkr4Ca/miRjm7/BO/TaqGxS21O6yU0PJ+ ccQA== X-Gm-Message-State: AJaThX598p8jXOA6x874uSIaM89hkOOx+1SFMu8kReRMhLBcBv9u5mvO y/cBJXhCKqWdRe305HSm4Im6cA== X-Google-Smtp-Source: AGs4zMaqS6NxPFMz2VbItil7cblezJ1XCUpc9XYawXm9Ny+47Q6q1nQcDSDBo3yRtWnN0fMHjttB3A== X-Received: by 10.98.185.8 with SMTP id z8mr3184490pfe.166.1511202895181; Mon, 20 Nov 2017 10:34:55 -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 a24sm22639605pfc.79.2017.11.20.10.34.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 10:34:54 -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, Sahitya Tummala , Vijay Viswanath Subject: [PATCH] mmc: sdhci-msm: Optionally wait for signal level changes Date: Mon, 20 Nov 2017 10:34:51 -0800 Message-Id: <20171120183451.18966-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 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_SIGNAL_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 --- The offending patch is part of your v4.15 pull request, so please pick this up for the -rcs. 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..8f2dda73e6b4 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 SWICHABLE_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 SWICHABLE_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 & SWICHABLE_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