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: 11002037 X-Patchwork-Delegate: johannes@sipsolutions.net 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 DF23E1902 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 D1D2F2888A for ; Tue, 18 Jun 2019 15:35:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D019A28AA5; 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=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 680EC2888A for ; Tue, 18 Jun 2019 15:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729285AbfFRPfD (ORCPT ); Tue, 18 Jun 2019 11:35:03 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:42974 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729189AbfFRPfC (ORCPT ); Tue, 18 Jun 2019 11:35:02 -0400 Received: by mail-lf1-f67.google.com with SMTP id y13so9628395lfh.9 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=SfBBpI+Te1oawINiJQLLnqVr0zbge+Uqb1Leg/dSrrVP9G+UWdvBOBiLdf1MngiTZM u0uap2o80ZOeRxciQpH0CaK9g9Qob3uUSE04XnqLy2l/TaBfCpVQCd+dFWJLhFrdm5or gwoZvjYv6jYR6pg+3ylPWpgbmQkkc9ECI/PryWu0S+nskmLqZe/9Lt/GyBfPRjNtGMCx FzJgv4TUcpb/5vpVOrbQm7G1JlbKKpIwxdFCIyKWzLgTqDrJIhJSDVko/hrUhfHt0EVV Claa1k5O9c/fYj+wb7O8fNl4MbRFYs16yJSWn5i+aDMwkTLkw05FOGvyf9PlX51m+lnQ udQg== X-Gm-Message-State: APjAAAWXlXHTGFDnLCptmvWVXC/J2lUMtIzIP/lx8/7UpftpGG0wM0c8 +AEeDGTn8FcZvv+fnyGJ2lvMAg== 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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: 11002039 X-Patchwork-Delegate: johannes@sipsolutions.net 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 818226C5 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 7301828A8E for ; Tue, 18 Jun 2019 15:35:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 667E628B4A; 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=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 165E028A8E for ; Tue, 18 Jun 2019 15:35:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729613AbfFRPfD (ORCPT ); Tue, 18 Jun 2019 11:35:03 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46337 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729423AbfFRPfD (ORCPT ); Tue, 18 Jun 2019 11:35:03 -0400 Received: by mail-lj1-f196.google.com with SMTP id v24so13575849ljg.13 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=gZU+4nuM1YObFmgkgbLXX6GXhA6kSqOdjlhwRwQPW+Y54leriJcs0Eq1e1ssPJ0c4p 6HkChvtHF6UDNY1Di8b/6vQjS3ztlvOmEiewb2p7FniLAEVFwefyTDj09Am+yAzglLVO pDeHKfYNseyqwdd5U/FekoEDNrLJxAwcsR3SJvg4vW7jrFMAkHD/0H65vmk1aI6VIpiU chgacBq+KODHALUW3lsmEX35j/9gu9LZOKnLe1YCKvjYxHmYQ/HhpvxvGA4jMOP1oy8p 0YSmDczMOEuT5ipGqDKQ2n2uTOIahpAX2bHxOiqV+mgkgYzrFqWgIU1jJULtXA6xs7Uc kv4Q== X-Gm-Message-State: APjAAAWR0oz0WAEdsyW4hN7GgyRmTz2Konvb4Q2DVRavbLdapnKTTdXp bWIxnyUV3zx/z3d11aH1x5NLvw== 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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: 11002043 X-Patchwork-Delegate: johannes@sipsolutions.net 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 4636E1902 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 35F9528A8E for ; Tue, 18 Jun 2019 15:35:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29F0E28B50; 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=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 BD52028A8E for ; Tue, 18 Jun 2019 15:35:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729650AbfFRPfF (ORCPT ); Tue, 18 Jun 2019 11:35:05 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44407 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729607AbfFRPfE (ORCPT ); Tue, 18 Jun 2019 11:35:04 -0400 Received: by mail-lj1-f193.google.com with SMTP id k18so13549663ljc.11 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=k2Et6uW4MeRogU5rQZRBBqRuazrnB4ny48Q7jvnDVNvRacaosG97/ppjYDQ8hbyaRN VqO81f15/KqGelL/4s54DdmATyoJTufqPEwOA/cZgcce3Tb1G+y/bLNmf7DpI+drmGCP an7rzFYPdG5uwKU3nBFEjNmLMijfeVlyKnO71UAAuibziFed8EtiE4uS5ZYdMXK4Wqzz Q5wUsIFy9V4vJp//HsPm+VTXHV7qJj2r0fYwwFORVPy5nKUlh7u2qqbDvxfq0a/ZqA0N 8d+9E5mGatkkseO2uu6RSgS3R4w5FgJ+qhBsqIT8qnI0IoGtrySLPtdBppgLAVPLem0o chaA== X-Gm-Message-State: APjAAAXTqBIyskG37/EoJoRQSbae8qSOYWPU4H/vWuRL/0r+UglARWm/ XaEo15BOvLOxQ86bbiXDH5JIaQ== 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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: 11002047 X-Patchwork-Delegate: johannes@sipsolutions.net 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 9CD436C5 for ; Tue, 18 Jun 2019 15:35:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E968286EC for ; Tue, 18 Jun 2019 15:35:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 831C928B4A; Tue, 18 Jun 2019 15:35:07 +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 28AED28A8E for ; Tue, 18 Jun 2019 15:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729678AbfFRPfG (ORCPT ); Tue, 18 Jun 2019 11:35:06 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:33393 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729647AbfFRPfG (ORCPT ); Tue, 18 Jun 2019 11:35:06 -0400 Received: by mail-lj1-f196.google.com with SMTP id h10so42617ljg.0 for ; Tue, 18 Jun 2019 08:35:04 -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=BCjQHCjaSot2uG6NXsR7V3ZktBY0M6rnByuv3Y+gSATDY92z/CJWExR4qOO3rHuSnH hkfWSW/kPoIr1IDAcdf27vVFwUBt0jH+E8dph9RnxPd45oxeSPMmu1XsBS2x+WD/Ny8A 4mpazIXUKJ3tnDi+eyi6if4B6K/W+ly65Rs37U6acfnL1ETgkTd3vbLatDdtk4Knvj0X PvjGT4wfb8D7qSyQj6sjni+9r1AvWtLLs9HvYPOlJq+moIrYmlXNMDOwl95h8wUhqKRC v2MxEUfcYEp31qrN5TZgDshezqnaD4MNyZbf7czFXtL6Pp7XyGvzcwgx9nCGvsbnH6Ha EgIQ== X-Gm-Message-State: APjAAAXQ25A+gmb5ELupiNPyricla/GiizX3/TjUbD4LeUtsCYVdAO4e 3FEGsPyfFwS4R3MFcNQUfFBLWQ== 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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: 11002051 X-Patchwork-Delegate: johannes@sipsolutions.net 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 CC0766C5 for ; Tue, 18 Jun 2019 15:35:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD99A28A8B for ; Tue, 18 Jun 2019 15:35:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1BEA28B47; Tue, 18 Jun 2019 15:35:09 +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 5AC58288AF for ; Tue, 18 Jun 2019 15:35:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729714AbfFRPfI (ORCPT ); Tue, 18 Jun 2019 11:35:08 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:38197 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729647AbfFRPfI (ORCPT ); Tue, 18 Jun 2019 11:35:08 -0400 Received: by mail-lj1-f193.google.com with SMTP id r9so7365ljg.5 for ; Tue, 18 Jun 2019 08:35:06 -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=D3JaXTzX+ZZ3j+lYVxGaHoMnY5LRZUMQUr03jpLPLQ3B6TOg2toOLG9F8aSlCWtcM9 0Y3KlXLgA+c0JV8Jhw1L8j7JqELk2+R36jWo1g6MkwJ/OiLmG0P2HZddTFA9t3MaZvpw Q6f2L6p4MQhIN1YYLcwBmN1gut58b5FfouzA4U/R+sLu75YVJUZ6iBkjkwMQZYP+4F8v jnPJ6K2rRPYFZ8Me2w8V23u580zolmpiq8tgCDm0Pd64QE5ljQ3IIgxG51yBs195wOcg PXzluNVS6AoknlG26M6RIpL6OwXnoq3807CgYCYfBCep1OaVTrsAsjfpmct3fUGeMnYi HozQ== X-Gm-Message-State: APjAAAWMU1vFpI4aE2b4RMF53DRaQFqJCCNtgI24/UvhBk5U2FUT4sI1 +5ScaURNH/Kn2NVSDo3Zy+qUog== 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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: 11002057 X-Patchwork-Delegate: johannes@sipsolutions.net 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 7DCEC1902 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 7039E286EC for ; Tue, 18 Jun 2019 15:35:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E4F728A8B; 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=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 EFB6D28A8E for ; Tue, 18 Jun 2019 15:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729750AbfFRPfK (ORCPT ); Tue, 18 Jun 2019 11:35:10 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35256 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729659AbfFRPfJ (ORCPT ); Tue, 18 Jun 2019 11:35:09 -0400 Received: by mail-lj1-f194.google.com with SMTP id x25so27653ljh.2 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=NG9FeDXpuxPZiMalxBRT3fNmj+v0ONGyerjktTel1wl1szzp6E7L87qpLsTcq8zAgW vjTGcl10x7eQlkXgjoRk+xSGc3BMEmeYGAPqLMa2+2A1kDSdBDDJJMofji8WdUYodlfs CHRg+93w4u6zVCQK/huWuVlcaEch8pNJbRvGyP0Xxn+GwwzJL87c7PhyEi9ncnYXhkel YR8CuxFbIis+xm64zwAwisEd3Ai0PL+eKZHweyO3l1gazBoFCrXBqKEiBtfN91Woixy/ VQPhrcPjBnUOV8byeAjnuM54sn+2qTN3QiXpvYAe+7t9BmpV6Jywm8jiQCIhsqy3T14C TAjQ== X-Gm-Message-State: APjAAAWGJpljYEyDxWdMV4hdEUDGbFlwfVVifQE7JjXKMWf+2pWu5OYO WBhRsDm2qbO20lhI3nvxP2jaZw== 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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: 11002061 X-Patchwork-Delegate: johannes@sipsolutions.net 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 C56011902 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 B7FA028857 for ; Tue, 18 Jun 2019 15:35:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACAE328B4B; 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=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 566E328857 for ; Tue, 18 Jun 2019 15:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729754AbfFRPfL (ORCPT ); Tue, 18 Jun 2019 11:35:11 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:38208 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729647AbfFRPfK (ORCPT ); Tue, 18 Jun 2019 11:35:10 -0400 Received: by mail-lj1-f195.google.com with SMTP id r9so7582ljg.5 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=tsdtCVN9Or6pmgLmFH6Lq6EHYNsbHLqlny3+OfrRcTXjnlg6cxIRDPYrLroxt/5Z2V H+vuQ2EjNQ9I5jMlrIaUAILyrt4i+bjOm6JVxfj57JWdtUkpVYTFCg9wG12ncMrBPAGw qe4eeurk6Q7PHpAjwg0jgSpNWtHv9xl6TaI4gLrO0gJp/7FTqwT9CjMReBdfg/NR0ost CiDia3tLJQe9qZgfTKsH3na7Rva7jQW/2Cwyvo2Z7Nc+citCQY6ltKaZAn8dFm+T3uxU Cv1n7SkU1FV3lNFrzSBdfOmlKhAHxBWkLTqtSnTH7kCHkSUt5IFFwKOf94tB2+HbuZ38 6nPg== X-Gm-Message-State: APjAAAU0uxzd1hQkxIiso+ByMTb+g49F8OAqgD5ojYe2xQn5Ddsj7SEY VuxC1Ctq0nhMuCx0CtaieRQgtw== 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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;