From patchwork Tue Jun 18 15:34:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11002035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5A22112C for ; Tue, 18 Jun 2019 15:35:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6D2728AA4 for ; Tue, 18 Jun 2019 15:35:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9952D28AA5; Tue, 18 Jun 2019 15:35:03 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 483C328AA4 for ; Tue, 18 Jun 2019 15:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729514AbfFRPfC (ORCPT ); Tue, 18 Jun 2019 11:35:02 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34894 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729285AbfFRPfC (ORCPT ); Tue, 18 Jun 2019 11:35:02 -0400 Received: by mail-lf1-f68.google.com with SMTP id a25so9640102lfg.2 for ; Tue, 18 Jun 2019 08:35:01 -0700 (PDT) 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:references; bh=ZXFe8l122poOCFrcN8cZI3D2EE1Nc366dY+GJ8RNKw4=; b=VBR0Zcst/y6Zg7oIQ4mCiOZS9J4Gla0OUrgxhrMyHzEX3xyIlkxoYPJ5WnVcOwRdPe xWKodz+F4ubwZAi3LVLAOmbh3sGvqYCT4fb7hu9NqFdIV8folFmY/Iw2nC4vj+54N0DQ 3rhY0tHUiuUUPz7ADBDPvIzCWmjyiTTvPnzP5PYVyo8DOLizYbCzaRYXvaKR3Jds24pY 83Z6HVJhtk3eDVKic08lSLmasQr0e3102/hWgIOKrkdAMHO6PgYjuDAvRZJs9o6iJFSR mcjHJjyR26i8a4mjI/ZXNE4cTrnxyN94674N5liojrdPmAoewMaZorggNXMMnPNLjTDh EVRA== 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 :references; bh=ZXFe8l122poOCFrcN8cZI3D2EE1Nc366dY+GJ8RNKw4=; b=Mfhn1/wJADX5GgbZIwz0h893mREyGqcZitO3WaEOb2gcASw/75ZsF1ItpK3KO1kg1R +46o48wTz2EK8xMcbkMcM1l1TrM+no0dO9VC5BdtB0Vp2bBAkMWtxT2Gu8TeBscus45G u0iAW+vTzCo4iQWw2dg6SHWH9KY9Gc+rQfciZHC5mPGcBO8DHqhbRVTtFLxME6aI+vi+ o5Sjz32hr0P1/qFKFUfgea/Sv4N6ZYMB3+iLhPYz1pb1qfAz4ZRu9muC1iCxwlZe4ix6 1UnrL08/Q5jCCOEEYpS0ky6iP7HF5//C/5oWvLrJlWLSnr0NuPX89A9GaqNFAlkYW2xy I4/g== X-Gm-Message-State: APjAAAX7lesvLINvyVeL7Tt+iz2FqAnTNRvv1KhI4Pq32vfWnAT1qT/g pRkRPzMYyydj6c0Lys+x3FF9VpV3HF4= X-Google-Smtp-Source: APXvYqyOREFdkP4FC4HW7yzVMISId5ZhI6EQ+UQ/bNuv27HzdT0y6uvxlbXF6tdziRwwwuG91a5bpw== X-Received: by 2002:a19:750b:: with SMTP id y11mr21457683lfe.16.1560872099899; Tue, 18 Jun 2019 08:34:59 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id d15sm2203121lfq.76.2019.06.18.08.34.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 08:34:59 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson Cc: Brian Norris , Shawn Lin , Guenter Roeck , Heiko Stuebner , Kalle Valo , Arend Van Spriel , linux-wireless@vger.kernel.org Subject: [PATCH 1/7] mmc: sdio: Turn sdio_run_irqs() into static Date: Tue, 18 Jun 2019 17:34:42 +0200 Message-Id: <20190618153448.27145-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618153448.27145-1-ulf.hansson@linaro.org> References: <20190618153448.27145-1-ulf.hansson@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 All external users of sdio_run_irqs() have converted into using the preferred sdio_signal_irq() interface, thus not calling the function directly any more. Avoid further new users of it, by turning it into static. Suggested-by: Douglas Anderson Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson --- drivers/mmc/core/sdio_irq.c | 3 +-- include/linux/mmc/host.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 9f54a259a1b3..0bcc5e83bd1a 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -92,7 +92,7 @@ static int process_sdio_pending_irqs(struct mmc_host *host) return ret; } -void sdio_run_irqs(struct mmc_host *host) +static void sdio_run_irqs(struct mmc_host *host) { mmc_claim_host(host); if (host->sdio_irqs) { @@ -103,7 +103,6 @@ void sdio_run_irqs(struct mmc_host *host) } mmc_release_host(host); } -EXPORT_SYMBOL_GPL(sdio_run_irqs); void sdio_irq_work(struct work_struct *work) { diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index ecb7972e2423..a9b12322c775 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -504,7 +504,6 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host) wake_up_process(host->sdio_irq_thread); } -void sdio_run_irqs(struct mmc_host *host); void sdio_signal_irq(struct mmc_host *host); #ifdef CONFIG_REGULATOR From patchwork Tue Jun 18 15:34:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11002041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A38971902 for ; Tue, 18 Jun 2019 15:35:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9553528A8E for ; Tue, 18 Jun 2019 15:35:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93D3728AA5; Tue, 18 Jun 2019 15:35:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 35CEA28AA4 for ; Tue, 18 Jun 2019 15:35:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729189AbfFRPfD (ORCPT ); Tue, 18 Jun 2019 11:35:03 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43906 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729455AbfFRPfD (ORCPT ); Tue, 18 Jun 2019 11:35:03 -0400 Received: by mail-lj1-f193.google.com with SMTP id 16so13577581ljv.10 for ; Tue, 18 Jun 2019 08:35:02 -0700 (PDT) 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:references; bh=DYh01G4YOAJJOYFXYzW1f6GX4EFwB2UrYsYuTpn+ycI=; b=J/MtpnCDLrtQ7KxlyDUgTAqGs3KuQ/4fJwmuU8bU6mB5r9cAat/xZ/DKkI0M65UMB9 rVcQ5kQBHCpqxA7pFi8Hmq9WF9Gc2q8U72goWwgVUjYR+tHFCwaeCZc5eqrZjnyTwpRT HER9nQ5mOeTG0OvpVhqWZE3hf2FRoRbytTwWhMuNamB6rZ4htlVyPNtZGy4viwbHYAep pA95TU5DbmdQDKXLH4BfELfKI6DGVW0dB2YOzhcNy6BE41rEl+NNPmmrnHbqfl3cOvMG uvzzgko4/X+koH4dR/TvAzwwshOh4rP6+cY5dTximIpVpbFfRAQ/lwMDWV4N7OAKzHk3 miJQ== 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 :references; bh=DYh01G4YOAJJOYFXYzW1f6GX4EFwB2UrYsYuTpn+ycI=; b=XdfHiP/41/LZ8iF1R2UHT2eGEYmHAwhnLq3g+Jmuw1OwKmapRSTfPSJ0EZWsrQBdU3 3r1OETFvr9AtEHLewYioIErPx39pdfdHpTVEc2+iY3qTrulbB+g6gFJLKuMetXMszfzw fJM6HI/jV0mRQJYpmjl7iD7OvDx9WB6kVX2zWaZXQbEXsP7AT7MMjV8t621WFwphUdFO VHWl6AtKgLb2MMWhGgel5dH6BPNswlfxBAfwYi/tbrOgSwHRLKd+AcTnkbeFLPHUxQsa +fG3Pb+Vx46eZoOAcLd2pjBUM8lQSHqyD7qpokGxITcKnWHQ2I18ScUbSOc6OOTZSoQb Wovw== X-Gm-Message-State: APjAAAX1DI0MJITxF3HiKezV4OfoKwt/ymR6NhgjoUs/a04PHNHYXhf4 ZOHaDCzNszGA4TtFynftSPsl7wdFsp4= X-Google-Smtp-Source: APXvYqw5trtqABkhMNMmqPOkzUYmnAODdHE+SClNusmc+GT7Oc0Wvq4MM6vIfnYuKJBTztnp3HM2fA== X-Received: by 2002:a2e:8650:: with SMTP id i16mr14898729ljj.178.1560872101420; Tue, 18 Jun 2019 08:35:01 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id d15sm2203121lfq.76.2019.06.18.08.35.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 08:35:00 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson Cc: Brian Norris , Shawn Lin , Guenter Roeck , Heiko Stuebner , Kalle Valo , Arend Van Spriel , linux-wireless@vger.kernel.org Subject: [PATCH 2/7] mmc: sdio: Drop mmc_claim|release_host() in mmc_sdio_power_restore() Date: Tue, 18 Jun 2019 17:34:43 +0200 Message-Id: <20190618153448.27145-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618153448.27145-1-ulf.hansson@linaro.org> References: <20190618153448.27145-1-ulf.hansson@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 The function mmc_sdio_power_restore() is called either from mmc_sdio_runtime_resume() or from mmc_sdio_hw_reset(). Both callers either claims/releases the host or require its callers to do so. Therefore let's drop the redundant calls to mmc_claim|release_host() in mmc_sdio_power_restore(). Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson --- drivers/mmc/core/sdio.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 712a7742765e..b3303b7d9956 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1030,14 +1030,10 @@ static int mmc_sdio_power_restore(struct mmc_host *host) * */ - mmc_claim_host(host); - ret = mmc_sdio_reinit_card(host, mmc_card_keep_power(host)); if (!ret && host->sdio_irqs) mmc_signal_sdio_irq(host); - mmc_release_host(host); - return ret; } From patchwork Tue Jun 18 15:34:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11002045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 90DA7112C for ; Tue, 18 Jun 2019 15:35:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83C2728AA5 for ; Tue, 18 Jun 2019 15:35:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7834E28872; Tue, 18 Jun 2019 15:35:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 2259F28B4C for ; Tue, 18 Jun 2019 15:35:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729607AbfFRPfF (ORCPT ); Tue, 18 Jun 2019 11:35:05 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:33389 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729423AbfFRPfE (ORCPT ); Tue, 18 Jun 2019 11:35:04 -0400 Received: by mail-lj1-f196.google.com with SMTP id h10so42569ljg.0 for ; Tue, 18 Jun 2019 08:35:03 -0700 (PDT) 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:references; bh=c5yGWy1zg49aN6GRQcjrcvmt09k7bH4XaHWBtn+q+0o=; b=AWfQY563Cs6uiHCgDXOpnzfIB2jQtUS5c6tpfPq29tpIfFizbAppk6XyIVk2RMlaTd 7+dC5QsO1m26GUKss71/vufkrvTa6mefUC9SVswE69DbA/qjMljtULHmdahqzG12tD/1 gDjTojlfzA35GC0wJPOEF0fo4LyRhD5Ttdnadxgih0SlfJMLCboztBD/M7oDADoZ46HC azW0fOhpOhQVB4ow/QQzNqLmMwZEH7wSDnHVahmgI/AZMRYqz33g7YXzQlhWJe1851Fd fnntnOxtg0CfuKdvljr5cRxXgbrTHeMWI9l4VDnkqPeFKNfZgIlgbR3wWEtKXqlEdW/5 b8YA== 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 :references; bh=c5yGWy1zg49aN6GRQcjrcvmt09k7bH4XaHWBtn+q+0o=; b=iwc6ZNRUboklsK7C4S++wINxKMx5RTCI5yu3kMqKYbpk/UoTogg/mj6tznvE2i+fmX 5pi17vLZLss12nkKSSmuL2Q4nmFt9gUr1F/l8q3fqldanlfsT6k7XqK8GcGwF9FPBS4W v3WmtUzzrhjqB7OHXRE4sdXgy4UNRVDzpFQkbUBOVnRv09oas5viSwcgZnl+xqVKwuSu /oWX+HZewuFsDXiYa3VOf2T6tgh32BrSwKDUzADxOJ93B9OPjqGU5DiunkuDNniHVNsy ACVjtg21fB079xqzH/SozVi8SHxcGrPSopFZUZ9Kb/O0TcC4cBCQ6zqmPZ/aYIUancwQ bJdQ== X-Gm-Message-State: APjAAAWU79HF5qjrNCOx1ZQCbQ9qYGx+zgClar2QPQPvB7dDk7JC+ZA/ pACeEbWsp3otqZiyc6DOC9JfGilsJgA= X-Google-Smtp-Source: APXvYqyWp6/pWGfLpGS9IcidD8xSifQetpMr76o4NJS07T91XQmhf98xQaZZrtNOcwj2DZQia2ZQng== X-Received: by 2002:a2e:9198:: with SMTP id f24mr17460634ljg.221.1560872102934; Tue, 18 Jun 2019 08:35:02 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id d15sm2203121lfq.76.2019.06.18.08.35.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 08:35:02 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson Cc: Brian Norris , Shawn Lin , Guenter Roeck , Heiko Stuebner , Kalle Valo , Arend Van Spriel , linux-wireless@vger.kernel.org Subject: [PATCH 3/7] mmc: sdio: Move comment about re-initialization to mmc_sdio_reinit_card() Date: Tue, 18 Jun 2019 17:34:44 +0200 Message-Id: <20190618153448.27145-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618153448.27145-1-ulf.hansson@linaro.org> References: <20190618153448.27145-1-ulf.hansson@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 The comment in mmc_sdio_power_restore() belongs in mmc_sdio_reinit_card(), which was created during a previous commit that re-factored some code. Fix this by moving the comment into mmc_sdio_reinit_card(). Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson --- drivers/mmc/core/sdio.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index b3303b7d9956..29f86c1e9923 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -820,6 +820,23 @@ static int mmc_sdio_reinit_card(struct mmc_host *host, bool powered_resume) { int ret; + /* + * Reset the card by performing the same steps that are taken by + * mmc_rescan_try_freq() and mmc_attach_sdio() during a "normal" probe. + * + * sdio_reset() is technically not needed. Having just powered up the + * hardware, it should already be in reset state. However, some + * platforms (such as SD8686 on OLPC) do not instantly cut power, + * meaning that a reset is required when restoring power soon after + * powering off. It is harmless in other cases. + * + * The CMD5 reset (mmc_send_io_op_cond()), according to the SDIO spec, + * is not necessary for non-removable cards. However, it is required + * for OLPC SD8686 (which expects a [CMD5,5,3,7] init sequence), and + * harmless in other situations. + * + */ + sdio_reset(host); mmc_go_idle(host); mmc_send_if_cond(host, host->card->ocr); @@ -1013,23 +1030,6 @@ static int mmc_sdio_power_restore(struct mmc_host *host) { int ret; - /* - * Reset the card by performing the same steps that are taken by - * mmc_rescan_try_freq() and mmc_attach_sdio() during a "normal" probe. - * - * sdio_reset() is technically not needed. Having just powered up the - * hardware, it should already be in reset state. However, some - * platforms (such as SD8686 on OLPC) do not instantly cut power, - * meaning that a reset is required when restoring power soon after - * powering off. It is harmless in other cases. - * - * The CMD5 reset (mmc_send_io_op_cond()), according to the SDIO spec, - * is not necessary for non-removable cards. However, it is required - * for OLPC SD8686 (which expects a [CMD5,5,3,7] init sequence), and - * harmless in other situations. - * - */ - ret = mmc_sdio_reinit_card(host, mmc_card_keep_power(host)); if (!ret && host->sdio_irqs) mmc_signal_sdio_irq(host); From patchwork Tue Jun 18 15:34:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11002049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42F9F112C for ; Tue, 18 Jun 2019 15:35:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 348C128857 for ; Tue, 18 Jun 2019 15:35:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28B7428A8E; Tue, 18 Jun 2019 15:35:08 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D70D728B4A for ; Tue, 18 Jun 2019 15:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729693AbfFRPfH (ORCPT ); Tue, 18 Jun 2019 11:35:07 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:44414 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729659AbfFRPfG (ORCPT ); Tue, 18 Jun 2019 11:35:06 -0400 Received: by mail-lj1-f196.google.com with SMTP id k18so13549768ljc.11 for ; Tue, 18 Jun 2019 08:35:05 -0700 (PDT) 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:references; bh=39AvwfEHlmBtGb6TxK0PyFLzSAjznL8ashWYfCKeN2c=; b=DUVUxibyDbzeXA/hk3Zo8He9/+aJwnnN/pWh2NoweNxHStKsgrZcL3ZumTlXIZi9dc WeUijBH1Poz8ChLYZL1bKBUZAU3ZR2rj+GsEo6x7xMich3xxY2RV2kmS46NGxJI1MlWJ MRV+/JP6Ow8j7mAt22aZqlyJMo58hJW7C1+l5F2aW3gLhq3E6aifPYIMX50uxHGyRfAj nyDIqPeURa/a7Fy4aPbWw0kn8Ksosu30TGM/Pb52uAWj/Szv97GuIBw2bLOWuedt4IlD CFBVs6KhAozkHAU+vLUcbzP663GUGFkz2FWRwQ9+z//w/fik73WCUrLkrWQCSIWWuAav LI+g== 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 :references; bh=39AvwfEHlmBtGb6TxK0PyFLzSAjznL8ashWYfCKeN2c=; b=g2gSXsgm/9KOjV/t7jqOB77OuqAKorOThRjTv1eLq1+lZZX9gv0TesEfB9ekTU12u9 sndLlbst9c0fSwiRfbf4jUAohBGz+ighDsBddEfq5jIk3L0O3ZUq1ef8v518eEh5CrGB xm/6Zvuvlan5OAYjE+0h4Iq6JaO+MIYVvH2vFPlhd3U2GZhXAeFzWwZy8H4HBP9wpTm5 8xfVcTizD3/qMOuwqL0gKJLej2DEiZHwoCWcIiiLNW27u1BS+TGH/yJasjaQfDedpq4g ScwT583/zmNIQgCmK0GoRDrHdF0frg6FZ5cj8hM7wDEq3jTNhogjHGhVJmN6GTE1n23p 789g== X-Gm-Message-State: APjAAAVZ8QJX45fdwIPLWcWPh+ySffG//g6bG5ECXNKn+p/xdyT0mmr9 T4RCZO3krB6nEfcwxJ8kubC7Q3gRvwk= X-Google-Smtp-Source: APXvYqzqSuNRPHYXuZYjsrM4vMz/pSEweQAxVCKNSjhT88bGxkBRwG2XZGuS418CXp2VRlIwakP1rw== X-Received: by 2002:a2e:9c03:: with SMTP id s3mr47966037lji.209.1560872104224; Tue, 18 Jun 2019 08:35:04 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id d15sm2203121lfq.76.2019.06.18.08.35.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 08:35:03 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson Cc: Brian Norris , Shawn Lin , Guenter Roeck , Heiko Stuebner , Kalle Valo , Arend Van Spriel , linux-wireless@vger.kernel.org Subject: [PATCH 4/7] mmc: sdio: Drop powered-on re-init at runtime resume and HW reset Date: Tue, 18 Jun 2019 17:34:45 +0200 Message-Id: <20190618153448.27145-5-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618153448.27145-1-ulf.hansson@linaro.org> References: <20190618153448.27145-1-ulf.hansson@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 To use the so called powered-on re-initialization of an SDIO card, the power to the card must obviously have stayed on. If not, the initialization will simply fail. In the runtime suspend case, the card is always powered off. Hence, let's drop the support for powered-on re-initialization during runtime resume, as it doesn't make sense. Moreover, during a HW reset, the point is to cut the power to the card and then do fresh re-initialization. Therefore drop the support for powered-on re-initialization during HW reset. Signed-off-by: Ulf Hansson Tested-by: Douglas Anderson --- drivers/mmc/core/sdio.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 29f86c1e9923..a9bfcae8db5b 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1028,13 +1028,7 @@ static int mmc_sdio_resume(struct mmc_host *host) static int mmc_sdio_power_restore(struct mmc_host *host) { - int ret; - - ret = mmc_sdio_reinit_card(host, mmc_card_keep_power(host)); - if (!ret && host->sdio_irqs) - mmc_signal_sdio_irq(host); - - return ret; + return mmc_sdio_reinit_card(host, 0); } static int mmc_sdio_runtime_suspend(struct mmc_host *host) From patchwork Tue Jun 18 15:34:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11002053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D5FD1902 for ; Tue, 18 Jun 2019 15:35:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F92A288AF for ; Tue, 18 Jun 2019 15:35:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4403528B47; Tue, 18 Jun 2019 15:35:10 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 E9F9B28A8B for ; Tue, 18 Jun 2019 15:35:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729715AbfFRPfI (ORCPT ); Tue, 18 Jun 2019 11:35:08 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41177 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729695AbfFRPfI (ORCPT ); Tue, 18 Jun 2019 11:35:08 -0400 Received: by mail-lj1-f196.google.com with SMTP id s21so13591547lji.8 for ; Tue, 18 Jun 2019 08:35:07 -0700 (PDT) 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:references; bh=Eio1rBJiXbAWHfP/5yZZpxExzsuzz/VQXaABMKwUz1s=; b=CiqtmVs1O7WUxp0c8LA8vVFi4qYer4R0mJQ/igwJV1BCqNCUcI3fnHmGOwSWK2B8DO 3LPIA5GtovHe+mPAlWVq5UPetkOcLnPBbJIq5Jeh1H5reB9bsKo5XVhFeMF3jjMMDwRz TcxXSwb0sUixM+eACxy+1EYpLJcuO51RPho+zAgWk1vmY+U8mXukv09+lEwH/gZmpTRd 2NAfdT36kfBdwVhrRcBF+OsP7iWKNGeOW/Lv40rY+/75NrUEU79o5AT5CYQ/vHpOeoWd sj8ARY1ChBP2ul/qBWMT0A2yRbHl+jZx9biXecU1Hp1A5uXlWqq5nznZFHH0yY+zmGks FB9A== 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 :references; bh=Eio1rBJiXbAWHfP/5yZZpxExzsuzz/VQXaABMKwUz1s=; b=Hoh2O3SsZW4JI0+SHvUuNXZ7GrjvrA/HJexRaxM4rPap4B4gVjH4Lw9X3nCiGnpWfP KoE2ZxZLaRWQE7tLNZrQtlaYkcDbe+AV7XeTLIl3p1w5KJXrTX5q3gAASf5VkzpCm15v JLgFKT6Ndggc7i7BjENgCYbfGU9pTvq+bM7y0dMR7B/dap1N0bT3sovcLD5t1lKjnKpe JRmKxEtMw71hZkabMk3Ypr0uTDGMrjpzOASkvDykAS9C2BqMTTZfW+Gg4Tyfd/9KHatx zs9DCtQRPGCbZUduyp8V9l2Qy361uZYcxI8klG7lsoJwh5DlwMA37AxfnlsHnMd5R3Cs /75w== X-Gm-Message-State: APjAAAWFofawYOVOpEb0vq/NDVUXxpyP3kwUiG3Pw/sDkUHR6caClo3+ HbVjfp+1+gVhe8IIhfk8Hqu2H8lj6MM= X-Google-Smtp-Source: APXvYqzDLTL4QE/CEhY3P6VAQOmWh2YCo3YYWY667+/MrWCmuTWHUVHLgfW4j2uiZywQJ56lw5myFA== X-Received: by 2002:a2e:9997:: with SMTP id w23mr30443359lji.45.1560872105883; Tue, 18 Jun 2019 08:35:05 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id d15sm2203121lfq.76.2019.06.18.08.35.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 08:35:05 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson Cc: Brian Norris , Shawn Lin , Guenter Roeck , Heiko Stuebner , Kalle Valo , Arend Van Spriel , linux-wireless@vger.kernel.org Subject: [PATCH 5/7] mmc: sdio: Don't re-initialize powered-on removable SDIO cards at resume Date: Tue, 18 Jun 2019 17:34:46 +0200 Message-Id: <20190618153448.27145-6-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618153448.27145-1-ulf.hansson@linaro.org> References: <20190618153448.27145-1-ulf.hansson@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 It looks like the original idea behind always doing a re-initialization of a removable SDIO card during system resume in mmc_sdio_resume(), is to try to play safe to detect whether the card has been removed. However, this seems like a really a bad idea as it will most likely screw things up, especially when the card is expected to remain powered on during system suspend by the SDIO func driver. Let's fix this, simply by trusting that the detect work checks if the card is alive and inserted, which is being scheduled at the PM_POST_SUSPEND notification anyway. Signed-off-by: Ulf Hansson Tested-by: Douglas Anderson Reviewed-by: Douglas Anderson --- drivers/mmc/core/sdio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index a9bfcae8db5b..945416c53b56 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -982,7 +982,11 @@ static int mmc_sdio_resume(struct mmc_host *host) /* Basic card reinitialization. */ mmc_claim_host(host); - /* Restore power if needed */ + /* + * Restore power and reinitialize the card when needed. Note that a + * removable card is checked from a detect work later on in the resume + * process. + */ if (!mmc_card_keep_power(host)) { mmc_power_up(host, host->card->ocr); /* @@ -996,12 +1000,8 @@ static int mmc_sdio_resume(struct mmc_host *host) pm_runtime_set_active(&host->card->dev); pm_runtime_enable(&host->card->dev); } - } - - /* No need to reinitialize powered-resumed nonremovable cards */ - if (mmc_card_is_removable(host) || !mmc_card_keep_power(host)) { - err = mmc_sdio_reinit_card(host, mmc_card_keep_power(host)); - } else if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) { + err = mmc_sdio_reinit_card(host, 0); + } else if (mmc_card_wake_sdio_irq(host)) { /* We may have switched to 1-bit mode during suspend */ err = sdio_enable_4bit_bus(host->card); } From patchwork Tue Jun 18 15:34:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11002055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56FF1112C for ; Tue, 18 Jun 2019 15:35:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4716128B51 for ; Tue, 18 Jun 2019 15:35:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B21228B47; Tue, 18 Jun 2019 15:35:11 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 CFEB828A8B for ; Tue, 18 Jun 2019 15:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729272AbfFRPfK (ORCPT ); Tue, 18 Jun 2019 11:35:10 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37592 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729701AbfFRPfJ (ORCPT ); Tue, 18 Jun 2019 11:35:09 -0400 Received: by mail-lj1-f196.google.com with SMTP id 131so14911ljf.4 for ; Tue, 18 Jun 2019 08:35:08 -0700 (PDT) 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:references; bh=esuXjtqW4uUKLJzIZfGaOG3mfIeuD1RYtSgNoLM7wQI=; b=tbu1o1Zd9clAqV903WpQWYeICZSQRtZDs4H7OVK9VyaTFqToYWJlF/kdv1qtyf+gTm HLfE13sD46FlxWNViy5vu/o1sQwXqVlA4tcHSu7qJ3v78Sw0NMDTlBP+q6870RGOqhGR Q5hMDdhjWXBX5T1ShnsUPaouX+8VWG2kzJwQepTbaPEMw7mubSy2SkjLuyA4bYYTlF+B A2ThCYTnSd8MqrYRlnJewRkh6ABvjOfdzZVtaqCa2ejuZ0Tss52HfLky1AhjaX9YQzJY GHyZZJXNckhFYDA0//onqdJnF1zar0IDTBnCQaIYuPZzRAvTDcG1jmqFlVUMpFZ63IUN 5IBw== 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 :references; bh=esuXjtqW4uUKLJzIZfGaOG3mfIeuD1RYtSgNoLM7wQI=; b=etgYDrXkGzQ0bj2oqNGNS7fLSidBCLC+Vy3GcOGidzO9yPGhaQRITBAbAuC0LV1W2K izOwmGVBtDHHhL7iS6rHj+oajJ1dIAqS+P9yiMH3/VvLy0KLTax93BF4fxY2FHjejnt8 omjyZTaWNKfKof1/wxMY/OpukmpTvoxZnKzBm5hSFnidGpJJhPqyC2125RAwx/ozeqYO wJmNximZv+o+OcN2dZNMw0zQdme/MPAFmyLtaYR0J6SYfgwj7pQ7on9sb3peq695n1PH VlKnL4/hmKv9ZAC9Gj34RYZwGd+MLa11ctZpRhdF57bVm+dCcHFqr6gyLT7LUyGRGX0d d1iQ== X-Gm-Message-State: APjAAAV5qtW98P0qMSjt0OFvaCUo9G1TzLPcwqRs+DxJnv3qhFd8HSFC EEMPpMuZhXYWPBFsvcYr5ySniLhYjtQ= X-Google-Smtp-Source: APXvYqzWCTCYLUP+kCD+dCmIrRcVn73QgqU3WoKH776UKBay5LzF5cbfo9Q30OOIi8UtbKbirsyevQ== X-Received: by 2002:a2e:9dd7:: with SMTP id x23mr155663ljj.160.1560872107526; Tue, 18 Jun 2019 08:35:07 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id d15sm2203121lfq.76.2019.06.18.08.35.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 08:35:07 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson Cc: Brian Norris , Shawn Lin , Guenter Roeck , Heiko Stuebner , Kalle Valo , Arend Van Spriel , linux-wireless@vger.kernel.org Subject: [PATCH 6/7] mmc: sdio: Drop unused in-parameter to mmc_sdio_reinit_card() Date: Tue, 18 Jun 2019 17:34:47 +0200 Message-Id: <20190618153448.27145-7-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618153448.27145-1-ulf.hansson@linaro.org> References: <20190618153448.27145-1-ulf.hansson@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 The "powered_resume" in-parameter to mmc_sdio_reinit_card() has now become redundant as all callers set it to 0. Therefore let's just drop it. Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson --- drivers/mmc/core/sdio.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 945416c53b56..0bf603670f61 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -816,7 +816,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, return err; } -static int mmc_sdio_reinit_card(struct mmc_host *host, bool powered_resume) +static int mmc_sdio_reinit_card(struct mmc_host *host) { int ret; @@ -845,8 +845,7 @@ static int mmc_sdio_reinit_card(struct mmc_host *host, bool powered_resume) if (ret) return ret; - return mmc_sdio_init_card(host, host->card->ocr, host->card, - powered_resume); + return mmc_sdio_init_card(host, host->card->ocr, host->card, 0); } /* @@ -1000,7 +999,7 @@ static int mmc_sdio_resume(struct mmc_host *host) pm_runtime_set_active(&host->card->dev); pm_runtime_enable(&host->card->dev); } - err = mmc_sdio_reinit_card(host, 0); + err = mmc_sdio_reinit_card(host); } else if (mmc_card_wake_sdio_irq(host)) { /* We may have switched to 1-bit mode during suspend */ err = sdio_enable_4bit_bus(host->card); @@ -1026,11 +1025,6 @@ static int mmc_sdio_resume(struct mmc_host *host) return err; } -static int mmc_sdio_power_restore(struct mmc_host *host) -{ - return mmc_sdio_reinit_card(host, 0); -} - static int mmc_sdio_runtime_suspend(struct mmc_host *host) { /* No references to the card, cut the power to it. */ @@ -1048,7 +1042,7 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host) /* Restore power and re-initialize. */ mmc_claim_host(host); mmc_power_up(host, host->card->ocr); - ret = mmc_sdio_power_restore(host); + ret = mmc_sdio_reinit_card(host); mmc_release_host(host); return ret; @@ -1057,7 +1051,7 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host) static int mmc_sdio_hw_reset(struct mmc_host *host) { mmc_power_cycle(host, host->card->ocr); - return mmc_sdio_power_restore(host); + return mmc_sdio_reinit_card(host); } static int mmc_sdio_sw_reset(struct mmc_host *host) @@ -1069,7 +1063,7 @@ static int mmc_sdio_sw_reset(struct mmc_host *host) mmc_set_initial_state(host); mmc_set_initial_signal_voltage(host); - return mmc_sdio_reinit_card(host, 0); + return mmc_sdio_reinit_card(host); } static const struct mmc_bus_ops mmc_sdio_ops = { From patchwork Tue Jun 18 15:34:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11002059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B285A6C5 for ; Tue, 18 Jun 2019 15:35:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A43CA28A8E for ; Tue, 18 Jun 2019 15:35:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98E3A28B47; Tue, 18 Jun 2019 15:35:12 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 36AF428AA5 for ; Tue, 18 Jun 2019 15:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729659AbfFRPfL (ORCPT ); Tue, 18 Jun 2019 11:35:11 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41187 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729695AbfFRPfK (ORCPT ); Tue, 18 Jun 2019 11:35:10 -0400 Received: by mail-lj1-f196.google.com with SMTP id s21so13591708lji.8 for ; Tue, 18 Jun 2019 08:35:09 -0700 (PDT) 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:references; bh=TrltWt+RtwnpkQQYwVLsi9uq9P2cQCYA5NaB1ic9l5s=; b=NJtQhNNg78seUtT1XUqdcun+UMhElbfhoNIrmqOJPrg/y7Ye3phqcqBR+aZ98PY7ym zUS1Vbkl7gJo+0odr3yJ5u8RTMX6IrzSFKnETVm9+PgQwUE27CphCmVDe6yrgYsFAe+A vUp+Xg+bcEVLGDGlBNWf6iJoXoKGOvCDpSqPsgD/pvHpgLSzQiptjF3BsGaopi4BMqp+ XFjo3sJS4EJsFBOZwpsS36awBA+3QlazSpplPuyNVvJiLweDSIgfVFA1ryUwTPf7mA7O HRVjx/ouXbr276JXXyh6bEZedldNFLG48LVgbS6Ogn5U+GFfUUTNBtwEZLpg9XIZ3GJz sqrg== 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 :references; bh=TrltWt+RtwnpkQQYwVLsi9uq9P2cQCYA5NaB1ic9l5s=; b=qQvGkrG4wLaMsAgyIpUK0YRxMdr+/L/mcgELakBcu73iK5ZIFeg+WTKaYZzsFTHmt9 5euvBsDVHObaGSP7FDoMsUGgoUtZ9kh9tZHGdvw4VNpvUgAezcU0e0Iz040wo1AXmArT YHXEmviqz3BHEust14RRY6shTJO+1BvAwCp8dleWmqPygHDBo1/zecKwl9yF0aT+cll9 6znDnQumAxt6OSY+LiovvR5z04puDYjc2W4U+/Xd2PMoTdDeLISemsgzWAr09HOEavWE hnHpociOvqwpmNoNTDZb8oArcFFHIwDu1LyUcONF1cciCVNHgxeNh2rZtPZ7Zik2oZCI zySg== X-Gm-Message-State: APjAAAUa582ebr4w5W0MirnC6oatFsikUHCa3RpHANVmcwxP/j6ST/cy fwJSw4kXjM4hzMFRcjA5YGIzXc2l3uY= X-Google-Smtp-Source: APXvYqxung57/e+YH3aN47rF4dI9dtCp6RtpYgXnvVsMJBceOG9OE7z7rJ0srhWqzysCxn/FVJaEtQ== X-Received: by 2002:a2e:9685:: with SMTP id q5mr14919419lji.227.1560872108802; Tue, 18 Jun 2019 08:35:08 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id d15sm2203121lfq.76.2019.06.18.08.35.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 08:35:08 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson Cc: Brian Norris , Shawn Lin , Guenter Roeck , Heiko Stuebner , Kalle Valo , Arend Van Spriel , linux-wireless@vger.kernel.org Subject: [PATCH 7/7] mmc: sdio: Drop unused in-parameter from mmc_sdio_init_card() Date: Tue, 18 Jun 2019 17:34:48 +0200 Message-Id: <20190618153448.27145-8-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618153448.27145-1-ulf.hansson@linaro.org> References: <20190618153448.27145-1-ulf.hansson@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 The "powered_resume" in-parameter to mmc_sdio_init_card() has now become redundant as all callers set it to 0. Therefore let's just drop it. Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson --- drivers/mmc/core/sdio.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 0bf603670f61..8dd8fc32ecca 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -559,7 +559,7 @@ static void mmc_sdio_resend_if_cond(struct mmc_host *host, * we're trying to reinitialise. */ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, - struct mmc_card *oldcard, int powered_resume) + struct mmc_card *oldcard) { struct mmc_card *card; int err; @@ -582,11 +582,9 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, /* * Inform the card of the voltage */ - if (!powered_resume) { - err = mmc_send_io_op_cond(host, ocr, &rocr); - if (err) - goto err; - } + err = mmc_send_io_op_cond(host, ocr, &rocr); + if (err) + goto err; /* * For SPI, enable CRC as appropriate. @@ -645,7 +643,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, * try to init uhs card. sdio_read_cccr will take over this task * to make sure which speed mode should work. */ - if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) { + if (rocr & ocr & R4_18V_PRESENT) { err = mmc_set_uhs_voltage(host, ocr_card); if (err == -EAGAIN) { mmc_sdio_resend_if_cond(host, card); @@ -659,7 +657,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, /* * For native busses: set card RCA and quit open drain mode. */ - if (!powered_resume && !mmc_host_is_spi(host)) { + if (!mmc_host_is_spi(host)) { err = mmc_send_relative_addr(host, &card->rca); if (err) goto remove; @@ -687,7 +685,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, /* * Select card, as all following commands rely on that. */ - if (!powered_resume && !mmc_host_is_spi(host)) { + if (!mmc_host_is_spi(host)) { err = mmc_select_card(card); if (err) goto remove; @@ -845,7 +843,7 @@ static int mmc_sdio_reinit_card(struct mmc_host *host) if (ret) return ret; - return mmc_sdio_init_card(host, host->card->ocr, host->card, 0); + return mmc_sdio_init_card(host, host->card->ocr, host->card); } /* @@ -1113,7 +1111,7 @@ int mmc_attach_sdio(struct mmc_host *host) /* * Detect and init the card. */ - err = mmc_sdio_init_card(host, rocr, NULL, 0); + err = mmc_sdio_init_card(host, rocr, NULL); if (err) goto err;