Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1417045 > unrolled thread

[RFC PATCH 0/4] Introduce new caps to improve the card's init sequence

Started byShawn Lin <shawn.lin@rock-chips.com>
First post2016-06-08 10:30 +0200
Last post2016-06-08 10:30 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [RFC PATCH 0/4] Introduce new caps to improve the card's init sequence Shawn Lin <shawn.lin@rock-chips.com> - 2016-06-08 10:30 +0200
    [RFC PATCH 3/4] mmc: core: add cap-no-sd and cap-no-mmc properties Shawn Lin <shawn.lin@rock-chips.com> - 2016-06-08 10:30 +0200
    [RFC PATCH 2/4] mmc: core: expose MMC_CAP2_NO_SDIO to dt-binding Shawn Lin <shawn.lin@rock-chips.com> - 2016-06-08 10:30 +0200

#1417045 — [RFC PATCH 0/4] Introduce new caps to improve the card's init sequence

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-06-08 10:30 +0200
Subject[RFC PATCH 0/4] Introduce new caps to improve the card's init sequence
Message-ID<rHH29-6b9-3@gated-at.bofh.it>
Hi all,

This patchset is gonna improve the card's init sequence
by exposing some caps to DT.

The basic idea is to skip sending specific init cmd inspired
by Carlo Caione's commit[0].

To make it possible, I firstly expose Carlo's MMC_CAP2_NO_SDIO
to DT and extend two new caps for similar usage of sd and mmc.
We probably need it because for most of the boards, each of the
slots should have a specific function when designed. It's impossible
for one slot which can either to be used as eMMC or a SD card for a
given board. The same for SDIO case.

We could have two ways to improve it
A) Skip sending specific commands if knowing we don't support
the specific card type.
B) Allow sending specific commands if knowing we do support
the specific card type.

A) and B) shouldn't have difference, but I take A) as the final
one as it looks more consistent with Carlo's way, which does not
seem to break anything as possible.

The only roadblock for this patchset to be landed should be the
improvement we gain from it. Theoretically sdio-card doesn't get
improvment as it's already in the first place to be attached.
But considering the sd and (e)MMC case, we should gain more benifit
from it.

From the test, we can save nearly 2ms for attaching emmc against the
original 8ms. And we gain more than 30us improvement for sd card for
each insert.

[0]: http://permalink.gmane.org/gmane.linux.kernel.mmc/34774



Shawn Lin (4):
  Documentation: mmc: add description for new caps
  mmc: core: expose MMC_CAP2_NO_SDIO to dt-binding
  mmc: core: add cap-no-sd and cap-no-mmc properties
  mmc: core: improve initialization flow

 Documentation/devicetree/bindings/mmc/mmc.txt |  3 +++
 drivers/mmc/core/core.c                       | 10 +++++-----
 drivers/mmc/core/host.c                       |  6 ++++++
 include/linux/mmc/host.h                      |  2 ++
 4 files changed, 16 insertions(+), 5 deletions(-)

-- 
2.3.7

[toc] | [next] | [standalone]


#1417049 — [RFC PATCH 3/4] mmc: core: add cap-no-sd and cap-no-mmc properties

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-06-08 10:30 +0200
Subject[RFC PATCH 3/4] mmc: core: add cap-no-sd and cap-no-mmc properties
Message-ID<rHH29-6b9-17@gated-at.bofh.it>
In reply to#1417045
Introduce cap-no-sd and cap-no-mmc properties to skip
sending sd and mmc commands during initialization
respectively.

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

 drivers/mmc/core/host.c  | 4 ++++
 include/linux/mmc/host.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 933eeea..c760097 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -298,6 +298,10 @@ int mmc_of_parse(struct mmc_host *host)
 		host->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
 	if (of_property_read_bool(np, "cap-no-sdio"))
 		host->caps2 |= MMC_CAP2_NO_SDIO;
+	if (of_property_read_bool(np, "cap-no-sd"))
+		host->caps2 |= MMC_CAP2_NO_SD;
+	if (of_property_read_bool(np, "cap-no-mmc"))
+		host->caps2 |= MMC_CAP2_NO_MMC;
 	if (of_property_read_bool(np, "keep-power-in-suspend"))
 		host->pm_caps |= MMC_PM_KEEP_POWER;
 	if (of_property_read_bool(np, "wakeup-source") ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index d72c0c3..1bd77c7 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -309,6 +309,8 @@ struct mmc_host {
 #define MMC_CAP2_NO_WRITE_PROTECT (1 << 18)	/* No physical write protect pin, assume that card is always read-write */
 #define MMC_CAP2_NO_SDIO	(1 << 19)	/* Do not send SDIO commands during initialization */
 #define MMC_CAP2_HS400_ES	(1 << 20)	/* Host supports enhanced strobe */
+#define MMC_CAP2_NO_SD		(1 << 21)	/* Do not send SD commands during initialization */
+#define MMC_CAP2_NO_MMC		(1 << 22)	/* Do not send MMC commands during initialization */
 
 	mmc_pm_flag_t		pm_caps;	/* supported pm features */
 
-- 
2.3.7

[toc] | [prev] | [next] | [standalone]


#1417050 — [RFC PATCH 2/4] mmc: core: expose MMC_CAP2_NO_SDIO to dt-binding

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-06-08 10:30 +0200
Subject[RFC PATCH 2/4] mmc: core: expose MMC_CAP2_NO_SDIO to dt-binding
Message-ID<rHH2a-6b9-21@gated-at.bofh.it>
In reply to#1417045
Add cap-no-sdio property, so we can use MMC_CAP2_NO_SDIO
for different slots from dt.

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

 drivers/mmc/core/host.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index d7e86f9..933eeea 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -296,6 +296,8 @@ int mmc_of_parse(struct mmc_host *host)
 		host->caps |= MMC_CAP_SDIO_IRQ;
 	if (of_property_read_bool(np, "full-pwr-cycle"))
 		host->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
+	if (of_property_read_bool(np, "cap-no-sdio"))
+		host->caps2 |= MMC_CAP2_NO_SDIO;
 	if (of_property_read_bool(np, "keep-power-in-suspend"))
 		host->pm_caps |= MMC_PM_KEEP_POWER;
 	if (of_property_read_bool(np, "wakeup-source") ||
-- 
2.3.7

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web