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: 119300 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4211859qgn; Mon, 20 Nov 2017 10:35:02 -0800 (PST) X-Google-Smtp-Source: AGs4zMYpSiM8Y16LCHswPaSdj+8APCRYx8/YTE6FAc3Tbwf2U0lvHDyhDW579G0rLg6m41cEaOGE X-Received: by 10.98.202.133 with SMTP id y5mr12357485pfk.122.1511202902152; Mon, 20 Nov 2017 10:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511202902; cv=none; d=google.com; s=arc-20160816; b=IxwaaH5pgaV1TRIyxeQ7lbnCcSyPRya4Mr2KzcVk3QRm+8qDAKgtdmUoHQQZ8Vzg06 2zbN5dFdnPLIHWl9sBqS5rOP51r1oU1KlWZaREOLVa1h48xr4iIlB0xvh5oMy+gXaVY1 O8AOF3SIqZWOtVf7MTKdWijPe+z0vnWGX0BKMLeXagYqT6Fq0mazUEhPhsKNvc7/s65L SdoVmZ4O9o+Ppd0KPXufruOZctjOIUninl0GVsxJQiri6si/tWQNMOAFEqHLCB7gAk7J q/x9bKKXW9SZBabfq4uuBkw9VHXzDG4VvrVjIYYpEEpZF+mcYiiYpzNG2zECfE4TJmsK Gnkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=lvDBFEjKT7fStZKyKxRlye1Y07JFc4VgHl0mq2vkxuI=; b=zSe6FngWoJhDJGPThIOxO+Nn7F6RsLhfTrGEQLUI+GHab3oiMTAzOku818vm0S8XNW P78Ew0sb69Yf6gGYU+BcPYLhTZUGnkyuAQ0boyOh14psWrLZvfDIECtX31TWbkaF5UcF 4kQlDJTz0Sn6jBLg5powkwr86xaBW8bbfGHqSfXGB5t92vqzMfJrAH0ZZ0mn+sYKZyWl UqW2wQ79d8NyTBQ07Gq8olO/Cdzdep8rXcnDRSRR3fysP3PqDA9x/m5iKp9sZA7BtMQc It6yAxgwqj2XfPu7BVxxbCQp18SI9YqZoN86Y0GAe00XOQXiRk28ek0/txuXEDMorytj Y0iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KhFlIU71; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si8776216pgn.37.2017.11.20.10.35.01; Mon, 20 Nov 2017 10:35:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KhFlIU71; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752051AbdKTSe6 (ORCPT + 10 others); Mon, 20 Nov 2017 13:34:58 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:41406 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752545AbdKTSez (ORCPT ); Mon, 20 Nov 2017 13:34:55 -0500 Received: by mail-pf0-f196.google.com with SMTP id j28so7880027pfk.8 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=RJ6AgcPjLyjAxx6kl/nxM4t3c5azkB1cei/iuJfez2mAKOvcLnI6+oQ4OOvdQZL6d0 oFb/sSEPi4K28iN8dnmGhIPoJORIH0kVSvQPx7HGhsfMc8s2jgwr/i40vcbCdwtp8S+x 6OwHLYxniAl/LifLRSuLxH/XEFgDgcQiKWAcwGE/tIAD0e8yA4GdsWEJzuN/hRDhfNY8 0lV6xsMdX/oIX08WUFhsNr2p/E05uo3+0N1fD9tC+PyNBboKyHNOW1lYZ9vmxwrudc5k KLL+W1TdC18IRUne9r9e1fFZOpm0fhXtndwtSSdN2o2Shi/d+akDTMq4b7Inq5wFnjm9 YX9Q== X-Gm-Message-State: AJaThX64hAZp0gyVscsbAPqH4UrhH153RVa7yJaE4B0uT3G/ICT/hCJ8 RQVIdbIIZg2I/ow4UcxiFY0L/Q== 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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(+) -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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