Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3590382ybh; Tue, 17 Mar 2020 03:00:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsJbMZRBdwvBKV4rOjGExY1bluCu0fYISAyTn3GVBadp5RvgXQDqoze7piUG7y+JplQJCS5 X-Received: by 2002:a9d:de8:: with SMTP id 95mr3115242ots.160.1584439205741; Tue, 17 Mar 2020 03:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584439205; cv=none; d=google.com; s=arc-20160816; b=vYPwdgHyqLhdaQwFxfmO5AQlXq0XbYYkFgl5fs2icOqX5/ZDBUyXqtH1Mj4gq5NP92 JcspjLFpqD/IbgdIMhgm40Dg4v6YXXq7hJhoXAUdi8LWk5EYs8n9uA+3zAYtQgU7IVQb NAaf8RyJ+iatt+ZW6mPQjjE1lP8pkQ0ZkrrPKMZQoRLN7msxRkAE5yJLqqTUA+5opyhF hgmRm31PEdFJ099/UOpCyj6Cz0VZYVnxQ6rOQNYtLiqCSWeLO7EqXB5eSap4e/FOH4pw wwwJOMUeEcIqEgM7fc9kDyYoBO4JkHL+RpAfkvMh4tWQseoHMbwknuFkLfZftDRGaTyO yt1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=DAfHVukxUA8yjEGwNIwSkU4sMSUu6T7D7d1Ls7VYJi0=; b=I1iJ4HftVYKCxDtcxqBtCwirwL6TuJlESnA9qp4ZxYE8RO+1GS6Zps4y8B7xB8ejvu gG5zXLM70QngV/NDf/1rRflGISuD4EOXy9HgWCemY9YUW9CNX/pEdSJYKV+3e0QSM2/2 kmBOpcHwe2sPGg92HjteTBT00SrhMFP4sAULP69tiQDAyn+ty/qwvkOBtRahSJayDimF cB9F0ciMNvojacHsMyNK71Z++05UakhiRhZQnbd0i5YqH8assndUQr5RwYlUvMQq8VOB ojV3URg1aXYEnCbpbNtRQT2Fq0BKGJ6Uq42OOexNtbVLI5miAniaxa3+MC8CSmjQV84f SGuA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si1550794otn.64.2020.03.17.02.59.53; Tue, 17 Mar 2020 03:00:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726680AbgCQJ55 (ORCPT + 99 others); Tue, 17 Mar 2020 05:57:57 -0400 Received: from mga14.intel.com ([192.55.52.115]:39045 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbgCQJ5s (ORCPT ); Tue, 17 Mar 2020 05:57:48 -0400 IronPort-SDR: Qltgi2wKZcZUeVY3mmRYUx3HSyLVptyixBkBuYfWsoaEj8GdxXQwaLIPAecT42LzJBwyO5sEsH aMDK2mqPjz6w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 02:57:47 -0700 IronPort-SDR: AXxfFlexHGkT4CGeJ3felSJPRCzQqgJDsZxjRmIw7WSVV4bXyGvJvHF4z90wxa1j2H30mVKcrb wH7I4dFTDQPg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,564,1574150400"; d="scan'208";a="443699264" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.87]) ([10.237.72.87]) by fmsmga005.fm.intel.com with ESMTP; 17 Mar 2020 02:57:45 -0700 Subject: Re: [PATCH] mmc: sdhci-of-at91: fix cd-gpios for SAMA5D2 To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <8d10950d9940468577daef4772b82a071b204716.1584290561.git.mirq-linux@rere.qmqm.pl> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <7b5c5f2e-a10f-88b5-907c-dfbf6eaa43c6@intel.com> Date: Tue, 17 Mar 2020 11:57:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <8d10950d9940468577daef4772b82a071b204716.1584290561.git.mirq-linux@rere.qmqm.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/03/20 6:44 pm, Michał Mirosław wrote: > SAMA5D2x doesn't drive CMD line if GPIO is used as CD line (at least > SAMA5D27 doesn't). Fix this by forcing card-detect in the module > if module-controlled CD is not used. > > Fixed commit addresses the problem only for non-removable cards. This > amends it to also cover gpio-cd case. > > Cc: stable@vger.kernel.org > Fixes: 7a1e3f143176 ("mmc: sdhci-of-at91: force card detect value for non removable devices") > Signed-off-by: Michał Mirosław Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-of-at91.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c > index d90f4ed18283..8f8da2fe48a9 100644 > --- a/drivers/mmc/host/sdhci-of-at91.c > +++ b/drivers/mmc/host/sdhci-of-at91.c > @@ -185,7 +185,8 @@ static void sdhci_at91_reset(struct sdhci_host *host, u8 mask) > > sdhci_reset(host, mask); > > - if (host->mmc->caps & MMC_CAP_NONREMOVABLE) > + if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) > + || mmc_gpio_get_cd(host->mmc) >= 0) > sdhci_at91_set_force_card_detect(host); > > if (priv->cal_always_on && (mask & SDHCI_RESET_ALL)) > @@ -487,8 +488,11 @@ static int sdhci_at91_probe(struct platform_device *pdev) > * detection procedure using the SDMCC_CD signal is bypassed. > * This bit is reset when a software reset for all command is performed > * so we need to implement our own reset function to set back this bit. > + * > + * WA: SAMA5D2 doesn't drive CMD if using CD GPIO line. > */ > - if (host->mmc->caps & MMC_CAP_NONREMOVABLE) > + if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) > + || mmc_gpio_get_cd(host->mmc) >= 0) > sdhci_at91_set_force_card_detect(host); > > pm_runtime_put_autosuspend(&pdev->dev); >