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: 167176 Delivered-To: patches@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4375312ilk; Tue, 18 Jun 2019 08:35:03 -0700 (PDT) X-Received: by 2002:a2e:88d3:: with SMTP id a19mr22028182ljk.32.1560872103258; Tue, 18 Jun 2019 08:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560872103; cv=none; d=google.com; s=arc-20160816; b=gytYUVKh32e4jeLofP9sowjCvzGl5c1cTZ+bmvuYTGBgfWz3fy8tRaHg2++m32Be11 +Q5Efy+bEn5S7ystVRIU3+/unhCvMb2SBPc2fR0Og8GZ7RcIuT/+gsr9xbaa7qAbtyFv JVra5nDCOi99G3HDGuJ0G239LxZBVBs9Plj65E9fRKzC+zzixev7DJd4aOgXcjhFW9cL SJ3xz8DIPNmCnuwHh2PlpguFYkcvQQrbL5gWV/2e1zIosjJq8W47TLjf/3HXV69rwgv1 XXEBmUpOeg89oioKNbJDeseQaT0LNXkKZ9gAVmHpOJaMkgLfEYJRSLHF7eLhBNykSO3p rNqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c5yGWy1zg49aN6GRQcjrcvmt09k7bH4XaHWBtn+q+0o=; b=daKQMsc9LLvp4ifOrX78UrnDskBn8f+pJ57CS8OoxpGkTQpyKxRQHRjR1z8LIOKJnG czkkQrPjysVKVy9j6TRq7FCjJZlhOAzMczd7aBYRlRD0BMfEyT9Wyw7Ee3YrD5tzJO93 /ZiEEVkUEStnqOGMhJNWMUjq4B2kik2+nBtpSiFUbHqvDgyqriQjDZbhygc7PSRGI7nZ S+cZDprp0OZntbtDbMNcLK8+w05AMyxdpWR2pKG7+2k33cAVD6YqfthSESpxdIF9vWcf S5BDMz9TjRYv22y+wmVQfd5cPnoTXiCYsYDYtfAddIGhkOhv+5aNsbp4C966ciIuTW++ vs8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AWfQY563; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g5sor8377290lja.9.2019.06.18.08.35.03 for (Google Transport Security); Tue, 18 Jun 2019 08:35:03 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AWfQY563; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=OfKfmqlXUKnvApsMoifN7gqckeD6jQWt/RO/wHDA3ViJLmRhJycE4wKfNJsm+Df2r9 lsZa7TopexaUzw6kNciszXMo4gpw1g37bOyBeZORPrTLHqEbPwtOeDz0YWZ6xQXZHDO0 Q1AKQu7qJk/zrK4UUWgGnTVnxqBf1J5qnD8pkxVyogxSEE9GoFVWF3SQ2z0P6wH23RGZ W4XYoo67xfYzMAoSYAHJEaEYMhxb8zR5S3EY7E3MIK8NSOzR/xMBOorFIzN94DltohZc Pw2MB2Nw1uu5P70Zfdt9Wa+WCV9uRWhjusivCV3/83HLF3mBtW+9SCyqlJoK5nbwE2kc zuzQ== X-Gm-Message-State: APjAAAX0YJqGEQ2XYWQvu0CBFfdE9oG/yD39+savZ9euOtsaVYRoh5GJ SgYvkC0n9B5nLvhXg7dhVg9Ni0QH 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) Return-Path: 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> 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 --- drivers/mmc/core/sdio.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) -- 2.17.1 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);