* [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5
@ 2012-06-29 4:32 Seungwon Jeon
2012-07-10 5:42 ` merez
2012-07-10 5:54 ` Chris Ball
0 siblings, 2 replies; 7+ messages in thread
From: Seungwon Jeon @ 2012-06-29 4:32 UTC (permalink / raw)
To: linux-mmc
Cc: 'Chris Ball', 'Maya Erez',
'Subhash Jadavani', 'S, Venkatraman',
'Saugata Das', 'Namjae Jeon'
This patch adds packed command feature of eMMC4.5.
The maximum number for packing read(or write) is offered
and exception event relevant to packed command which is
used for error handling is enabled. If host wants to use
this feature, MMC_CAP2_PACKED_CMD should be set.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: Maya Erez <merez@codeaurora.org>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
---
drivers/mmc/core/mmc.c | 25 +++++++++++++++++++++++++
include/linux/mmc/card.h | 3 +++
include/linux/mmc/host.h | 4 ++++
include/linux/mmc/mmc.h | 15 +++++++++++++++
4 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 258b203..bfb271f 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -516,6 +516,11 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
} else {
card->ext_csd.data_tag_unit_size = 0;
}
+
+ card->ext_csd.max_packed_writes =
+ ext_csd[EXT_CSD_MAX_PACKED_WRITES];
+ card->ext_csd.max_packed_reads =
+ ext_csd[EXT_CSD_MAX_PACKED_READS];
} else {
card->ext_csd.data_sector_size = 512;
}
@@ -1246,6 +1251,26 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
}
}
+ if ((host->caps2 & MMC_CAP2_PACKED_WR &&
+ card->ext_csd.max_packed_writes > 0) ||
+ (host->caps2 & MMC_CAP2_PACKED_RD &&
+ card->ext_csd.max_packed_reads > 0)) {
+ err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+ EXT_CSD_EXP_EVENTS_CTRL,
+ EXT_CSD_PACKED_EVENT_EN,
+ card->ext_csd.generic_cmd6_time);
+ if (err && err != -EBADMSG)
+ goto free_card;
+ if (err) {
+ pr_warning("%s: Enabling packed event failed\n",
+ mmc_hostname(card->host));
+ card->ext_csd.packed_event_en = 0;
+ err = 0;
+ } else {
+ card->ext_csd.packed_event_en = 1;
+ }
+ }
+
if (!oldcard)
host->card = card;
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index d76513b..4aeb4e9 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -53,6 +53,9 @@ struct mmc_ext_csd {
u8 part_config;
u8 cache_ctrl;
u8 rst_n_function;
+ u8 max_packed_writes;
+ u8 max_packed_reads;
+ u8 packed_event_en;
unsigned int part_time; /* Units: ms */
unsigned int sa_timeout; /* Units: 100ns */
unsigned int generic_cmd6_time; /* Units: 10ms */
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 9deb725..bb19b98 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -245,6 +245,10 @@ struct mmc_host {
#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */
#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */
#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
+#define MMC_CAP2_PACKED_RD (1 << 10) /* Allow packed read */
+#define MMC_CAP2_PACKED_WR (1 << 11) /* Allow packed write */
+#define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \
+ MMC_CAP2_PACKED_WR) /* Allow packed commands */
mmc_pm_flag_t pm_caps; /* supported pm features */
unsigned int power_notify_type;
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index d425cab..254901a 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -139,6 +139,7 @@ static inline bool mmc_op_multi(u32 opcode)
#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */
#define R1_READY_FOR_DATA (1 << 8) /* sx, a */
#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
+#define R1_EXP_EVENT (1 << 6) /* sr, a */
#define R1_APP_CMD (1 << 5) /* sr, c */
#define R1_STATE_IDLE 0
@@ -274,6 +275,10 @@ struct _mmc_csd {
#define EXT_CSD_FLUSH_CACHE 32 /* W */
#define EXT_CSD_CACHE_CTRL 33 /* R/W */
#define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */
+#define EXT_CSD_PACKED_FAILURE_INDEX 35 /* RO */
+#define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */
+#define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */
+#define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */
#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */
#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */
#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
@@ -318,6 +323,8 @@ struct _mmc_csd {
#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */
#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */
#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */
+#define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */
+#define EXT_CSD_MAX_PACKED_READS 501 /* RO */
#define EXT_CSD_HPI_FEATURES 503 /* RO */
/*
@@ -377,6 +384,14 @@ struct _mmc_csd {
#define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */
#define EXT_CSD_PWR_CL_8BIT_SHIFT 4
#define EXT_CSD_PWR_CL_4BIT_SHIFT 0
+
+#define EXT_CSD_PACKED_EVENT_EN (1 << 3)
+
+#define EXT_CSD_PACKED_FAILURE (1 << 3)
+
+#define EXT_CSD_PACKED_GENERIC_ERROR (1 << 0)
+#define EXT_CSD_PACKED_INDEXED_ERROR (1 << 1)
+
/*
* MMC_SWITCH access modes
*/
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5
2012-06-29 4:32 [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5 Seungwon Jeon
@ 2012-07-10 5:42 ` merez
2012-07-10 5:54 ` Chris Ball
1 sibling, 0 replies; 7+ messages in thread
From: merez @ 2012-07-10 5:42 UTC (permalink / raw)
To: Seungwon Jeon
Cc: linux-mmc, 'Chris Ball', 'Maya Erez',
'Subhash Jadavani', 'S, Venkatraman',
'Saugata Das', 'Namjae Jeon'
Hi Chris,
Can we push this change to mmc-next?
Thanks,
Maya
On Thu, June 28, 2012 9:32 pm, Seungwon Jeon wrote:
> This patch adds packed command feature of eMMC4.5.
> The maximum number for packing read(or write) is offered
> and exception event relevant to packed command which is
> used for error handling is enabled. If host wants to use
> this feature, MMC_CAP2_PACKED_CMD should be set.
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> Reviewed-by: Maya Erez <merez@codeaurora.org>
> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
> ---
> drivers/mmc/core/mmc.c | 25 +++++++++++++++++++++++++
> include/linux/mmc/card.h | 3 +++
> include/linux/mmc/host.h | 4 ++++
> include/linux/mmc/mmc.h | 15 +++++++++++++++
> 4 files changed, 47 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 258b203..bfb271f 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -516,6 +516,11 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8
> *ext_csd)
> } else {
> card->ext_csd.data_tag_unit_size = 0;
> }
> +
> + card->ext_csd.max_packed_writes =
> + ext_csd[EXT_CSD_MAX_PACKED_WRITES];
> + card->ext_csd.max_packed_reads =
> + ext_csd[EXT_CSD_MAX_PACKED_READS];
> } else {
> card->ext_csd.data_sector_size = 512;
> }
> @@ -1246,6 +1251,26 @@ static int mmc_init_card(struct mmc_host *host, u32
> ocr,
> }
> }
>
> + if ((host->caps2 & MMC_CAP2_PACKED_WR &&
> + card->ext_csd.max_packed_writes > 0) ||
> + (host->caps2 & MMC_CAP2_PACKED_RD &&
> + card->ext_csd.max_packed_reads > 0)) {
> + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> + EXT_CSD_EXP_EVENTS_CTRL,
> + EXT_CSD_PACKED_EVENT_EN,
> + card->ext_csd.generic_cmd6_time);
> + if (err && err != -EBADMSG)
> + goto free_card;
> + if (err) {
> + pr_warning("%s: Enabling packed event failed\n",
> + mmc_hostname(card->host));
> + card->ext_csd.packed_event_en = 0;
> + err = 0;
> + } else {
> + card->ext_csd.packed_event_en = 1;
> + }
> + }
> +
> if (!oldcard)
> host->card = card;
>
> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index d76513b..4aeb4e9 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -53,6 +53,9 @@ struct mmc_ext_csd {
> u8 part_config;
> u8 cache_ctrl;
> u8 rst_n_function;
> + u8 max_packed_writes;
> + u8 max_packed_reads;
> + u8 packed_event_en;
> unsigned int part_time; /* Units: ms */
> unsigned int sa_timeout; /* Units: 100ns */
> unsigned int generic_cmd6_time; /* Units: 10ms */
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 9deb725..bb19b98 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -245,6 +245,10 @@ struct mmc_host {
> #define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */
> #define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal
> */
> #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
> +#define MMC_CAP2_PACKED_RD (1 << 10) /* Allow packed read */
> +#define MMC_CAP2_PACKED_WR (1 << 11) /* Allow packed write */
> +#define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \
> + MMC_CAP2_PACKED_WR) /* Allow packed commands */
>
> mmc_pm_flag_t pm_caps; /* supported pm features */
> unsigned int power_notify_type;
> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
> index d425cab..254901a 100644
> --- a/include/linux/mmc/mmc.h
> +++ b/include/linux/mmc/mmc.h
> @@ -139,6 +139,7 @@ static inline bool mmc_op_multi(u32 opcode)
> #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */
> #define R1_READY_FOR_DATA (1 << 8) /* sx, a */
> #define R1_SWITCH_ERROR (1 << 7) /* sx, c */
> +#define R1_EXP_EVENT (1 << 6) /* sr, a */
> #define R1_APP_CMD (1 << 5) /* sr, c */
>
> #define R1_STATE_IDLE 0
> @@ -274,6 +275,10 @@ struct _mmc_csd {
> #define EXT_CSD_FLUSH_CACHE 32 /* W */
> #define EXT_CSD_CACHE_CTRL 33 /* R/W */
> #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */
> +#define EXT_CSD_PACKED_FAILURE_INDEX 35 /* RO */
> +#define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */
> +#define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */
> +#define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */
> #define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */
> #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */
> #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
> @@ -318,6 +323,8 @@ struct _mmc_csd {
> #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */
> #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */
> #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */
> +#define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */
> +#define EXT_CSD_MAX_PACKED_READS 501 /* RO */
> #define EXT_CSD_HPI_FEATURES 503 /* RO */
>
> /*
> @@ -377,6 +384,14 @@ struct _mmc_csd {
> #define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */
> #define EXT_CSD_PWR_CL_8BIT_SHIFT 4
> #define EXT_CSD_PWR_CL_4BIT_SHIFT 0
> +
> +#define EXT_CSD_PACKED_EVENT_EN (1 << 3)
> +
> +#define EXT_CSD_PACKED_FAILURE (1 << 3)
> +
> +#define EXT_CSD_PACKED_GENERIC_ERROR (1 << 0)
> +#define EXT_CSD_PACKED_INDEXED_ERROR (1 << 1)
> +
> /*
> * MMC_SWITCH access modes
> */
> --
> 1.7.0.4
>
>
>
--
Sent by consultant of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5
2012-06-29 4:32 [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5 Seungwon Jeon
2012-07-10 5:42 ` merez
@ 2012-07-10 5:54 ` Chris Ball
2012-07-10 6:23 ` merez
2012-07-10 6:24 ` S, Venkatraman
1 sibling, 2 replies; 7+ messages in thread
From: Chris Ball @ 2012-07-10 5:54 UTC (permalink / raw)
To: Seungwon Jeon
Cc: linux-mmc, 'Maya Erez', 'Subhash Jadavani',
'S, Venkatraman', 'Saugata Das',
'Namjae Jeon'
Hi,
On Fri, Jun 29 2012, Seungwon Jeon wrote:
> This patch adds packed command feature of eMMC4.5.
> The maximum number for packing read(or write) is offered
> and exception event relevant to packed command which is
> used for error handling is enabled. If host wants to use
> this feature, MMC_CAP2_PACKED_CMD should be set.
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> Reviewed-by: Maya Erez <merez@codeaurora.org>
> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
> ---
> drivers/mmc/core/mmc.c | 25 +++++++++++++++++++++++++
> include/linux/mmc/card.h | 3 +++
> include/linux/mmc/host.h | 4 ++++
> include/linux/mmc/mmc.h | 15 +++++++++++++++
> 4 files changed, 47 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 258b203..bfb271f 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -516,6 +516,11 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
> } else {
> card->ext_csd.data_tag_unit_size = 0;
> }
> +
> + card->ext_csd.max_packed_writes =
> + ext_csd[EXT_CSD_MAX_PACKED_WRITES];
> + card->ext_csd.max_packed_reads =
> + ext_csd[EXT_CSD_MAX_PACKED_READS];
> } else {
> card->ext_csd.data_sector_size = 512;
> }
> @@ -1246,6 +1251,26 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
> }
> }
>
> + if ((host->caps2 & MMC_CAP2_PACKED_WR &&
> + card->ext_csd.max_packed_writes > 0) ||
> + (host->caps2 & MMC_CAP2_PACKED_RD &&
> + card->ext_csd.max_packed_reads > 0)) {
> + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> + EXT_CSD_EXP_EVENTS_CTRL,
> + EXT_CSD_PACKED_EVENT_EN,
> + card->ext_csd.generic_cmd6_time);
Sorry, I don't have a copy of the eMMC 4.5 spec -- is PACKED_EVENT_EN
a one-time programmable fuse on the eMMC, like BKOPS_ENABLE was?
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5
2012-07-10 5:54 ` Chris Ball
@ 2012-07-10 6:23 ` merez
2012-07-10 7:33 ` Chris Ball
2012-07-10 6:24 ` S, Venkatraman
1 sibling, 1 reply; 7+ messages in thread
From: merez @ 2012-07-10 6:23 UTC (permalink / raw)
To: Chris Ball
Cc: Seungwon Jeon, linux-mmc, 'Maya Erez',
'Subhash Jadavani', 'S, Venkatraman',
'Saugata Das', 'Namjae Jeon'
On Mon, July 9, 2012 10:54 pm, Chris Ball wrote:
> Hi,
>
> On Fri, Jun 29 2012, Seungwon Jeon wrote:
>> This patch adds packed command feature of eMMC4.5.
>> The maximum number for packing read(or write) is offered
>> and exception event relevant to packed command which is
>> used for error handling is enabled. If host wants to use
>> this feature, MMC_CAP2_PACKED_CMD should be set.
>>
>> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
>> Reviewed-by: Maya Erez <merez@codeaurora.org>
>> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
>> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
>> ---
>> drivers/mmc/core/mmc.c | 25 +++++++++++++++++++++++++
>> include/linux/mmc/card.h | 3 +++
>> include/linux/mmc/host.h | 4 ++++
>> include/linux/mmc/mmc.h | 15 +++++++++++++++
>> 4 files changed, 47 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 258b203..bfb271f 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -516,6 +516,11 @@ static int mmc_read_ext_csd(struct mmc_card *card,
>> u8 *ext_csd)
>> } else {
>> card->ext_csd.data_tag_unit_size = 0;
>> }
>> +
>> + card->ext_csd.max_packed_writes =
>> + ext_csd[EXT_CSD_MAX_PACKED_WRITES];
>> + card->ext_csd.max_packed_reads =
>> + ext_csd[EXT_CSD_MAX_PACKED_READS];
>> } else {
>> card->ext_csd.data_sector_size = 512;
>> }
>> @@ -1246,6 +1251,26 @@ static int mmc_init_card(struct mmc_host *host,
>> u32 ocr,
>> }
>> }
>>
>> + if ((host->caps2 & MMC_CAP2_PACKED_WR &&
>> + card->ext_csd.max_packed_writes > 0) ||
>> + (host->caps2 & MMC_CAP2_PACKED_RD &&
>> + card->ext_csd.max_packed_reads > 0)) {
>> + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
>> + EXT_CSD_EXP_EVENTS_CTRL,
>> + EXT_CSD_PACKED_EVENT_EN,
>> + card->ext_csd.generic_cmd6_time);
>
> Sorry, I don't have a copy of the eMMC 4.5 spec -- is PACKED_EVENT_EN
> a one-time programmable fuse on the eMMC, like BKOPS_ENABLE was?
>
> Thanks,
>
> - Chris.
> --
> Chris Ball <cjb@laptop.org> <http://printf.net/>
> One Laptop Per Child
No, it's not.
--
Sent by consultant of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5
2012-07-10 5:54 ` Chris Ball
2012-07-10 6:23 ` merez
@ 2012-07-10 6:24 ` S, Venkatraman
1 sibling, 0 replies; 7+ messages in thread
From: S, Venkatraman @ 2012-07-10 6:24 UTC (permalink / raw)
To: Chris Ball
Cc: Seungwon Jeon, linux-mmc, Maya Erez, Subhash Jadavani,
Saugata Das, Namjae Jeon
On Tue, Jul 10, 2012 at 11:24 AM, Chris Ball <cjb@laptop.org> wrote:
> Hi,
>
> On Fri, Jun 29 2012, Seungwon Jeon wrote:
>> This patch adds packed command feature of eMMC4.5.
>> The maximum number for packing read(or write) is offered
>> and exception event relevant to packed command which is
>> used for error handling is enabled. If host wants to use
>> this feature, MMC_CAP2_PACKED_CMD should be set.
>>
>> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
>> Reviewed-by: Maya Erez <merez@codeaurora.org>
>> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
>> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
>> ---
>> drivers/mmc/core/mmc.c | 25 +++++++++++++++++++++++++
>> include/linux/mmc/card.h | 3 +++
>> include/linux/mmc/host.h | 4 ++++
>> include/linux/mmc/mmc.h | 15 +++++++++++++++
>> 4 files changed, 47 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 258b203..bfb271f 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -516,6 +516,11 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
>> } else {
>> card->ext_csd.data_tag_unit_size = 0;
>> }
>> +
>> + card->ext_csd.max_packed_writes =
>> + ext_csd[EXT_CSD_MAX_PACKED_WRITES];
>> + card->ext_csd.max_packed_reads =
>> + ext_csd[EXT_CSD_MAX_PACKED_READS];
>> } else {
>> card->ext_csd.data_sector_size = 512;
>> }
>> @@ -1246,6 +1251,26 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>> }
>> }
>>
>> + if ((host->caps2 & MMC_CAP2_PACKED_WR &&
>> + card->ext_csd.max_packed_writes > 0) ||
>> + (host->caps2 & MMC_CAP2_PACKED_RD &&
>> + card->ext_csd.max_packed_reads > 0)) {
>> + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
>> + EXT_CSD_EXP_EVENTS_CTRL,
>> + EXT_CSD_PACKED_EVENT_EN,
>> + card->ext_csd.generic_cmd6_time);
>
> Sorry, I don't have a copy of the eMMC 4.5 spec -- is PACKED_EVENT_EN
> a one-time programmable fuse on the eMMC, like BKOPS_ENABLE was?
>
It's not. PACKED_EVENT_EN is a bit set into EXCEPTION_EVENTS_CTRL
register, which is reset duing a power cycle
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5
2012-07-10 6:23 ` merez
@ 2012-07-10 7:33 ` Chris Ball
2012-07-10 10:45 ` merez
0 siblings, 1 reply; 7+ messages in thread
From: Chris Ball @ 2012-07-10 7:33 UTC (permalink / raw)
To: merez
Cc: Seungwon Jeon, linux-mmc, 'Subhash Jadavani',
'S, Venkatraman', 'Saugata Das',
'Namjae Jeon'
Hi,
On Tue, Jul 10 2012, merez@codeaurora.org wrote:
>> Sorry, I don't have a copy of the eMMC 4.5 spec -- is PACKED_EVENT_EN
>> a one-time programmable fuse on the eMMC, like BKOPS_ENABLE was?
>
> No, it's not.
Excellent, thanks.
I've pushed both v8 patches to mmc-next. Before pushing it up to Linus,
I'd like to get a better idea of the variety of performances differences
seen using packed writes -- has it been tried on devices from multiple
eMMC vendors, and multiple host controller vendors? Can we try to build
up a quick table of results, with a standard test like iozone, to check
that we've got decent test coverage? Seungwon suggests using:
iozone -az -i0 -I -s 10m -f /target/test -e
I'm also worried about how much code this is adding, but I agree that
it's worth it if the performance benefits are as described.
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5
2012-07-10 7:33 ` Chris Ball
@ 2012-07-10 10:45 ` merez
0 siblings, 0 replies; 7+ messages in thread
From: merez @ 2012-07-10 10:45 UTC (permalink / raw)
To: Chris Ball
Cc: merez, Seungwon Jeon, linux-mmc, 'Subhash Jadavani',
'S, Venkatraman', 'Saugata Das',
'Namjae Jeon'
On Tue, July 10, 2012 12:33 am, Chris Ball wrote:
> Hi,
>
> On Tue, Jul 10 2012, merez@codeaurora.org wrote:
>>> Sorry, I don't have a copy of the eMMC 4.5 spec -- is PACKED_EVENT_EN
>>> a one-time programmable fuse on the eMMC, like BKOPS_ENABLE was?
>>
>> No, it's not.
>
> Excellent, thanks.
>
> I've pushed both v8 patches to mmc-next. Before pushing it up to Linus,
> I'd like to get a better idea of the variety of performances differences
> seen using packed writes -- has it been tried on devices from multiple
> eMMC vendors, and multiple host controller vendors? Can we try to build
> up a quick table of results, with a standard test like iozone, to check
> that we've got decent test coverage? Seungwon suggests using:
>
> iozone -az -i0 -I -s 10m -f /target/test -e
>
> I'm also worried about how much code this is adding, but I agree that
> it's worth it if the performance benefits are as described.
>
> Thanks,
>
> - Chris.
> --
> Chris Ball <cjb@laptop.org> <http://printf.net/>
> One Laptop Per Child
> --
Hi Chris,
I suggest to also use lmdd as a benchmark test for write packing, since
write packing is mostly beneficial in long sequential operations.
It can be used as follows:
lmdd if=internal of=/data/file1 bs=128k count=3000
Thanks,
Maya
--
Sent by consultant of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-07-10 10:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29 4:32 [PATCH v8 1/2] mmc: add packed command feature of eMMC4.5 Seungwon Jeon
2012-07-10 5:42 ` merez
2012-07-10 5:54 ` Chris Ball
2012-07-10 6:23 ` merez
2012-07-10 7:33 ` Chris Ball
2012-07-10 10:45 ` merez
2012-07-10 6:24 ` S, Venkatraman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox