All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 00/10] mmc: dw_mmc: clean the codes for dwmmc controller
@ 2016-11-15 10:12 Jaehoon Chung
       [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
                   ` (5 more replies)
  0 siblings, 6 replies; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc
  Cc: devicetree, ulf.hansson, heiko, shawn.lin, robh+dt, Jaehoon Chung

This patchset is modified the some minor fixing and cleaning codes.

* Major changes
- Use the cookie enum values like sdhci controller.
- Remove the unnecessary codes and use_stop_abort() by default.
- Remove the obsoleted property "supports-highspeed"
- Deprecated the "clock-freq-min-max" property. Instead, use "max-frequency"
- Minimum clock value is set to 100K by default.

Change in v2:
- Applied patches relevant to dt files
- Use "deperecated" instead of removing about "clock-freq-min-max"
- Added Heiko's Tested-by tag

Jaehoon Chung (10):
  mmc: dw_mmc: display the real register value on debugfs
  mmc: dw_mmc: fix the debug message for checking card's present
  mmc: dw_mmc: change the DW_MCI_FREQ_MIN from 400K to 100K
  mmc: dw_mmc: use the hold register when send stop command
  mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default
  mmc: core: move the cookie's enum values from sdhci.h to mmc.h
  mmc: dw_mmc: use the cookie's enum values for post/pre_req()
  mmc: dw_mmc: remove the unnecessary mmc_data structure
  mmc: dw_mmc: The "clock-freq-min-max" property was deprecated
  Documentation: synopsys-dw-mshc: remove the unused properties

 .../devicetree/bindings/mmc/synopsys-dw-mshc.txt   |  8 +-
 drivers/mmc/host/dw_mmc.c                          | 88 +++++++++++-----------
 drivers/mmc/host/sdhci.h                           |  6 --
 include/linux/mmc/core.h                           |  6 ++
 4 files changed, 50 insertions(+), 58 deletions(-)

-- 
2.10.1


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCHv2 01/10] mmc: dw_mmc: display the real register value on debugfs
       [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-15 10:12   ` Jaehoon Chung
       [not found]     ` <20161115101232.3854-2-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12   ` [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h Jaehoon Chung
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	shawn.lin-TNX95d0MmH7DzftRWevZcw, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	Jaehoon Chung

Developer wants to see the real register value, not register offset.
This patch fixed to display the real value of register.

Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
---
 drivers/mmc/host/dw_mmc.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index a16c537..e53899e 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -165,12 +165,14 @@ static const struct file_operations dw_mci_req_fops = {
 
 static int dw_mci_regs_show(struct seq_file *s, void *v)
 {
-	seq_printf(s, "STATUS:\t0x%08x\n", SDMMC_STATUS);
-	seq_printf(s, "RINTSTS:\t0x%08x\n", SDMMC_RINTSTS);
-	seq_printf(s, "CMD:\t0x%08x\n", SDMMC_CMD);
-	seq_printf(s, "CTRL:\t0x%08x\n", SDMMC_CTRL);
-	seq_printf(s, "INTMASK:\t0x%08x\n", SDMMC_INTMASK);
-	seq_printf(s, "CLKENA:\t0x%08x\n", SDMMC_CLKENA);
+	struct dw_mci *host = s->private;
+
+	seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS));
+	seq_printf(s, "RINTSTS:\t0x%08x\n", mci_readl(host, RINTSTS));
+	seq_printf(s, "CMD:\t0x%08x\n", mci_readl(host, CMD));
+	seq_printf(s, "CTRL:\t0x%08x\n", mci_readl(host, CTRL));
+	seq_printf(s, "INTMASK:\t0x%08x\n", mci_readl(host, INTMASK));
+	seq_printf(s, "CLKENA:\t0x%08x\n", mci_readl(host, CLKENA));
 
 	return 0;
 }
-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 02/10] mmc: dw_mmc: fix the debug message for checking card's present
  2016-11-15 10:12 [PATCHv2 00/10] mmc: dw_mmc: clean the codes for dwmmc controller Jaehoon Chung
       [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-15 10:12 ` Jaehoon Chung
       [not found]   ` <20161115101232.3854-3-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12 ` [PATCHv2 03/10] mmc: dw_mmc: change the DW_MCI_FREQ_MIN from 400K to 100K Jaehoon Chung
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc
  Cc: devicetree, ulf.hansson, heiko, shawn.lin, robh+dt, Jaehoon Chung

If display the debug message, this message should be spamming.
If flags is maintained the previous value, didn't display the debug
message.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/mmc/host/dw_mmc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index e53899e..6c0c4c5 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1537,13 +1537,10 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
 			== 0 ? 1 : 0;
 
 	spin_lock_bh(&host->lock);
-	if (present) {
-		set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
+	if (present && !test_and_set_bit(DW_MMC_CARD_PRESENT, &slot->flags))
 		dev_dbg(&mmc->class_dev, "card is present\n");
-	} else {
-		clear_bit(DW_MMC_CARD_PRESENT, &slot->flags);
+	else if (!test_and_clear_bit(DW_MMC_CARD_PRESENT, &slot->flags))
 		dev_dbg(&mmc->class_dev, "card is not present\n");
-	}
 	spin_unlock_bh(&host->lock);
 
 	return present;
-- 
2.10.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 03/10] mmc: dw_mmc: change the DW_MCI_FREQ_MIN from 400K to 100K
  2016-11-15 10:12 [PATCHv2 00/10] mmc: dw_mmc: clean the codes for dwmmc controller Jaehoon Chung
       [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12 ` [PATCHv2 02/10] mmc: dw_mmc: fix the debug message for checking card's present Jaehoon Chung
@ 2016-11-15 10:12 ` Jaehoon Chung
       [not found]   ` <20161115101232.3854-4-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12 ` [PATCHv2 04/10] mmc: dw_mmc: use the hold register when send stop command Jaehoon Chung
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc
  Cc: devicetree, ulf.hansson, heiko, shawn.lin, robh+dt, Jaehoon Chung

If there is no property "clock-freq-min-max", mmc->f_min should be set
to 400K by default. But Some SoC can be used 100K.
When 100K is used, MMC core will try to check from 400K to 100K.

Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/mmc/host/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 6c0c4c5..be36f48 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -54,7 +54,7 @@
 #define DW_MCI_DMA_THRESHOLD	16
 
 #define DW_MCI_FREQ_MAX	200000000	/* unit: HZ */
-#define DW_MCI_FREQ_MIN	400000		/* unit: HZ */
+#define DW_MCI_FREQ_MIN	100000		/* unit: HZ */
 
 #define IDMAC_INT_CLR		(SDMMC_IDMAC_INT_AI | SDMMC_IDMAC_INT_NI | \
 				 SDMMC_IDMAC_INT_CES | SDMMC_IDMAC_INT_DU | \
-- 
2.10.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 04/10] mmc: dw_mmc: use the hold register when send stop command
  2016-11-15 10:12 [PATCHv2 00/10] mmc: dw_mmc: clean the codes for dwmmc controller Jaehoon Chung
                   ` (2 preceding siblings ...)
  2016-11-15 10:12 ` [PATCHv2 03/10] mmc: dw_mmc: change the DW_MCI_FREQ_MIN from 400K to 100K Jaehoon Chung
@ 2016-11-15 10:12 ` Jaehoon Chung
       [not found]   ` <20161115101232.3854-5-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12 ` [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default Jaehoon Chung
  2016-11-15 10:12 ` [PATCHv2 07/10] mmc: dw_mmc: use the cookie's enum values for post/pre_req() Jaehoon Chung
  5 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc
  Cc: devicetree, ulf.hansson, heiko, shawn.lin, robh+dt, Jaehoon Chung

If DW_MMC_CARD_NO_USE_HOLD isn't set, it's usesd by default.
Enve if SDMMC_CMD_USB_HOLD_REG is set in prepare_command(), but it
doesn't set in pre_stop_abort().

To maintain the consistency, add the checking condition for this.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/mmc/host/dw_mmc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index be36f48..3cda68c 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -337,6 +337,9 @@ static u32 dw_mci_prep_stop_abort(struct dw_mci *host, struct mmc_command *cmd)
 	cmdr = stop->opcode | SDMMC_CMD_STOP |
 		SDMMC_CMD_RESP_CRC | SDMMC_CMD_RESP_EXP;
 
+	if (!test_bit(DW_MMC_CARD_NO_USE_HOLD, &host->cur_slot->flags))
+		cmdr |= SDMMC_CMD_USE_HOLD_REG;
+
 	return cmdr;
 }
 
-- 
2.10.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default
  2016-11-15 10:12 [PATCHv2 00/10] mmc: dw_mmc: clean the codes for dwmmc controller Jaehoon Chung
                   ` (3 preceding siblings ...)
  2016-11-15 10:12 ` [PATCHv2 04/10] mmc: dw_mmc: use the hold register when send stop command Jaehoon Chung
@ 2016-11-15 10:12 ` Jaehoon Chung
       [not found]   ` <20161115101232.3854-6-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12 ` [PATCHv2 07/10] mmc: dw_mmc: use the cookie's enum values for post/pre_req() Jaehoon Chung
  5 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc
  Cc: devicetree, ulf.hansson, heiko, shawn.lin, robh+dt, Jaehoon Chung

stop_cmdr should be set to values relevant to stop command.
It migth be assigned to values whatever there is mrq->stop or not.
Then it doesn't need to use dw_mci_prepare_command().
It's enough to use the prep_stop_abort for preparing stop command.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/mmc/host/dw_mmc.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 3cda68c..12e1107 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -385,7 +385,7 @@ static void dw_mci_start_command(struct dw_mci *host,
 
 static inline void send_stop_abort(struct dw_mci *host, struct mmc_data *data)
 {
-	struct mmc_command *stop = data->stop ? data->stop : &host->stop_abort;
+	struct mmc_command *stop = &host->stop_abort;
 
 	dw_mci_start_command(host, stop, host->stop_cmdr);
 }
@@ -1277,10 +1277,7 @@ static void __dw_mci_start_request(struct dw_mci *host,
 		spin_unlock_irqrestore(&host->irq_lock, irqflags);
 	}
 
-	if (mrq->stop)
-		host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop);
-	else
-		host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
+	host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
 }
 
 static void dw_mci_start_request(struct dw_mci *host,
@@ -1890,8 +1887,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
 			if (test_and_clear_bit(EVENT_DATA_ERROR,
 					       &host->pending_events)) {
 				dw_mci_stop_dma(host);
-				if (data->stop ||
-				    !(host->data_status & (SDMMC_INT_DRTO |
+				if (!(host->data_status & (SDMMC_INT_DRTO |
 							   SDMMC_INT_EBE)))
 					send_stop_abort(host, data);
 				state = STATE_DATA_ERROR;
@@ -1927,8 +1923,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
 			if (test_and_clear_bit(EVENT_DATA_ERROR,
 					       &host->pending_events)) {
 				dw_mci_stop_dma(host);
-				if (data->stop ||
-				    !(host->data_status & (SDMMC_INT_DRTO |
+				if (!(host->data_status & (SDMMC_INT_DRTO |
 							   SDMMC_INT_EBE)))
 					send_stop_abort(host, data);
 				state = STATE_DATA_ERROR;
@@ -2004,7 +1999,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
 			host->cmd = NULL;
 			host->data = NULL;
 
-			if (mrq->stop)
+			if (!mrq->sbc && mrq->stop)
 				dw_mci_command_complete(host, mrq->stop);
 			else
 				host->cmd_status = 0;
-- 
2.10.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h
       [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12   ` [PATCHv2 01/10] mmc: dw_mmc: display the real register value on debugfs Jaehoon Chung
@ 2016-11-15 10:12   ` Jaehoon Chung
       [not found]     ` <20161115101232.3854-7-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12   ` [PATCHv2 08/10] mmc: dw_mmc: remove the unnecessary mmc_data structure Jaehoon Chung
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	shawn.lin-TNX95d0MmH7DzftRWevZcw, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	Jaehoon Chung

It's not for only sdhci controller.
So it can be moved from sdhci.h to mmc.h. And renamed from sdhci_cookie
to mmc_cookie.

Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
---
 drivers/mmc/host/sdhci.h | 6 ------
 include/linux/mmc/core.h | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 766df17..325663b 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -321,12 +321,6 @@ struct sdhci_adma2_64_desc {
 /* Allow for a a command request and a data request at the same time */
 #define SDHCI_MAX_MRQS		2
 
-enum sdhci_cookie {
-	COOKIE_UNMAPPED,
-	COOKIE_PRE_MAPPED,	/* mapped by sdhci_pre_req() */
-	COOKIE_MAPPED,		/* mapped by sdhci_prepare_data() */
-};
-
 struct sdhci_host {
 	/* Data set by hardware interface driver */
 	const char *hw_name;	/* Hardware bus name */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 0ce928b..82d707f 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -118,6 +118,12 @@ struct mmc_command {
 	struct mmc_request	*mrq;		/* associated request */
 };
 
+enum mmc_cookie {
+	COOKIE_UNMAPPED,
+	COOKIE_PRE_MAPPED,	/* mapped by pre_req() of controller */
+	COOKIE_MAPPED,		/* mapped by prepare_data() of controller */
+};
+
 struct mmc_data {
 	unsigned int		timeout_ns;	/* data timeout (in ns, max 80ms) */
 	unsigned int		timeout_clks;	/* data timeout (in clocks) */
-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 07/10] mmc: dw_mmc: use the cookie's enum values for post/pre_req()
  2016-11-15 10:12 [PATCHv2 00/10] mmc: dw_mmc: clean the codes for dwmmc controller Jaehoon Chung
                   ` (4 preceding siblings ...)
  2016-11-15 10:12 ` [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default Jaehoon Chung
@ 2016-11-15 10:12 ` Jaehoon Chung
  5 siblings, 0 replies; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc
  Cc: devicetree, ulf.hansson, heiko, shawn.lin, robh+dt, Jaehoon Chung

This patch removed the meaningless value. Instead, use the cookie's enum
values for executing correctly.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/mmc/host/dw_mmc.c | 39 +++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 12e1107..e912de6 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -414,12 +414,13 @@ static void dw_mci_dma_cleanup(struct dw_mci *host)
 {
 	struct mmc_data *data = host->data;
 
-	if (data)
-		if (!data->host_cookie)
-			dma_unmap_sg(host->dev,
-				     data->sg,
-				     data->sg_len,
-				     dw_mci_get_dma_dir(data));
+	if (data && data->host_cookie == COOKIE_MAPPED) {
+		dma_unmap_sg(host->dev,
+			     data->sg,
+			     data->sg_len,
+			     dw_mci_get_dma_dir(data));
+		data->host_cookie = COOKIE_UNMAPPED;
+	}
 }
 
 static void dw_mci_idmac_reset(struct dw_mci *host)
@@ -850,13 +851,13 @@ static const struct dw_mci_dma_ops dw_mci_edmac_ops = {
 
 static int dw_mci_pre_dma_transfer(struct dw_mci *host,
 				   struct mmc_data *data,
-				   bool next)
+				   int cookie)
 {
 	struct scatterlist *sg;
 	unsigned int i, sg_len;
 
-	if (!next && data->host_cookie)
-		return data->host_cookie;
+	if (data->host_cookie == COOKIE_PRE_MAPPED)
+		return data->sg_len;
 
 	/*
 	 * We don't do DMA on "complex" transfers, i.e. with
@@ -881,8 +882,7 @@ static int dw_mci_pre_dma_transfer(struct dw_mci *host,
 	if (sg_len == 0)
 		return -EINVAL;
 
-	if (next)
-		data->host_cookie = sg_len;
+	data->host_cookie = cookie;
 
 	return sg_len;
 }
@@ -897,13 +897,12 @@ static void dw_mci_pre_req(struct mmc_host *mmc,
 	if (!slot->host->use_dma || !data)
 		return;
 
-	if (data->host_cookie) {
-		data->host_cookie = 0;
-		return;
-	}
+	/* This data might be unmapped at this time */
+	data->host_cookie = COOKIE_UNMAPPED;
 
-	if (dw_mci_pre_dma_transfer(slot->host, mrq->data, 1) < 0)
-		data->host_cookie = 0;
+	if (dw_mci_pre_dma_transfer(slot->host, mrq->data,
+				COOKIE_PRE_MAPPED) < 0)
+		data->host_cookie = COOKIE_UNMAPPED;
 }
 
 static void dw_mci_post_req(struct mmc_host *mmc,
@@ -916,12 +915,12 @@ static void dw_mci_post_req(struct mmc_host *mmc,
 	if (!slot->host->use_dma || !data)
 		return;
 
-	if (data->host_cookie)
+	if (data->host_cookie != COOKIE_UNMAPPED)
 		dma_unmap_sg(slot->host->dev,
 			     data->sg,
 			     data->sg_len,
 			     dw_mci_get_dma_dir(data));
-	data->host_cookie = 0;
+	data->host_cookie = COOKIE_UNMAPPED;
 }
 
 static void dw_mci_adjust_fifoth(struct dw_mci *host, struct mmc_data *data)
@@ -1027,7 +1026,7 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data)
 	if (!host->use_dma)
 		return -ENODEV;
 
-	sg_len = dw_mci_pre_dma_transfer(host, data, 0);
+	sg_len = dw_mci_pre_dma_transfer(host, data, COOKIE_MAPPED);
 	if (sg_len < 0) {
 		host->dma_ops->stop(host);
 		return sg_len;
-- 
2.10.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 08/10] mmc: dw_mmc: remove the unnecessary mmc_data structure
       [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12   ` [PATCHv2 01/10] mmc: dw_mmc: display the real register value on debugfs Jaehoon Chung
  2016-11-15 10:12   ` [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h Jaehoon Chung
@ 2016-11-15 10:12   ` Jaehoon Chung
       [not found]     ` <20161115101232.3854-9-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-15 10:12   ` [PATCHv2 09/10] mmc: dw_mmc: The "clock-freq-min-max" property was deprecated Jaehoon Chung
  2016-11-15 10:12   ` [PATCHv2 10/10] Documentation: synopsys-dw-mshc: remove the unused properties Jaehoon Chung
  4 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	shawn.lin-TNX95d0MmH7DzftRWevZcw, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	Jaehoon Chung

Remove the unnecessary mmc_data structure.
Instead, cmd->data can be used.

Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
---
 drivers/mmc/host/dw_mmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index e912de6..ec0ba79 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -236,7 +236,6 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg);
 
 static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
 {
-	struct mmc_data	*data;
 	struct dw_mci_slot *slot = mmc_priv(mmc);
 	struct dw_mci *host = slot->host;
 	u32 cmdr;
@@ -291,10 +290,9 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
 	if (cmd->flags & MMC_RSP_CRC)
 		cmdr |= SDMMC_CMD_RESP_CRC;
 
-	data = cmd->data;
-	if (data) {
+	if (cmd->data) {
 		cmdr |= SDMMC_CMD_DAT_EXP;
-		if (data->flags & MMC_DATA_WRITE)
+		if (cmd->data->flags & MMC_DATA_WRITE)
 			cmdr |= SDMMC_CMD_DAT_WR;
 	}
 
-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 09/10] mmc: dw_mmc: The "clock-freq-min-max" property was deprecated
       [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-11-15 10:12   ` [PATCHv2 08/10] mmc: dw_mmc: remove the unnecessary mmc_data structure Jaehoon Chung
@ 2016-11-15 10:12   ` Jaehoon Chung
       [not found]     ` <20161115101232.3854-10-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2016-11-16 13:45     ` Rob Herring
  2016-11-15 10:12   ` [PATCHv2 10/10] Documentation: synopsys-dw-mshc: remove the unused properties Jaehoon Chung
  4 siblings, 2 replies; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	shawn.lin-TNX95d0MmH7DzftRWevZcw, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	Jaehoon Chung

The "clock-freq-min-max" property was deprecated.
There is "max-frequency" property in drivers/mmc/core/host.c
"max-frequency" can be replaced with "clock-freq-min-max".
Minimum clock value might be set to 100K by default.
Then MMC core should try to find the correct value from 400K to 100K.
So it just needs to set Maximum clock value.

Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 3 ++-
 drivers/mmc/host/dw_mmc.c                                  | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
index bfa461a..1279a22 100644
--- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
+++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
@@ -59,8 +59,9 @@ Optional properties:
   is specified and the ciu clock is specified then we'll try to set the ciu
   clock to this at probe time.
 
-* clock-freq-min-max: Minimum and Maximum clock frequency for card output
+* clock-freq-min-max (DEPRECATED): Minimum and Maximum clock frequency for card output
   clock(cclk_out). If it's not specified, max is 200MHZ and min is 400KHz by default.
+	  (Use the "max-frequency" instead of "clock-freq-min-max".)
 
 * num-slots: specifies the number of slots supported by the controller.
   The number of physical slots actually used could be equal or less than the
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index ec0ba79..48e968a 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2608,6 +2608,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 		mmc->f_min = DW_MCI_FREQ_MIN;
 		mmc->f_max = DW_MCI_FREQ_MAX;
 	} else {
+		dev_info(host->dev,
+			"'clock-freq-min-max' property was deprecated.\n");
 		mmc->f_min = freq[0];
 		mmc->f_max = freq[1];
 	}
-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCHv2 10/10] Documentation: synopsys-dw-mshc: remove the unused properties
       [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-11-15 10:12   ` [PATCHv2 09/10] mmc: dw_mmc: The "clock-freq-min-max" property was deprecated Jaehoon Chung
@ 2016-11-15 10:12   ` Jaehoon Chung
  2016-11-16  9:21     ` Shawn Lin
  4 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-15 10:12 UTC (permalink / raw)
  To: linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	shawn.lin-TNX95d0MmH7DzftRWevZcw, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	Jaehoon Chung

"support-highspeed" was the obsoleted property.
And "broken-cd" is not synopsys specific property.
It can be referred to mmc.txt binding Documentation.

Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
index 1279a22..7fd17c3 100644
--- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
+++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
@@ -75,11 +75,6 @@ Optional properties:
 * card-detect-delay: Delay in milli-seconds before detecting card after card
   insert event. The default value is 0.
 
-* supports-highspeed (DEPRECATED): Enables support for high speed cards (up to 50MHz)
-			   (use "cap-mmc-highspeed" or "cap-sd-highspeed" instead)
-
-* broken-cd: as documented in mmc core bindings.
-
 * vmmc-supply: The phandle to the regulator to use for vmmc.  If this is
   specified we'll defer probe until we can find this regulator.
 
-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h
       [not found]     ` <20161115101232.3854-7-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  7:53       ` Jaehoon Chung
       [not found]         ` <12405f58-695d-03d8-407f-d7471e93a6de-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-16  7:53 UTC (permalink / raw)
  To: linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Ulf Hansson,
	heiko-4mtYJXux2i+zQB+pC5nmwQ, shawn.lin-TNX95d0MmH7DzftRWevZcw,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, Adrian Hunter

Added Adrian for sdhci.h

On 11/15/2016 07:12 PM, Jaehoon Chung wrote:
> It's not for only sdhci controller.
> So it can be moved from sdhci.h to mmc.h. And renamed from sdhci_cookie
> to mmc_cookie.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
> ---
>  drivers/mmc/host/sdhci.h | 6 ------
>  include/linux/mmc/core.h | 6 ++++++
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index 766df17..325663b 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -321,12 +321,6 @@ struct sdhci_adma2_64_desc {
>  /* Allow for a a command request and a data request at the same time */
>  #define SDHCI_MAX_MRQS		2
>  
> -enum sdhci_cookie {
> -	COOKIE_UNMAPPED,
> -	COOKIE_PRE_MAPPED,	/* mapped by sdhci_pre_req() */
> -	COOKIE_MAPPED,		/* mapped by sdhci_prepare_data() */
> -};
> -
>  struct sdhci_host {
>  	/* Data set by hardware interface driver */
>  	const char *hw_name;	/* Hardware bus name */
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 0ce928b..82d707f 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -118,6 +118,12 @@ struct mmc_command {
>  	struct mmc_request	*mrq;		/* associated request */
>  };
>  
> +enum mmc_cookie {
> +	COOKIE_UNMAPPED,
> +	COOKIE_PRE_MAPPED,	/* mapped by pre_req() of controller */
> +	COOKIE_MAPPED,		/* mapped by prepare_data() of controller */
> +};
> +
>  struct mmc_data {
>  	unsigned int		timeout_ns;	/* data timeout (in ns, max 80ms) */
>  	unsigned int		timeout_clks;	/* data timeout (in clocks) */
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h
       [not found]         ` <12405f58-695d-03d8-407f-d7471e93a6de-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  8:09           ` Adrian Hunter
  2016-11-16  8:25             ` Jaehoon Chung
  0 siblings, 1 reply; 29+ messages in thread
From: Adrian Hunter @ 2016-11-16  8:09 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Ulf Hansson,
	heiko-4mtYJXux2i+zQB+pC5nmwQ, shawn.lin-TNX95d0MmH7DzftRWevZcw,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

On 16/11/16 09:53, Jaehoon Chung wrote:
> Added Adrian for sdhci.h
> 
> On 11/15/2016 07:12 PM, Jaehoon Chung wrote:
>> It's not for only sdhci controller.
>> So it can be moved from sdhci.h to mmc.h. And renamed from sdhci_cookie
>> to mmc_cookie.

The cookie is currently host private data, so I don't understand the
motivation behind this.

>>
>> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
>> ---
>>  drivers/mmc/host/sdhci.h | 6 ------
>>  include/linux/mmc/core.h | 6 ++++++
>>  2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
>> index 766df17..325663b 100644
>> --- a/drivers/mmc/host/sdhci.h
>> +++ b/drivers/mmc/host/sdhci.h
>> @@ -321,12 +321,6 @@ struct sdhci_adma2_64_desc {
>>  /* Allow for a a command request and a data request at the same time */
>>  #define SDHCI_MAX_MRQS		2
>>  
>> -enum sdhci_cookie {
>> -	COOKIE_UNMAPPED,
>> -	COOKIE_PRE_MAPPED,	/* mapped by sdhci_pre_req() */
>> -	COOKIE_MAPPED,		/* mapped by sdhci_prepare_data() */
>> -};
>> -
>>  struct sdhci_host {
>>  	/* Data set by hardware interface driver */
>>  	const char *hw_name;	/* Hardware bus name */
>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
>> index 0ce928b..82d707f 100644
>> --- a/include/linux/mmc/core.h
>> +++ b/include/linux/mmc/core.h
>> @@ -118,6 +118,12 @@ struct mmc_command {
>>  	struct mmc_request	*mrq;		/* associated request */
>>  };
>>  
>> +enum mmc_cookie {
>> +	COOKIE_UNMAPPED,
>> +	COOKIE_PRE_MAPPED,	/* mapped by pre_req() of controller */
>> +	COOKIE_MAPPED,		/* mapped by prepare_data() of controller */
>> +};
>> +
>>  struct mmc_data {
>>  	unsigned int		timeout_ns;	/* data timeout (in ns, max 80ms) */
>>  	unsigned int		timeout_clks;	/* data timeout (in clocks) */
>>
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h
  2016-11-16  8:09           ` Adrian Hunter
@ 2016-11-16  8:25             ` Jaehoon Chung
       [not found]               ` <89535076-4a77-64a5-68d9-ce15e03b8fb3-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-16  8:25 UTC (permalink / raw)
  To: Adrian Hunter, linux-mmc
  Cc: devicetree, Ulf Hansson, heiko, shawn.lin, robh+dt

On 11/16/2016 05:09 PM, Adrian Hunter wrote:
> On 16/11/16 09:53, Jaehoon Chung wrote:
>> Added Adrian for sdhci.h
>>
>> On 11/15/2016 07:12 PM, Jaehoon Chung wrote:
>>> It's not for only sdhci controller.
>>> So it can be moved from sdhci.h to mmc.h. And renamed from sdhci_cookie
>>> to mmc_cookie.
> 
> The cookie is currently host private data, so I don't understand the
> motivation behind this.

dwmmc controller can also use the data->host_cookie. because it's working with post/pre_req().

So i think it can be used about both sdhci and dwmmc.
Is there no reason that add the private dwmmc data?

With these cookie value, update the dwmmc controller for post/pre_req().

https://patchwork.kernel.org/patch/9429287/

Best Regards,
Jaehoon Chung

> 
>>>
>>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>>> Tested-by: Heiko Stuebner <heiko@sntech.de>
>>> ---
>>>  drivers/mmc/host/sdhci.h | 6 ------
>>>  include/linux/mmc/core.h | 6 ++++++
>>>  2 files changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
>>> index 766df17..325663b 100644
>>> --- a/drivers/mmc/host/sdhci.h
>>> +++ b/drivers/mmc/host/sdhci.h
>>> @@ -321,12 +321,6 @@ struct sdhci_adma2_64_desc {
>>>  /* Allow for a a command request and a data request at the same time */
>>>  #define SDHCI_MAX_MRQS		2
>>>  
>>> -enum sdhci_cookie {
>>> -	COOKIE_UNMAPPED,
>>> -	COOKIE_PRE_MAPPED,	/* mapped by sdhci_pre_req() */
>>> -	COOKIE_MAPPED,		/* mapped by sdhci_prepare_data() */
>>> -};
>>> -
>>>  struct sdhci_host {
>>>  	/* Data set by hardware interface driver */
>>>  	const char *hw_name;	/* Hardware bus name */
>>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
>>> index 0ce928b..82d707f 100644
>>> --- a/include/linux/mmc/core.h
>>> +++ b/include/linux/mmc/core.h
>>> @@ -118,6 +118,12 @@ struct mmc_command {
>>>  	struct mmc_request	*mrq;		/* associated request */
>>>  };
>>>  
>>> +enum mmc_cookie {
>>> +	COOKIE_UNMAPPED,
>>> +	COOKIE_PRE_MAPPED,	/* mapped by pre_req() of controller */
>>> +	COOKIE_MAPPED,		/* mapped by prepare_data() of controller */
>>> +};
>>> +
>>>  struct mmc_data {
>>>  	unsigned int		timeout_ns;	/* data timeout (in ns, max 80ms) */
>>>  	unsigned int		timeout_clks;	/* data timeout (in clocks) */
>>>
>>
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h
       [not found]               ` <89535076-4a77-64a5-68d9-ce15e03b8fb3-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  8:28                 ` Adrian Hunter
       [not found]                   ` <d5321daf-b449-e556-ccf1-cd82d497ea85-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Adrian Hunter @ 2016-11-16  8:28 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Ulf Hansson,
	heiko-4mtYJXux2i+zQB+pC5nmwQ, shawn.lin-TNX95d0MmH7DzftRWevZcw,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

On 16/11/16 10:25, Jaehoon Chung wrote:
> On 11/16/2016 05:09 PM, Adrian Hunter wrote:
>> On 16/11/16 09:53, Jaehoon Chung wrote:
>>> Added Adrian for sdhci.h
>>>
>>> On 11/15/2016 07:12 PM, Jaehoon Chung wrote:
>>>> It's not for only sdhci controller.
>>>> So it can be moved from sdhci.h to mmc.h. And renamed from sdhci_cookie
>>>> to mmc_cookie.
>>
>> The cookie is currently host private data, so I don't understand the
>> motivation behind this.
> 
> dwmmc controller can also use the data->host_cookie. because it's working with post/pre_req().
> 
> So i think it can be used about both sdhci and dwmmc.
> Is there no reason that add the private dwmmc data?
> 
> With these cookie value, update the dwmmc controller for post/pre_req().
> 
> https://patchwork.kernel.org/patch/9429287/

So why not define dwmmc cookies in dw_mmc.c ?

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h
       [not found]                   ` <d5321daf-b449-e556-ccf1-cd82d497ea85-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-11-16  8:58                     ` Jaehoon Chung
  2016-11-16  9:04                       ` Adrian Hunter
  0 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-16  8:58 UTC (permalink / raw)
  To: Adrian Hunter, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Ulf Hansson,
	heiko-4mtYJXux2i+zQB+pC5nmwQ, shawn.lin-TNX95d0MmH7DzftRWevZcw,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

On 11/16/2016 05:28 PM, Adrian Hunter wrote:
> On 16/11/16 10:25, Jaehoon Chung wrote:
>> On 11/16/2016 05:09 PM, Adrian Hunter wrote:
>>> On 16/11/16 09:53, Jaehoon Chung wrote:
>>>> Added Adrian for sdhci.h
>>>>
>>>> On 11/15/2016 07:12 PM, Jaehoon Chung wrote:
>>>>> It's not for only sdhci controller.
>>>>> So it can be moved from sdhci.h to mmc.h. And renamed from sdhci_cookie
>>>>> to mmc_cookie.
>>>
>>> The cookie is currently host private data, so I don't understand the
>>> motivation behind this.
>>
>> dwmmc controller can also use the data->host_cookie. because it's working with post/pre_req().
>>
>> So i think it can be used about both sdhci and dwmmc.
>> Is there no reason that add the private dwmmc data?
>>
>> With these cookie value, update the dwmmc controller for post/pre_req().
>>
>> https://patchwork.kernel.org/patch/9429287/
> 
> So why not define dwmmc cookies in dw_mmc.c ?

Because I understood that it's not sdhci specific cookies. It can be used generally, doesn't?

Role of post/pre_req() in host controller is the doing dma_map/unmap().
And data's cookies only needs to notice whether dma is mapped or unmapped, etc.

Well, If it's really private value and should be added other cookies values in future, i will put cookies in dw_mmc.h.
(it should be duplicated in sdhci and dwmmc.)

Best Regards,
Jaehoon Chung

> 
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 02/10] mmc: dw_mmc: fix the debug message for checking card's present
       [not found]   ` <20161115101232.3854-3-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  9:01     ` Shawn Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Shawn Lin @ 2016-11-16  9:01 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: linux-mmc-u79uwXL29TY76Z2rM5mHXA,
	shawn.lin-TNX95d0MmH7DzftRWevZcw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

On 2016/11/15 18:12, Jaehoon Chung wrote:
> If display the debug message, this message should be spamming.
> If flags is maintained the previous value, didn't display the debug
> message.
>
> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>

Looks correct to me,

Reviewed-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

> ---
>  drivers/mmc/host/dw_mmc.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index e53899e..6c0c4c5 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1537,13 +1537,10 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
>  			== 0 ? 1 : 0;
>
>  	spin_lock_bh(&host->lock);
> -	if (present) {
> -		set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
> +	if (present && !test_and_set_bit(DW_MMC_CARD_PRESENT, &slot->flags))
>  		dev_dbg(&mmc->class_dev, "card is present\n");
> -	} else {
> -		clear_bit(DW_MMC_CARD_PRESENT, &slot->flags);
> +	else if (!test_and_clear_bit(DW_MMC_CARD_PRESENT, &slot->flags))
>  		dev_dbg(&mmc->class_dev, "card is not present\n");
> -	}
>  	spin_unlock_bh(&host->lock);
>
>  	return present;
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h
  2016-11-16  8:58                     ` Jaehoon Chung
@ 2016-11-16  9:04                       ` Adrian Hunter
       [not found]                         ` <3e05ec88-af1d-9996-bbdb-c453f7e4bb07-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Adrian Hunter @ 2016-11-16  9:04 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc
  Cc: devicetree, Ulf Hansson, heiko, shawn.lin, robh+dt

On 16/11/16 10:58, Jaehoon Chung wrote:
> On 11/16/2016 05:28 PM, Adrian Hunter wrote:
>> On 16/11/16 10:25, Jaehoon Chung wrote:
>>> On 11/16/2016 05:09 PM, Adrian Hunter wrote:
>>>> On 16/11/16 09:53, Jaehoon Chung wrote:
>>>>> Added Adrian for sdhci.h
>>>>>
>>>>> On 11/15/2016 07:12 PM, Jaehoon Chung wrote:
>>>>>> It's not for only sdhci controller.
>>>>>> So it can be moved from sdhci.h to mmc.h. And renamed from sdhci_cookie
>>>>>> to mmc_cookie.
>>>>
>>>> The cookie is currently host private data, so I don't understand the
>>>> motivation behind this.
>>>
>>> dwmmc controller can also use the data->host_cookie. because it's working with post/pre_req().
>>>
>>> So i think it can be used about both sdhci and dwmmc.
>>> Is there no reason that add the private dwmmc data?
>>>
>>> With these cookie value, update the dwmmc controller for post/pre_req().
>>>
>>> https://patchwork.kernel.org/patch/9429287/
>>
>> So why not define dwmmc cookies in dw_mmc.c ?
> 
> Because I understood that it's not sdhci specific cookies. It can be used generally, doesn't?
> 
> Role of post/pre_req() in host controller is the doing dma_map/unmap().
> And data's cookies only needs to notice whether dma is mapped or unmapped, etc.
> 
> Well, If it's really private value and should be added other cookies values in future, i will put cookies in dw_mmc.h.
> (it should be duplicated in sdhci and dwmmc.)

Probably all host controllers should do cookies the same way, but they don't
at the moment, so there is no reason to share definitions.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 01/10] mmc: dw_mmc: display the real register value on debugfs
       [not found]     ` <20161115101232.3854-2-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  9:04       ` Shawn Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Shawn Lin @ 2016-11-16  9:04 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: linux-mmc-u79uwXL29TY76Z2rM5mHXA,
	shawn.lin-TNX95d0MmH7DzftRWevZcw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

在 2016/11/15 18:12, Jaehoon Chung 写道:
> Developer wants to see the real register value, not register offset.
> This patch fixed to display the real value of register.
>

IIRC, you had submited some similar patch but I don't remember
why it wasn't merged?

Anyway,

Reviewed-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
> ---
>  drivers/mmc/host/dw_mmc.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index a16c537..e53899e 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -165,12 +165,14 @@ static const struct file_operations dw_mci_req_fops = {
>
>  static int dw_mci_regs_show(struct seq_file *s, void *v)
>  {
> -	seq_printf(s, "STATUS:\t0x%08x\n", SDMMC_STATUS);
> -	seq_printf(s, "RINTSTS:\t0x%08x\n", SDMMC_RINTSTS);
> -	seq_printf(s, "CMD:\t0x%08x\n", SDMMC_CMD);
> -	seq_printf(s, "CTRL:\t0x%08x\n", SDMMC_CTRL);
> -	seq_printf(s, "INTMASK:\t0x%08x\n", SDMMC_INTMASK);
> -	seq_printf(s, "CLKENA:\t0x%08x\n", SDMMC_CLKENA);
> +	struct dw_mci *host = s->private;
> +
> +	seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS));
> +	seq_printf(s, "RINTSTS:\t0x%08x\n", mci_readl(host, RINTSTS));
> +	seq_printf(s, "CMD:\t0x%08x\n", mci_readl(host, CMD));
> +	seq_printf(s, "CTRL:\t0x%08x\n", mci_readl(host, CTRL));
> +	seq_printf(s, "INTMASK:\t0x%08x\n", mci_readl(host, INTMASK));
> +	seq_printf(s, "CLKENA:\t0x%08x\n", mci_readl(host, CLKENA));
>
>  	return 0;
>  }
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 03/10] mmc: dw_mmc: change the DW_MCI_FREQ_MIN from 400K to 100K
       [not found]   ` <20161115101232.3854-4-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  9:06     ` Shawn Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Shawn Lin @ 2016-11-16  9:06 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: shawn.lin-TNX95d0MmH7DzftRWevZcw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

在 2016/11/15 18:12, Jaehoon Chung 写道:
> If there is no property "clock-freq-min-max", mmc->f_min should be set
> to 400K by default. But Some SoC can be used 100K.
> When 100K is used, MMC core will try to check from 400K to 100K.
>
> Reported-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>

It makes more sense that the original 400KHz, thanks for improving
that.

Reviewed-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

> ---
>  drivers/mmc/host/dw_mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 6c0c4c5..be36f48 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -54,7 +54,7 @@
>  #define DW_MCI_DMA_THRESHOLD	16
>
>  #define DW_MCI_FREQ_MAX	200000000	/* unit: HZ */
> -#define DW_MCI_FREQ_MIN	400000		/* unit: HZ */
> +#define DW_MCI_FREQ_MIN	100000		/* unit: HZ */
>
>  #define IDMAC_INT_CLR		(SDMMC_IDMAC_INT_AI | SDMMC_IDMAC_INT_NI | \
>  				 SDMMC_IDMAC_INT_CES | SDMMC_IDMAC_INT_DU | \
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 04/10] mmc: dw_mmc: use the hold register when send stop command
       [not found]   ` <20161115101232.3854-5-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  9:09     ` Shawn Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Shawn Lin @ 2016-11-16  9:09 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: shawn.lin-TNX95d0MmH7DzftRWevZcw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

在 2016/11/15 18:12, Jaehoon Chung 写道:
> If DW_MMC_CARD_NO_USE_HOLD isn't set, it's usesd by default.
> Enve if SDMMC_CMD_USB_HOLD_REG is set in prepare_command(), but it
> doesn't set in pre_stop_abort().
>
> To maintain the consistency, add the checking condition for this.

Actually I hacked the driver  w/ or w/o this patch to see how the
controller would do when looking at your V1.

Interesting, I didn't see failure when missing to set this...But
definitely it should be fixed.

Reviewed-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

>
> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
> ---
>  drivers/mmc/host/dw_mmc.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index be36f48..3cda68c 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -337,6 +337,9 @@ static u32 dw_mci_prep_stop_abort(struct dw_mci *host, struct mmc_command *cmd)
>  	cmdr = stop->opcode | SDMMC_CMD_STOP |
>  		SDMMC_CMD_RESP_CRC | SDMMC_CMD_RESP_EXP;
>
> +	if (!test_bit(DW_MMC_CARD_NO_USE_HOLD, &host->cur_slot->flags))
> +		cmdr |= SDMMC_CMD_USE_HOLD_REG;
> +
>  	return cmdr;
>  }
>
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default
       [not found]   ` <20161115101232.3854-6-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  9:16     ` Shawn Lin
       [not found]       ` <6d7625c0-8588-5d11-7475-38fa611d8614-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Shawn Lin @ 2016-11-16  9:16 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: shawn.lin-TNX95d0MmH7DzftRWevZcw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

在 2016/11/15 18:12, Jaehoon Chung 写道:
> stop_cmdr should be set to values relevant to stop command.
> It migth be assigned to values whatever there is mrq->stop or not.
> Then it doesn't need to use dw_mci_prepare_command().
> It's enough to use the prep_stop_abort for preparing stop command.
>

Have you considered to clean up the logic of preparing abort cmd
within dw_mci_prepare_command?


         if (cmd->opcode == MMC_STOP_TRANSMISSION ||
             cmd->opcode == MMC_GO_IDLE_STATE ||
             cmd->opcode == MMC_GO_INACTIVE_STATE ||
             (cmd->opcode == SD_IO_RW_DIRECT &&
              ((cmd->arg >> 9) & 0x1FFFF) == SDIO_CCCR_ABORT))
                 cmdr |= SDMMC_CMD_STOP;


> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
> ---
>  drivers/mmc/host/dw_mmc.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 3cda68c..12e1107 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -385,7 +385,7 @@ static void dw_mci_start_command(struct dw_mci *host,
>
>  static inline void send_stop_abort(struct dw_mci *host, struct mmc_data *data)
>  {
> -	struct mmc_command *stop = data->stop ? data->stop : &host->stop_abort;
> +	struct mmc_command *stop = &host->stop_abort;
>
>  	dw_mci_start_command(host, stop, host->stop_cmdr);
>  }
> @@ -1277,10 +1277,7 @@ static void __dw_mci_start_request(struct dw_mci *host,
>  		spin_unlock_irqrestore(&host->irq_lock, irqflags);
>  	}
>
> -	if (mrq->stop)
> -		host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop);
> -	else
> -		host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
> +	host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
>  }
>
>  static void dw_mci_start_request(struct dw_mci *host,
> @@ -1890,8 +1887,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>  			if (test_and_clear_bit(EVENT_DATA_ERROR,
>  					       &host->pending_events)) {
>  				dw_mci_stop_dma(host);
> -				if (data->stop ||
> -				    !(host->data_status & (SDMMC_INT_DRTO |
> +				if (!(host->data_status & (SDMMC_INT_DRTO |
>  							   SDMMC_INT_EBE)))
>  					send_stop_abort(host, data);
>  				state = STATE_DATA_ERROR;
> @@ -1927,8 +1923,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>  			if (test_and_clear_bit(EVENT_DATA_ERROR,
>  					       &host->pending_events)) {
>  				dw_mci_stop_dma(host);
> -				if (data->stop ||
> -				    !(host->data_status & (SDMMC_INT_DRTO |
> +				if (!(host->data_status & (SDMMC_INT_DRTO |
>  							   SDMMC_INT_EBE)))
>  					send_stop_abort(host, data);
>  				state = STATE_DATA_ERROR;
> @@ -2004,7 +1999,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>  			host->cmd = NULL;
>  			host->data = NULL;
>
> -			if (mrq->stop)
> +			if (!mrq->sbc && mrq->stop)
>  				dw_mci_command_complete(host, mrq->stop);
>  			else
>  				host->cmd_status = 0;
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 08/10] mmc: dw_mmc: remove the unnecessary mmc_data structure
       [not found]     ` <20161115101232.3854-9-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  9:18       ` Shawn Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Shawn Lin @ 2016-11-16  9:18 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: linux-mmc-u79uwXL29TY76Z2rM5mHXA,
	shawn.lin-TNX95d0MmH7DzftRWevZcw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

在 2016/11/15 18:12, Jaehoon Chung 写道:
> Remove the unnecessary mmc_data structure.
> Instead, cmd->data can be used.
>

Looks good to me,

Reviewed-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
> ---
>  drivers/mmc/host/dw_mmc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index e912de6..ec0ba79 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -236,7 +236,6 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg);
>
>  static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
>  {
> -	struct mmc_data	*data;
>  	struct dw_mci_slot *slot = mmc_priv(mmc);
>  	struct dw_mci *host = slot->host;
>  	u32 cmdr;
> @@ -291,10 +290,9 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
>  	if (cmd->flags & MMC_RSP_CRC)
>  		cmdr |= SDMMC_CMD_RESP_CRC;
>
> -	data = cmd->data;
> -	if (data) {
> +	if (cmd->data) {
>  		cmdr |= SDMMC_CMD_DAT_EXP;
> -		if (data->flags & MMC_DATA_WRITE)
> +		if (cmd->data->flags & MMC_DATA_WRITE)
>  			cmdr |= SDMMC_CMD_DAT_WR;
>  	}
>
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 09/10] mmc: dw_mmc: The "clock-freq-min-max" property was deprecated
       [not found]     ` <20161115101232.3854-10-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16  9:19       ` Shawn Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Shawn Lin @ 2016-11-16  9:19 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: linux-mmc-u79uwXL29TY76Z2rM5mHXA,
	shawn.lin-TNX95d0MmH7DzftRWevZcw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

在 2016/11/15 18:12, Jaehoon Chung 写道:
> The "clock-freq-min-max" property was deprecated.
> There is "max-frequency" property in drivers/mmc/core/host.c
> "max-frequency" can be replaced with "clock-freq-min-max".
> Minimum clock value might be set to 100K by default.
> Then MMC core should try to find the correct value from 400K to 100K.
> So it just needs to set Maximum clock value.
>

This is what we talked about to do :-)

Reviewed-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 3 ++-
>  drivers/mmc/host/dw_mmc.c                                  | 2 ++
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> index bfa461a..1279a22 100644
> --- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> +++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> @@ -59,8 +59,9 @@ Optional properties:
>    is specified and the ciu clock is specified then we'll try to set the ciu
>    clock to this at probe time.
>
> -* clock-freq-min-max: Minimum and Maximum clock frequency for card output
> +* clock-freq-min-max (DEPRECATED): Minimum and Maximum clock frequency for card output
>    clock(cclk_out). If it's not specified, max is 200MHZ and min is 400KHz by default.
> +	  (Use the "max-frequency" instead of "clock-freq-min-max".)
>
>  * num-slots: specifies the number of slots supported by the controller.
>    The number of physical slots actually used could be equal or less than the
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index ec0ba79..48e968a 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2608,6 +2608,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
>  		mmc->f_min = DW_MCI_FREQ_MIN;
>  		mmc->f_max = DW_MCI_FREQ_MAX;
>  	} else {
> +		dev_info(host->dev,
> +			"'clock-freq-min-max' property was deprecated.\n");
>  		mmc->f_min = freq[0];
>  		mmc->f_max = freq[1];
>  	}
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 10/10] Documentation: synopsys-dw-mshc: remove the unused properties
  2016-11-15 10:12   ` [PATCHv2 10/10] Documentation: synopsys-dw-mshc: remove the unused properties Jaehoon Chung
@ 2016-11-16  9:21     ` Shawn Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Shawn Lin @ 2016-11-16  9:21 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: linux-mmc, shawn.lin, devicetree, ulf.hansson, heiko, robh+dt

在 2016/11/15 18:12, Jaehoon Chung 写道:
> "support-highspeed" was the obsoleted property.
> And "broken-cd" is not synopsys specific property.
> It can be referred to mmc.txt binding Documentation.
>

Ahh, I forgot to remove broken-cd from doc of dwmmc
when removing it from code.

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Acked-by: Rob Herring <robh@kernel.org>
> ---
>  Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> index 1279a22..7fd17c3 100644
> --- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> +++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> @@ -75,11 +75,6 @@ Optional properties:
>  * card-detect-delay: Delay in milli-seconds before detecting card after card
>    insert event. The default value is 0.
>
> -* supports-highspeed (DEPRECATED): Enables support for high speed cards (up to 50MHz)
> -			   (use "cap-mmc-highspeed" or "cap-sd-highspeed" instead)
> -
> -* broken-cd: as documented in mmc core bindings.
> -
>  * vmmc-supply: The phandle to the regulator to use for vmmc.  If this is
>    specified we'll defer probe until we can find this regulator.
>
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h
       [not found]                         ` <3e05ec88-af1d-9996-bbdb-c453f7e4bb07-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-11-16  9:23                           ` Jaehoon Chung
  0 siblings, 0 replies; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-16  9:23 UTC (permalink / raw)
  To: Adrian Hunter, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Ulf Hansson,
	heiko-4mtYJXux2i+zQB+pC5nmwQ, shawn.lin-TNX95d0MmH7DzftRWevZcw,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

On 11/16/2016 06:04 PM, Adrian Hunter wrote:
> On 16/11/16 10:58, Jaehoon Chung wrote:
>> On 11/16/2016 05:28 PM, Adrian Hunter wrote:
>>> On 16/11/16 10:25, Jaehoon Chung wrote:
>>>> On 11/16/2016 05:09 PM, Adrian Hunter wrote:
>>>>> On 16/11/16 09:53, Jaehoon Chung wrote:
>>>>>> Added Adrian for sdhci.h
>>>>>>
>>>>>> On 11/15/2016 07:12 PM, Jaehoon Chung wrote:
>>>>>>> It's not for only sdhci controller.
>>>>>>> So it can be moved from sdhci.h to mmc.h. And renamed from sdhci_cookie
>>>>>>> to mmc_cookie.
>>>>>
>>>>> The cookie is currently host private data, so I don't understand the
>>>>> motivation behind this.
>>>>
>>>> dwmmc controller can also use the data->host_cookie. because it's working with post/pre_req().
>>>>
>>>> So i think it can be used about both sdhci and dwmmc.
>>>> Is there no reason that add the private dwmmc data?
>>>>
>>>> With these cookie value, update the dwmmc controller for post/pre_req().
>>>>
>>>> https://patchwork.kernel.org/patch/9429287/
>>>
>>> So why not define dwmmc cookies in dw_mmc.c ?
>>
>> Because I understood that it's not sdhci specific cookies. It can be used generally, doesn't?
>>
>> Role of post/pre_req() in host controller is the doing dma_map/unmap().
>> And data's cookies only needs to notice whether dma is mapped or unmapped, etc.
>>
>> Well, If it's really private value and should be added other cookies values in future, i will put cookies in dw_mmc.h.
>> (it should be duplicated in sdhci and dwmmc.)
> 
> Probably all host controllers should do cookies the same way, but they don't
> at the moment, so there is no reason to share definitions.

Ok. Then I will put dwmmc_cookie in dw_mmc.h on next version. 
Thanks for comments.

Best Regards,
Jaehoon Chung

> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 09/10] mmc: dw_mmc: The "clock-freq-min-max" property was deprecated
  2016-11-15 10:12   ` [PATCHv2 09/10] mmc: dw_mmc: The "clock-freq-min-max" property was deprecated Jaehoon Chung
       [not found]     ` <20161115101232.3854-10-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-16 13:45     ` Rob Herring
  1 sibling, 0 replies; 29+ messages in thread
From: Rob Herring @ 2016-11-16 13:45 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc, devicetree, ulf.hansson, heiko, shawn.lin

On Tue, Nov 15, 2016 at 07:12:31PM +0900, Jaehoon Chung wrote:
> The "clock-freq-min-max" property was deprecated.
> There is "max-frequency" property in drivers/mmc/core/host.c
> "max-frequency" can be replaced with "clock-freq-min-max".
> Minimum clock value might be set to 100K by default.
> Then MMC core should try to find the correct value from 400K to 100K.
> So it just needs to set Maximum clock value.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
>  Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 3 ++-
>  drivers/mmc/host/dw_mmc.c                                  | 2 ++
>  2 files changed, 4 insertions(+), 1 deletion(-)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default
       [not found]       ` <6d7625c0-8588-5d11-7475-38fa611d8614-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2016-11-17  5:05         ` Jaehoon Chung
       [not found]           ` <868dbb62-4b0d-3492-0b13-093ce63c5cde-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Jaehoon Chung @ 2016-11-17  5:05 UTC (permalink / raw)
  To: Shawn Lin, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

On 11/16/2016 06:16 PM, Shawn Lin wrote:
> 在 2016/11/15 18:12, Jaehoon Chung 写道:
>> stop_cmdr should be set to values relevant to stop command.
>> It migth be assigned to values whatever there is mrq->stop or not.
>> Then it doesn't need to use dw_mci_prepare_command().
>> It's enough to use the prep_stop_abort for preparing stop command.
>>
> 
> Have you considered to clean up the logic of preparing abort cmd
> within dw_mci_prepare_command?

I have considered this..but i didn't check fully for this logic.
I think it's possible to clean and make more simpler than now.

how about thinking more after applying these patch-set? :)

Best Regards,
Jaehoon Chung

> 
> 
>         if (cmd->opcode == MMC_STOP_TRANSMISSION ||
>             cmd->opcode == MMC_GO_IDLE_STATE ||
>             cmd->opcode == MMC_GO_INACTIVE_STATE ||
>             (cmd->opcode == SD_IO_RW_DIRECT &&
>              ((cmd->arg >> 9) & 0x1FFFF) == SDIO_CCCR_ABORT))
>                 cmdr |= SDMMC_CMD_STOP;
> 
> 
>> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
>> ---
>>  drivers/mmc/host/dw_mmc.c | 15 +++++----------
>>  1 file changed, 5 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 3cda68c..12e1107 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -385,7 +385,7 @@ static void dw_mci_start_command(struct dw_mci *host,
>>
>>  static inline void send_stop_abort(struct dw_mci *host, struct mmc_data *data)
>>  {
>> -    struct mmc_command *stop = data->stop ? data->stop : &host->stop_abort;
>> +    struct mmc_command *stop = &host->stop_abort;
>>
>>      dw_mci_start_command(host, stop, host->stop_cmdr);
>>  }
>> @@ -1277,10 +1277,7 @@ static void __dw_mci_start_request(struct dw_mci *host,
>>          spin_unlock_irqrestore(&host->irq_lock, irqflags);
>>      }
>>
>> -    if (mrq->stop)
>> -        host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop);
>> -    else
>> -        host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
>> +    host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
>>  }
>>
>>  static void dw_mci_start_request(struct dw_mci *host,
>> @@ -1890,8 +1887,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>              if (test_and_clear_bit(EVENT_DATA_ERROR,
>>                             &host->pending_events)) {
>>                  dw_mci_stop_dma(host);
>> -                if (data->stop ||
>> -                    !(host->data_status & (SDMMC_INT_DRTO |
>> +                if (!(host->data_status & (SDMMC_INT_DRTO |
>>                                 SDMMC_INT_EBE)))
>>                      send_stop_abort(host, data);
>>                  state = STATE_DATA_ERROR;
>> @@ -1927,8 +1923,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>              if (test_and_clear_bit(EVENT_DATA_ERROR,
>>                             &host->pending_events)) {
>>                  dw_mci_stop_dma(host);
>> -                if (data->stop ||
>> -                    !(host->data_status & (SDMMC_INT_DRTO |
>> +                if (!(host->data_status & (SDMMC_INT_DRTO |
>>                                 SDMMC_INT_EBE)))
>>                      send_stop_abort(host, data);
>>                  state = STATE_DATA_ERROR;
>> @@ -2004,7 +1999,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>              host->cmd = NULL;
>>              host->data = NULL;
>>
>> -            if (mrq->stop)
>> +            if (!mrq->sbc && mrq->stop)
>>                  dw_mci_command_complete(host, mrq->stop);
>>              else
>>                  host->cmd_status = 0;
>>
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default
       [not found]           ` <868dbb62-4b0d-3492-0b13-093ce63c5cde-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2016-11-17  7:49             ` Shawn Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Shawn Lin @ 2016-11-17  7:49 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: shawn.lin-TNX95d0MmH7DzftRWevZcw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A

在 2016/11/17 13:05, Jaehoon Chung 写道:
> On 11/16/2016 06:16 PM, Shawn Lin wrote:
>> 在 2016/11/15 18:12, Jaehoon Chung 写道:
>>> stop_cmdr should be set to values relevant to stop command.
>>> It migth be assigned to values whatever there is mrq->stop or not.
>>> Then it doesn't need to use dw_mci_prepare_command().
>>> It's enough to use the prep_stop_abort for preparing stop command.
>>>
>>
>> Have you considered to clean up the logic of preparing abort cmd
>> within dw_mci_prepare_command?
>
> I have considered this..but i didn't check fully for this logic.
> I think it's possible to clean and make more simpler than now.
>
> how about thinking more after applying these patch-set? :)

it's okay :)

>
> Best Regards,
> Jaehoon Chung
>
>>
>>
>>         if (cmd->opcode == MMC_STOP_TRANSMISSION ||
>>             cmd->opcode == MMC_GO_IDLE_STATE ||
>>             cmd->opcode == MMC_GO_INACTIVE_STATE ||
>>             (cmd->opcode == SD_IO_RW_DIRECT &&
>>              ((cmd->arg >> 9) & 0x1FFFF) == SDIO_CCCR_ABORT))
>>                 cmdr |= SDMMC_CMD_STOP;
>>
>>
>>> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
>>> ---
>>>  drivers/mmc/host/dw_mmc.c | 15 +++++----------
>>>  1 file changed, 5 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>>> index 3cda68c..12e1107 100644
>>> --- a/drivers/mmc/host/dw_mmc.c
>>> +++ b/drivers/mmc/host/dw_mmc.c
>>> @@ -385,7 +385,7 @@ static void dw_mci_start_command(struct dw_mci *host,
>>>
>>>  static inline void send_stop_abort(struct dw_mci *host, struct mmc_data *data)
>>>  {
>>> -    struct mmc_command *stop = data->stop ? data->stop : &host->stop_abort;
>>> +    struct mmc_command *stop = &host->stop_abort;
>>>
>>>      dw_mci_start_command(host, stop, host->stop_cmdr);
>>>  }
>>> @@ -1277,10 +1277,7 @@ static void __dw_mci_start_request(struct dw_mci *host,
>>>          spin_unlock_irqrestore(&host->irq_lock, irqflags);
>>>      }
>>>
>>> -    if (mrq->stop)
>>> -        host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop);
>>> -    else
>>> -        host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
>>> +    host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
>>>  }
>>>
>>>  static void dw_mci_start_request(struct dw_mci *host,
>>> @@ -1890,8 +1887,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>>              if (test_and_clear_bit(EVENT_DATA_ERROR,
>>>                             &host->pending_events)) {
>>>                  dw_mci_stop_dma(host);
>>> -                if (data->stop ||
>>> -                    !(host->data_status & (SDMMC_INT_DRTO |
>>> +                if (!(host->data_status & (SDMMC_INT_DRTO |
>>>                                 SDMMC_INT_EBE)))
>>>                      send_stop_abort(host, data);
>>>                  state = STATE_DATA_ERROR;
>>> @@ -1927,8 +1923,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>>              if (test_and_clear_bit(EVENT_DATA_ERROR,
>>>                             &host->pending_events)) {
>>>                  dw_mci_stop_dma(host);
>>> -                if (data->stop ||
>>> -                    !(host->data_status & (SDMMC_INT_DRTO |
>>> +                if (!(host->data_status & (SDMMC_INT_DRTO |
>>>                                 SDMMC_INT_EBE)))
>>>                      send_stop_abort(host, data);
>>>                  state = STATE_DATA_ERROR;
>>> @@ -2004,7 +1999,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>>              host->cmd = NULL;
>>>              host->data = NULL;
>>>
>>> -            if (mrq->stop)
>>> +            if (!mrq->sbc && mrq->stop)
>>>                  dw_mci_command_complete(host, mrq->stop);
>>>              else
>>>                  host->cmd_status = 0;
>>>
>>
>>
>
>
>
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2016-11-17  7:49 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 10:12 [PATCHv2 00/10] mmc: dw_mmc: clean the codes for dwmmc controller Jaehoon Chung
     [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-15 10:12   ` [PATCHv2 01/10] mmc: dw_mmc: display the real register value on debugfs Jaehoon Chung
     [not found]     ` <20161115101232.3854-2-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:04       ` Shawn Lin
2016-11-15 10:12   ` [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h Jaehoon Chung
     [not found]     ` <20161115101232.3854-7-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  7:53       ` Jaehoon Chung
     [not found]         ` <12405f58-695d-03d8-407f-d7471e93a6de-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  8:09           ` Adrian Hunter
2016-11-16  8:25             ` Jaehoon Chung
     [not found]               ` <89535076-4a77-64a5-68d9-ce15e03b8fb3-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  8:28                 ` Adrian Hunter
     [not found]                   ` <d5321daf-b449-e556-ccf1-cd82d497ea85-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-16  8:58                     ` Jaehoon Chung
2016-11-16  9:04                       ` Adrian Hunter
     [not found]                         ` <3e05ec88-af1d-9996-bbdb-c453f7e4bb07-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-16  9:23                           ` Jaehoon Chung
2016-11-15 10:12   ` [PATCHv2 08/10] mmc: dw_mmc: remove the unnecessary mmc_data structure Jaehoon Chung
     [not found]     ` <20161115101232.3854-9-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:18       ` Shawn Lin
2016-11-15 10:12   ` [PATCHv2 09/10] mmc: dw_mmc: The "clock-freq-min-max" property was deprecated Jaehoon Chung
     [not found]     ` <20161115101232.3854-10-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:19       ` Shawn Lin
2016-11-16 13:45     ` Rob Herring
2016-11-15 10:12   ` [PATCHv2 10/10] Documentation: synopsys-dw-mshc: remove the unused properties Jaehoon Chung
2016-11-16  9:21     ` Shawn Lin
2016-11-15 10:12 ` [PATCHv2 02/10] mmc: dw_mmc: fix the debug message for checking card's present Jaehoon Chung
     [not found]   ` <20161115101232.3854-3-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:01     ` Shawn Lin
2016-11-15 10:12 ` [PATCHv2 03/10] mmc: dw_mmc: change the DW_MCI_FREQ_MIN from 400K to 100K Jaehoon Chung
     [not found]   ` <20161115101232.3854-4-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:06     ` Shawn Lin
2016-11-15 10:12 ` [PATCHv2 04/10] mmc: dw_mmc: use the hold register when send stop command Jaehoon Chung
     [not found]   ` <20161115101232.3854-5-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:09     ` Shawn Lin
2016-11-15 10:12 ` [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default Jaehoon Chung
     [not found]   ` <20161115101232.3854-6-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:16     ` Shawn Lin
     [not found]       ` <6d7625c0-8588-5d11-7475-38fa611d8614-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-11-17  5:05         ` Jaehoon Chung
     [not found]           ` <868dbb62-4b0d-3492-0b13-093ce63c5cde-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-17  7:49             ` Shawn Lin
2016-11-15 10:12 ` [PATCHv2 07/10] mmc: dw_mmc: use the cookie's enum values for post/pre_req() Jaehoon Chung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.