devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Addy Ke <addy.ke@rock-chips.com>
To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	rdunlap@infradead.org, tgih.jun@samsung.com,
	jh80.chung@samsung.com, chris@printf.net, ulf.hansson@linaro.org,
	dinguyen@altera.com, heiko@sntech.de, olof@lixom.net,
	dianders@chromium.org, sonnyrao@chromium.org,
	amstan@chromium.org
Cc: devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, zhenfu.fang@rock-chips.com,
	cf@rock-chips.com, lintao@rock-chips.com, chenfen@rock-chips.com,
	zyf@rock-chips.com, xjq@rock-chips.com, huangtao@rock-chips.com,
	zyw@rock-chips.com, yzq@rock-chips.com, hj@rock-chips.com,
	kever.yang@rock-chips.com, zhangqing@rock-chips.com,
	hl@rock-chips.com, Addy Ke <addy.ke@rock-chips.com>
Subject: [PATCH 1/2] mmc: core: use card pointer as the first parameter of execute_tuning()
Date: Mon, 26 Jan 2015 19:19:34 +0800	[thread overview]
Message-ID: <1422271175-19445-2-git-send-email-addy.ke@rock-chips.com> (raw)
In-Reply-To: <1422271175-19445-1-git-send-email-addy.ke@rock-chips.com>

We need to take the card pointer in execute_tuning() for mmc_send_status(),
but mmc->card is NULL in tuning state. So we need change the first parameter
of execute_tuning() to card pointer(struct mmc_card * card).

Signed-off-by: Addy Ke <addy.ke@rock-chips.com>
---
 drivers/mmc/core/core.c           | 2 +-
 drivers/mmc/host/dw_mmc.c         | 3 ++-
 drivers/mmc/host/rtsx_pci_sdmmc.c | 3 ++-
 drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++-
 include/linux/mmc/host.h          | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 1be7055..271f024 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1101,7 +1101,7 @@ int mmc_execute_tuning(struct mmc_card *card)
 		opcode = MMC_SEND_TUNING_BLOCK;
 
 	mmc_host_clk_hold(host);
-	err = host->ops->execute_tuning(host, opcode);
+	err = host->ops->execute_tuning(card, opcode);
 	mmc_host_clk_release(host);
 
 	if (err)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 4bd22af..e54e656 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1485,8 +1485,9 @@ free_blk_test:
 	return ret;
 }
 
-static int dw_mci_execute_tuning(struct mmc_host *mmc, u32 opcode)
+static int dw_mci_execute_tuning(struct mmc_card *card, u32 opcode)
 {
+	struct mmc_host *mmc = card->host;
 	struct dw_mci_slot *slot = mmc_priv(mmc);
 	struct dw_mci *host = slot->host;
 	const struct dw_mci_drv_data *drv_data = host->drv_data;
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 1d3d6c4..230bd2f 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1270,8 +1270,9 @@ out:
 	return err;
 }
 
-static int sdmmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
+static int sdmmc_execute_tuning(struct mmc_card *card, u32 opcode)
 {
+	struct mmc_host *mmc = card->host;
 	struct realtek_pci_sdmmc *host = mmc_priv(mmc);
 	struct rtsx_pcr *pcr = host->pcr;
 	int err = 0;
diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
index 88af827..c494c06 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -1265,8 +1265,9 @@ out:
 		return 0;
 }
 
-static int sdmmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
+static int sdmmc_execute_tuning(struct mmc_card *card, u32 opcode)
 {
+	struct mmc_host *mmc = card->host;
 	struct rtsx_usb_sdmmc *host = mmc_priv(mmc);
 	struct rtsx_ucr *ucr = host->ucr;
 	int err = 0;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 0c8cbe5..ec4128e 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -133,7 +133,7 @@ struct mmc_host_ops {
 	int	(*card_busy)(struct mmc_host *host);
 
 	/* The tuning command opcode value is different for SD and eMMC cards */
-	int	(*execute_tuning)(struct mmc_host *host, u32 opcode);
+	int	(*execute_tuning)(struct mmc_card *card, u32 opcode);
 
 	/* Prepare HS400 target operating frequency depending host driver */
 	int	(*prepare_hs400_tuning)(struct mmc_host *host, struct mmc_ios *ios);
-- 
1.8.3.2

  reply	other threads:[~2015-01-26 11:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 11:19 [PATCH 0/2] fix bug that cause tuning failure Addy Ke
2015-01-26 11:19 ` Addy Ke [this message]
     [not found]   ` <1422271175-19445-2-git-send-email-addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-01-26 15:15     ` [PATCH 1/2] mmc: core: use card pointer as the first parameter of execute_tuning() Ulf Hansson
2015-01-26 17:45       ` Doug Anderson
2015-01-26 17:48         ` Russell King - ARM Linux
2015-01-27 15:18         ` Ulf Hansson
2015-01-29  0:55           ` Doug Anderson
2015-01-26 11:19 ` [PATCH 2/2] mmc: dw_mmc: wait until card ready if tuning fails Addy Ke
2015-01-29  8:45   ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422271175-19445-2-git-send-email-addy.ke@rock-chips.com \
    --to=addy.ke@rock-chips.com \
    --cc=amstan@chromium.org \
    --cc=cf@rock-chips.com \
    --cc=chenfen@rock-chips.com \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dinguyen@altera.com \
    --cc=galak@codeaurora.org \
    --cc=heiko@sntech.de \
    --cc=hj@rock-chips.com \
    --cc=hl@rock-chips.com \
    --cc=huangtao@rock-chips.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jh80.chung@samsung.com \
    --cc=kever.yang@rock-chips.com \
    --cc=lintao@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=olof@lixom.net \
    --cc=pawel.moll@arm.com \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=sonnyrao@chromium.org \
    --cc=tgih.jun@samsung.com \
    --cc=ulf.hansson@linaro.org \
    --cc=xjq@rock-chips.com \
    --cc=yzq@rock-chips.com \
    --cc=zhangqing@rock-chips.com \
    --cc=zhenfu.fang@rock-chips.com \
    --cc=zyf@rock-chips.com \
    --cc=zyw@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).