From patchwork Wed Nov 25 14:39:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlo Caione X-Patchwork-Id: 7699861 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DE6EDBF90C for ; Wed, 25 Nov 2015 14:40:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07D93207D2 for ; Wed, 25 Nov 2015 14:40:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2C822081E for ; Wed, 25 Nov 2015 14:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752901AbbKYOk1 (ORCPT ); Wed, 25 Nov 2015 09:40:27 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:34830 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753314AbbKYOj7 (ORCPT ); Wed, 25 Nov 2015 09:39:59 -0500 Received: by wmuu63 with SMTP id u63so140690156wmu.0 for ; Wed, 25 Nov 2015 06:39:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=pad+583CjG8In9qJ7GyWN3gTZArlD0vwkRniJwpWLAc=; b=qlTtVtS62pA2JYCHd4GecvD8d3eqht1kGKFYUzk8MTZ8/3r/zIUjGBdBxG28CwyhOV WagbkykqKyObkIUd7wvkbwoSIr9RS2TaFkasQ8I5WEscl6hEHKh/of8Z+pJqp4l9k+WL RJ9sAbxF2OChB0KbquGx5XBe3VwQ6Q7toPp8eRa6csPZ4bjekEVpjXsb3l09+Sy7PmIw aGFtRQqisdcd9oK+m/6Ej24PPklMnBMU7VArVJP7toxWcMjwFT6eYpnl0/EIBd5YJIDt Z7p5xMCkPvWG3EcGv8cPBedGM750kM2CCf74lyVmCO36MBCXwlTC3xnFLfyvYvMmp8Na Qb5g== X-Received: by 10.28.65.213 with SMTP id o204mr4738799wma.83.1448462398113; Wed, 25 Nov 2015 06:39:58 -0800 (PST) Received: from localhost.localdomain ([212.91.95.170]) by smtp.gmail.com with ESMTPSA id n7sm3803668wmf.21.2015.11.25.06.39.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 06:39:57 -0800 (PST) From: Carlo Caione To: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, drake@endlessm.com Cc: Carlo Caione Subject: [PATCH v2] mmc: core: Introduce MMC_CAP2_NO_SDIO cap Date: Wed, 25 Nov 2015 15:39:51 +0100 Message-Id: <1448462391-22480-1-git-send-email-carlo@caione.org> X-Mailer: git-send-email 2.5.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Carlo Caione This patch introduce a new MMC_CAP2_NO_SDIO cap used to tell the mmc core to not send SDIO specific commands. Signed-off-by: Carlo Caione --- Drivers fix will follow. Changelog: * v2: - moved check from __mmc_start_request to mmc_rescan_try_freq --- drivers/mmc/core/core.c | 11 ++++++++--- include/linux/mmc/host.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 5ae89e4..8a4e0d2 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2476,15 +2476,20 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) * sdio_reset sends CMD52 to reset card. Since we do not know * if the card is being re-initialized, just send it. CMD52 * should be ignored by SD/eMMC cards. + * Skip it if we already know that we do not support SDIO commands */ - sdio_reset(host); + if (!(host->caps2 & MMC_CAP2_NO_SDIO)) + sdio_reset(host); + mmc_go_idle(host); mmc_send_if_cond(host, host->ocr_avail); /* Order's important: probe SDIO, then SD, then MMC */ - if (!mmc_attach_sdio(host)) - return 0; + if (!(host->caps2 & MMC_CAP2_NO_SDIO)) + if (!mmc_attach_sdio(host)) + return 0; + if (!mmc_attach_sd(host)) return 0; if (!mmc_attach_mmc(host)) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 8673ffe..cf6d0bb 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -289,6 +289,7 @@ struct mmc_host { #define MMC_CAP2_HSX00_1_2V (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V) #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17) #define MMC_CAP2_NO_WRITE_PROTECT (1 << 18) /* No physical write protect pin, assume that card is always read-write */ +#define MMC_CAP2_NO_SDIO (1 << 19) /* Do not send SDIO commands during initialization */ mmc_pm_flag_t pm_caps; /* supported pm features */