All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mmc: execute tuning when device is not busy.
@ 2014-08-14  5:51 Yi Sun
  2014-08-19  3:53 ` Sun, Yi Y
  2014-09-09  2:13 ` Sun, Yi Y
  0 siblings, 2 replies; 5+ messages in thread
From: Yi Sun @ 2014-08-14  5:51 UTC (permalink / raw)
  To: linux-mmc, ulf.hansson; +Cc: yi.y.sun

We find tuning timeout because of the secure erase operation lasts too long
so not to do tuning when device is busy.

Signed-off-by: Yi Sun <yi.y.sun@intel.com>
---
 drivers/mmc/host/sdhci.c |    7 ++++---
 drivers/mmc/host/sdhci.h |    1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 47055f3..6a584d7 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1355,11 +1355,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		present_state = sdhci_readl(host, SDHCI_PRESENT_STATE);
 		/*
 		 * Check if the re-tuning timer has already expired and there
-		 * is no on-going data transfer. If so, we need to execute
-		 * tuning procedure before sending command.
+		 * is no on-going data transfer and DAT0 is not busy. If so,
+		 * we need to execute tuning procedure before sending command.
 		 */
 		if ((host->flags & SDHCI_NEEDS_RETUNING) &&
-		    !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) {
+		    !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ)) &&
+		    (present_state & SDHCI_DATA_0_LVL_MASK)) {
 			if (mmc->card) {
 				/* eMMC uses cmd21 but sd and sdio use cmd19 */
 				tuning_opcode =
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 4a5cd5e..0ae6b99d 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -72,6 +72,7 @@
 #define  SDHCI_WRITE_PROTECT	0x00080000
 #define  SDHCI_DATA_LVL_MASK	0x00F00000
 #define   SDHCI_DATA_LVL_SHIFT	20
+#define   SDHCI_DATA_0_LVL_MASK	0x00100000
 
 #define SDHCI_HOST_CONTROL	0x28
 #define  SDHCI_CTRL_LED		0x01
-- 
1.7.9.5


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

* RE: [PATCH v2] mmc: execute tuning when device is not busy.
  2014-08-14  5:51 [PATCH v2] mmc: execute tuning when device is not busy Yi Sun
@ 2014-08-19  3:53 ` Sun, Yi Y
  2014-08-19  7:39   ` Ulf Hansson
  2014-09-09  2:13 ` Sun, Yi Y
  1 sibling, 1 reply; 5+ messages in thread
From: Sun, Yi Y @ 2014-08-19  3:53 UTC (permalink / raw)
  To: linux-mmc, ulf.hansson

Hi, Uffe,

Could you please review the patch? Thanks!

BRs,
Sun Yi

-----Original Message-----
From: Sun, Yi Y 
Sent: Thursday, August 14, 2014 1:52 PM
To: linux-mmc@vger.kernel.org; ulf.hansson@linaro.org
Cc: Sun, Yi Y
Subject: [PATCH v2] mmc: execute tuning when device is not busy.

We find tuning timeout because of the secure erase operation lasts too long so not to do tuning when device is busy.

Signed-off-by: Yi Sun <yi.y.sun@intel.com>
---
 drivers/mmc/host/sdhci.c |    7 ++++---
 drivers/mmc/host/sdhci.h |    1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 47055f3..6a584d7 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1355,11 +1355,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		present_state = sdhci_readl(host, SDHCI_PRESENT_STATE);
 		/*
 		 * Check if the re-tuning timer has already expired and there
-		 * is no on-going data transfer. If so, we need to execute
-		 * tuning procedure before sending command.
+		 * is no on-going data transfer and DAT0 is not busy. If so,
+		 * we need to execute tuning procedure before sending command.
 		 */
 		if ((host->flags & SDHCI_NEEDS_RETUNING) &&
-		    !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) {
+		    !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ)) &&
+		    (present_state & SDHCI_DATA_0_LVL_MASK)) {
 			if (mmc->card) {
 				/* eMMC uses cmd21 but sd and sdio use cmd19 */
 				tuning_opcode =
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 4a5cd5e..0ae6b99d 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -72,6 +72,7 @@
 #define  SDHCI_WRITE_PROTECT	0x00080000
 #define  SDHCI_DATA_LVL_MASK	0x00F00000
 #define   SDHCI_DATA_LVL_SHIFT	20
+#define   SDHCI_DATA_0_LVL_MASK	0x00100000
 
 #define SDHCI_HOST_CONTROL	0x28
 #define  SDHCI_CTRL_LED		0x01
--
1.7.9.5


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

* Re: [PATCH v2] mmc: execute tuning when device is not busy.
  2014-08-19  3:53 ` Sun, Yi Y
@ 2014-08-19  7:39   ` Ulf Hansson
  0 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2014-08-19  7:39 UTC (permalink / raw)
  To: Sun, Yi Y; +Cc: linux-mmc

On 19 August 2014 05:53, Sun, Yi Y <yi.y.sun@intel.com> wrote:
> Hi, Uffe,
>
> Could you please review the patch? Thanks!
>
> BRs,
> Sun Yi

Please don't top post.

I am not the only one to review sdhci patches. There are probably
other better suited and I rely to get some input on this kind of
patch.

Kind regards
Uffe

>
> -----Original Message-----
> From: Sun, Yi Y
> Sent: Thursday, August 14, 2014 1:52 PM
> To: linux-mmc@vger.kernel.org; ulf.hansson@linaro.org
> Cc: Sun, Yi Y
> Subject: [PATCH v2] mmc: execute tuning when device is not busy.
>
> We find tuning timeout because of the secure erase operation lasts too long so not to do tuning when device is busy.
>
> Signed-off-by: Yi Sun <yi.y.sun@intel.com>
> ---
>  drivers/mmc/host/sdhci.c |    7 ++++---
>  drivers/mmc/host/sdhci.h |    1 +
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 47055f3..6a584d7 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1355,11 +1355,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>                 present_state = sdhci_readl(host, SDHCI_PRESENT_STATE);
>                 /*
>                  * Check if the re-tuning timer has already expired and there
> -                * is no on-going data transfer. If so, we need to execute
> -                * tuning procedure before sending command.
> +                * is no on-going data transfer and DAT0 is not busy. If so,
> +                * we need to execute tuning procedure before sending command.
>                  */
>                 if ((host->flags & SDHCI_NEEDS_RETUNING) &&
> -                   !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) {
> +                   !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ)) &&
> +                   (present_state & SDHCI_DATA_0_LVL_MASK)) {
>                         if (mmc->card) {
>                                 /* eMMC uses cmd21 but sd and sdio use cmd19 */
>                                 tuning_opcode =
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 4a5cd5e..0ae6b99d 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -72,6 +72,7 @@
>  #define  SDHCI_WRITE_PROTECT   0x00080000
>  #define  SDHCI_DATA_LVL_MASK   0x00F00000
>  #define   SDHCI_DATA_LVL_SHIFT 20
> +#define   SDHCI_DATA_0_LVL_MASK        0x00100000
>
>  #define SDHCI_HOST_CONTROL     0x28
>  #define  SDHCI_CTRL_LED                0x01
> --
> 1.7.9.5
>
> --
> 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] 5+ messages in thread

* RE: [PATCH v2] mmc: execute tuning when device is not busy.
  2014-08-14  5:51 [PATCH v2] mmc: execute tuning when device is not busy Yi Sun
  2014-08-19  3:53 ` Sun, Yi Y
@ 2014-09-09  2:13 ` Sun, Yi Y
  2014-09-24  9:06   ` Ulf Hansson
  1 sibling, 1 reply; 5+ messages in thread
From: Sun, Yi Y @ 2014-09-09  2:13 UTC (permalink / raw)
  To: linux-mmc, ulf.hansson

Kind remind.

BRs,
Yi Sun

-----Original Message-----
From: Sun, Yi Y 
Sent: Thursday, August 14, 2014 1:52 PM
To: linux-mmc@vger.kernel.org; ulf.hansson@linaro.org
Cc: Sun, Yi Y
Subject: [PATCH v2] mmc: execute tuning when device is not busy.

We find tuning timeout because of the secure erase operation lasts too long so not to do tuning when device is busy.

Signed-off-by: Yi Sun <yi.y.sun@intel.com>
---
 drivers/mmc/host/sdhci.c |    7 ++++---
 drivers/mmc/host/sdhci.h |    1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 47055f3..6a584d7 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1355,11 +1355,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		present_state = sdhci_readl(host, SDHCI_PRESENT_STATE);
 		/*
 		 * Check if the re-tuning timer has already expired and there
-		 * is no on-going data transfer. If so, we need to execute
-		 * tuning procedure before sending command.
+		 * is no on-going data transfer and DAT0 is not busy. If so,
+		 * we need to execute tuning procedure before sending command.
 		 */
 		if ((host->flags & SDHCI_NEEDS_RETUNING) &&
-		    !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) {
+		    !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ)) &&
+		    (present_state & SDHCI_DATA_0_LVL_MASK)) {
 			if (mmc->card) {
 				/* eMMC uses cmd21 but sd and sdio use cmd19 */
 				tuning_opcode =
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 4a5cd5e..0ae6b99d 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -72,6 +72,7 @@
 #define  SDHCI_WRITE_PROTECT	0x00080000
 #define  SDHCI_DATA_LVL_MASK	0x00F00000
 #define   SDHCI_DATA_LVL_SHIFT	20
+#define   SDHCI_DATA_0_LVL_MASK	0x00100000
 
 #define SDHCI_HOST_CONTROL	0x28
 #define  SDHCI_CTRL_LED		0x01
--
1.7.9.5


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

* Re: [PATCH v2] mmc: execute tuning when device is not busy.
  2014-09-09  2:13 ` Sun, Yi Y
@ 2014-09-24  9:06   ` Ulf Hansson
  0 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2014-09-24  9:06 UTC (permalink / raw)
  To: Sun, Yi Y; +Cc: linux-mmc

On 9 September 2014 04:13, Sun, Yi Y <yi.y.sun@intel.com> wrote:
> Kind remind.
>
> BRs,
> Yi Sun
>
> -----Original Message-----
> From: Sun, Yi Y
> Sent: Thursday, August 14, 2014 1:52 PM
> To: linux-mmc@vger.kernel.org; ulf.hansson@linaro.org
> Cc: Sun, Yi Y
> Subject: [PATCH v2] mmc: execute tuning when device is not busy.
>
> We find tuning timeout because of the secure erase operation lasts too long so not to do tuning when device is busy.
>
> Signed-off-by: Yi Sun <yi.y.sun@intel.com>

So I have applied this for next.

Though the patch had checkpatch errors related to your email and
author of the patch. I have fixed it according to what your sob tag
stated.

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci.c |    7 ++++---
>  drivers/mmc/host/sdhci.h |    1 +
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 47055f3..6a584d7 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1355,11 +1355,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>                 present_state = sdhci_readl(host, SDHCI_PRESENT_STATE);
>                 /*
>                  * Check if the re-tuning timer has already expired and there
> -                * is no on-going data transfer. If so, we need to execute
> -                * tuning procedure before sending command.
> +                * is no on-going data transfer and DAT0 is not busy. If so,
> +                * we need to execute tuning procedure before sending command.
>                  */
>                 if ((host->flags & SDHCI_NEEDS_RETUNING) &&
> -                   !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) {
> +                   !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ)) &&
> +                   (present_state & SDHCI_DATA_0_LVL_MASK)) {
>                         if (mmc->card) {
>                                 /* eMMC uses cmd21 but sd and sdio use cmd19 */
>                                 tuning_opcode =
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 4a5cd5e..0ae6b99d 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -72,6 +72,7 @@
>  #define  SDHCI_WRITE_PROTECT   0x00080000
>  #define  SDHCI_DATA_LVL_MASK   0x00F00000
>  #define   SDHCI_DATA_LVL_SHIFT 20
> +#define   SDHCI_DATA_0_LVL_MASK        0x00100000
>
>  #define SDHCI_HOST_CONTROL     0x28
>  #define  SDHCI_CTRL_LED                0x01
> --
> 1.7.9.5
>

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

end of thread, other threads:[~2014-09-24  9:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-14  5:51 [PATCH v2] mmc: execute tuning when device is not busy Yi Sun
2014-08-19  3:53 ` Sun, Yi Y
2014-08-19  7:39   ` Ulf Hansson
2014-09-09  2:13 ` Sun, Yi Y
2014-09-24  9:06   ` Ulf Hansson

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.