public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC 1/2] [MMC-4.5] Disable emulation
@ 2012-05-09 14:48 Saugata Das
  2012-05-09 14:48 ` [RFC 2/2] [MMC-4.5] [MMC UTIL] " Saugata Das
  2012-05-14 10:25 ` [RFC 1/2] [MMC-4.5] " Subhash Jadavani
  0 siblings, 2 replies; 13+ messages in thread
From: Saugata Das @ 2012-05-09 14:48 UTC (permalink / raw)
  To: linux-mmc; +Cc: patches, saugata.das

From: Saugata Das <saugata.das@linaro.org>

This patch adds the support for large sector size of 4KB by disabling emulation.
This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
mmc_blk_alloc_req.

In order to use this patch for 4KB sector size, ensure that USE_NATIVE_SECTOR
is enabled, partition table is 4KB sector size aligned and file system block
size is 4KB.

Signed-off-by: Saugata Das <saugata.das@linaro.org>
---
 drivers/mmc/card/block.c |    6 +++++-
 drivers/mmc/core/mmc.c   |    2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index a7c75d8..0e54118e 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1517,7 +1517,11 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 	snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
 		 "mmcblk%d%s", md->name_idx, subname ? subname : "");
 
-	blk_queue_logical_block_size(md->queue.queue, 512);
+	if (mmc_card_mmc(card))
+		blk_queue_logical_block_size(md->queue.queue,
+			card->ext_csd.data_sector_size);
+	else
+		blk_queue_logical_block_size(md->queue.queue, 512);
 	set_capacity(md->disk, size);
 
 	if (mmc_host_cmd23(card->host)) {
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 02914d6..8dcbe995 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 		} else {
 			card->ext_csd.data_tag_unit_size = 0;
 		}
+	} else {
+		card->ext_csd.data_sector_size = 512;
 	}
 
 out:
-- 
1.7.4.3


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

* [RFC 2/2] [MMC-4.5] [MMC UTIL] Disable emulation
  2012-05-09 14:48 [RFC 1/2] [MMC-4.5] Disable emulation Saugata Das
@ 2012-05-09 14:48 ` Saugata Das
  2012-05-14 10:39   ` Subhash Jadavani
  2012-05-14 10:50   ` Subhash Jadavani
  2012-05-14 10:25 ` [RFC 1/2] [MMC-4.5] " Subhash Jadavani
  1 sibling, 2 replies; 13+ messages in thread
From: Saugata Das @ 2012-05-09 14:48 UTC (permalink / raw)
  To: linux-mmc; +Cc: patches, saugata.das

From: Saugata Das <saugata.das@linaro.org>

In this patch, we add utility to disable emulation mode in the eMMC-4.5.
This is done to increase the data sector size to 4KB.

Signed-off-by: Saugata Das <saugata.das@linaro.org>
---
 mmc.c      |    6 ++++++
 mmc.h      |    2 ++
 mmc_cmds.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 mmc_cmds.h |    1 +
 4 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/mmc.c b/mmc.c
index c27fc24..43b95aa 100644
--- a/mmc.c
+++ b/mmc.c
@@ -65,6 +65,12 @@ static struct Command commands[] = {
 		"Set the eMMC writeprotect status of <device>.",
 	  NULL
 	},
+	{ do_disable_emulation, -1,
+	  "disable emulation", "<device>\n"
+		"Set the eMMC data sector size to 4KB by disabling emulation <device>.",
+	  NULL
+	},
+
 	{ 0, 0, 0, 0 }
 };
 
diff --git a/mmc.h b/mmc.h
index 3af36f1..a2050fa 100644
--- a/mmc.h
+++ b/mmc.h
@@ -35,6 +35,8 @@
 #define EXT_CSD_PART_SWITCH_TIME	199
 #define EXT_CSD_BOOT_CFG		179
 #define EXT_CSD_BOOT_WP			173
+#define EXT_CSD_NATIVE_SECTOR_SIZE	63 /* R */
+#define EXT_CSD_NATIVE_SECTOR	62 /* R/W */
 
 /*
  * EXT_CSD field definitions
diff --git a/mmc_cmds.c b/mmc_cmds.c
index 4562cef..2713ccd 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -168,6 +168,48 @@ int do_writeprotect_set(int nargs, char **argv)
 	return ret;
 }
 
+
+int do_disable_emulation(int nargs, char **argv)
+{
+	__u8 ext_csd[512], native_sector_size;
+	int fd, ret;
+	char *device;
+
+	CHECK(nargs != 2, "Usage: mmc </path/to/mmcblkX>\n", exit(1));
+
+	device = argv[1];
+
+	fd = open(device, O_RDWR);
+	if (fd < 0) {
+		perror("open");
+		exit(1);
+	}
+
+	ret = read_extcsd(fd, ext_csd);
+	if (ret) {
+		fprintf(stderr, "Could not read EXT_CSD from %s\n", device);
+		exit(1);
+	}
+
+	native_sector_size = ext_csd[EXT_CSD_NATIVE_SECTOR_SIZE];
+
+	if (native_sector_size) {
+		ret = write_extcsd_value(fd, EXT_CSD_NATIVE_SECTOR, 1);
+
+		if (ret) {
+			fprintf(stderr, "Could not write 0x%02x to "
+				"EXT_CSD[%d] in %s\n",
+				1, EXT_CSD_BOOT_WP, device);
+			exit(1);
+		}
+	} else {
+		printf("MMC does not support 4KB native sector\n");
+	}
+
+	return ret;
+}
+
+
 int do_read_extcsd(int nargs, char **argv)
 {
 	__u8 ext_csd[512], ext_csd_rev, reg;
diff --git a/mmc_cmds.h b/mmc_cmds.h
index 66e9acb..dd107d5 100644
--- a/mmc_cmds.h
+++ b/mmc_cmds.h
@@ -19,3 +19,4 @@ int do_read_extcsd(int nargs, char **argv);
 int do_write_extcsd(int nargs, char **argv);
 int do_writeprotect_get(int nargs, char **argv);
 int do_writeprotect_set(int nargs, char **argv);
+int do_disable_emulation(int nargs, char **argv);
-- 
1.7.4.3


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

* Re: [RFC 1/2] [MMC-4.5] Disable emulation
  2012-05-09 14:48 [RFC 1/2] [MMC-4.5] Disable emulation Saugata Das
  2012-05-09 14:48 ` [RFC 2/2] [MMC-4.5] [MMC UTIL] " Saugata Das
@ 2012-05-14 10:25 ` Subhash Jadavani
  2012-05-14 14:51   ` Saugata Das
  1 sibling, 1 reply; 13+ messages in thread
From: Subhash Jadavani @ 2012-05-14 10:25 UTC (permalink / raw)
  To: Saugata Das; +Cc: linux-mmc, patches, saugata.das

On 5/9/2012 8:18 PM, Saugata Das wrote:
> From: Saugata Das<saugata.das@linaro.org>
>
> This patch adds the support for large sector size of 4KB by disabling emulation.
> This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
> mmc_blk_alloc_req.
>
> In order to use this patch for 4KB sector size, ensure that USE_NATIVE_SECTOR
> is enabled, partition table is 4KB sector size aligned and file system block
> size is 4KB.
>
> Signed-off-by: Saugata Das<saugata.das@linaro.org>
> ---
>   drivers/mmc/card/block.c |    6 +++++-
>   drivers/mmc/core/mmc.c   |    2 ++
>   2 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index a7c75d8..0e54118e 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1517,7 +1517,11 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>   	snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
>   		 "mmcblk%d%s", md->name_idx, subname ? subname : "");
>
> -	blk_queue_logical_block_size(md->queue.queue, 512);
> +	if (mmc_card_mmc(card))
> +		blk_queue_logical_block_size(md->queue.queue,
> +			card->ext_csd.data_sector_size);
Shouldn't we also set the physical block size to NATIVE_SECTOR_SIZE value?

Other question,
Did you find any eMMC device which 4K native sector size? If yes, please 
share the test results.

Other than that, this patch looks good to me.

Regards,
Subhash
> +	else
> +		blk_queue_logical_block_size(md->queue.queue, 512);
>   	set_capacity(md->disk, size);
>
>   	if (mmc_host_cmd23(card->host)) {
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 02914d6..8dcbe995 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
>   		} else {
>   			card->ext_csd.data_tag_unit_size = 0;
>   		}
> +	} else {
> +		card->ext_csd.data_sector_size = 512;
>   	}
>
>   out:


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

* Re: [RFC 2/2] [MMC-4.5] [MMC UTIL] Disable emulation
  2012-05-09 14:48 ` [RFC 2/2] [MMC-4.5] [MMC UTIL] " Saugata Das
@ 2012-05-14 10:39   ` Subhash Jadavani
  2012-05-14 15:25     ` Saugata Das
  2012-05-14 10:50   ` Subhash Jadavani
  1 sibling, 1 reply; 13+ messages in thread
From: Subhash Jadavani @ 2012-05-14 10:39 UTC (permalink / raw)
  To: Saugata Das; +Cc: linux-mmc, patches, saugata.das

On 5/9/2012 8:18 PM, Saugata Das wrote:
> From: Saugata Das<saugata.das@linaro.org>
>
> In this patch, we add utility to disable emulation mode in the eMMC-4.5.
> This is done to increase the data sector size to 4KB.
>
> Signed-off-by: Saugata Das<saugata.das@linaro.org>
> ---
>   mmc.c      |    6 ++++++
>   mmc.h      |    2 ++
>   mmc_cmds.c |   42 ++++++++++++++++++++++++++++++++++++++++++
>   mmc_cmds.h |    1 +
>   4 files changed, 51 insertions(+), 0 deletions(-)
>
> diff --git a/mmc.c b/mmc.c
> index c27fc24..43b95aa 100644
> --- a/mmc.c
> +++ b/mmc.c
> @@ -65,6 +65,12 @@ static struct Command commands[] = {
>   		"Set the eMMC writeprotect status of<device>.",
>   	  NULL
>   	},
> +	{ do_disable_emulation, -1,
can we add good name? which emulation we are disabling? It's 512B 
emulation mode, we are disabling.
> +	  "disable emulation", "<device>\n"
> +		"Set the eMMC data sector size to 4KB by disabling emulation<device>.",
> +	  NULL
> +	},
> +
>   	{ 0, 0, 0, 0 }
>   };
>
> diff --git a/mmc.h b/mmc.h
> index 3af36f1..a2050fa 100644
> --- a/mmc.h
> +++ b/mmc.h
> @@ -35,6 +35,8 @@
>   #define EXT_CSD_PART_SWITCH_TIME	199
>   #define EXT_CSD_BOOT_CFG		179
>   #define EXT_CSD_BOOT_WP			173
> +#define EXT_CSD_NATIVE_SECTOR_SIZE	63 /* R */
> +#define EXT_CSD_NATIVE_SECTOR	62 /* R/W */
Can we name this as EXT_CSD_USE_NATIVE_SECTOR?
>
>   /*
>    * EXT_CSD field definitions
> diff --git a/mmc_cmds.c b/mmc_cmds.c
> index 4562cef..2713ccd 100644
> --- a/mmc_cmds.c
> +++ b/mmc_cmds.c
> @@ -168,6 +168,48 @@ int do_writeprotect_set(int nargs, char **argv)
>   	return ret;
>   }
>
> +
> +int do_disable_emulation(int nargs, char **argv)
> +{
> +	__u8 ext_csd[512], native_sector_size;
> +	int fd, ret;
> +	char *device;
> +
> +	CHECK(nargs != 2, "Usage: mmc</path/to/mmcblkX>\n", exit(1));
> +
> +	device = argv[1];
> +
> +	fd = open(device, O_RDWR);
> +	if (fd<  0) {
> +		perror("open");
> +		exit(1);
> +	}
> +
> +	ret = read_extcsd(fd, ext_csd);
> +	if (ret) {
> +		fprintf(stderr, "Could not read EXT_CSD from %s\n", device);
> +		exit(1);
> +	}
> +
> +	native_sector_size = ext_csd[EXT_CSD_NATIVE_SECTOR_SIZE];
> +
> +	if (native_sector_size) {
> +		ret = write_extcsd_value(fd, EXT_CSD_NATIVE_SECTOR, 1);
Just curious, how are we going to power cycle the device after setting 
the USE_NATIVE_SECTOR? because DATA_SECTOR_SIZE won't be changed to 4K 
until we explicitly power cycle after setting this field.
> +
> +		if (ret) {
> +			fprintf(stderr, "Could not write 0x%02x to "
> +				"EXT_CSD[%d] in %s\n",
> +				1, EXT_CSD_BOOT_WP, device);
> +			exit(1);
> +		}
> +	} else {
> +		printf("MMC does not support 4KB native sector\n");
> +	}
> +
> +	return ret;
> +}
> +
> +
>   int do_read_extcsd(int nargs, char **argv)
>   {
>   	__u8 ext_csd[512], ext_csd_rev, reg;
> diff --git a/mmc_cmds.h b/mmc_cmds.h
> index 66e9acb..dd107d5 100644
> --- a/mmc_cmds.h
> +++ b/mmc_cmds.h
> @@ -19,3 +19,4 @@ int do_read_extcsd(int nargs, char **argv);
>   int do_write_extcsd(int nargs, char **argv);
>   int do_writeprotect_get(int nargs, char **argv);
>   int do_writeprotect_set(int nargs, char **argv);
> +int do_disable_emulation(int nargs, char **argv);


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

* Re: [RFC 2/2] [MMC-4.5] [MMC UTIL] Disable emulation
  2012-05-09 14:48 ` [RFC 2/2] [MMC-4.5] [MMC UTIL] " Saugata Das
  2012-05-14 10:39   ` Subhash Jadavani
@ 2012-05-14 10:50   ` Subhash Jadavani
  2012-05-14 15:09     ` Saugata Das
  1 sibling, 1 reply; 13+ messages in thread
From: Subhash Jadavani @ 2012-05-14 10:50 UTC (permalink / raw)
  To: Saugata Das; +Cc: linux-mmc, patches, saugata.das

On 5/9/2012 8:18 PM, Saugata Das wrote:
> From: Saugata Das<saugata.das@linaro.org>
>
> In this patch, we add utility to disable emulation mode in the eMMC-4.5.
> This is done to increase the data sector size to 4KB.
>
> Signed-off-by: Saugata Das<saugata.das@linaro.org>
> ---
>   mmc.c      |    6 ++++++
>   mmc.h      |    2 ++
>   mmc_cmds.c |   42 ++++++++++++++++++++++++++++++++++++++++++
>   mmc_cmds.h |    1 +
>   4 files changed, 51 insertions(+), 0 deletions(-)
>
> diff --git a/mmc.c b/mmc.c
> index c27fc24..43b95aa 100644
> --- a/mmc.c
> +++ b/mmc.c
> @@ -65,6 +65,12 @@ static struct Command commands[] = {
>   		"Set the eMMC writeprotect status of<device>.",
>   	  NULL
>   	},
> +	{ do_disable_emulation, -1,
> +	  "disable emulation", "<device>\n"
> +		"Set the eMMC data sector size to 4KB by disabling emulation<device>.",
> +	  NULL
> +	},
> +
>   	{ 0, 0, 0, 0 }
>   };
>
> diff --git a/mmc.h b/mmc.h
> index 3af36f1..a2050fa 100644
> --- a/mmc.h
> +++ b/mmc.h
> @@ -35,6 +35,8 @@
>   #define EXT_CSD_PART_SWITCH_TIME	199
>   #define EXT_CSD_BOOT_CFG		179
>   #define EXT_CSD_BOOT_WP			173
> +#define EXT_CSD_NATIVE_SECTOR_SIZE	63 /* R */
> +#define EXT_CSD_NATIVE_SECTOR	62 /* R/W */
>
>   /*
>    * EXT_CSD field definitions
> diff --git a/mmc_cmds.c b/mmc_cmds.c
> index 4562cef..2713ccd 100644
> --- a/mmc_cmds.c
> +++ b/mmc_cmds.c
> @@ -168,6 +168,48 @@ int do_writeprotect_set(int nargs, char **argv)
>   	return ret;
>   }
>
> +
> +int do_disable_emulation(int nargs, char **argv)
> +{
> +	__u8 ext_csd[512], native_sector_size;
> +	int fd, ret;
> +	char *device;
> +
> +	CHECK(nargs != 2, "Usage: mmc</path/to/mmcblkX>\n", exit(1));
> +
> +	device = argv[1];
> +
> +	fd = open(device, O_RDWR);
> +	if (fd<  0) {
> +		perror("open");
> +		exit(1);
> +	}
> +
> +	ret = read_extcsd(fd, ext_csd);
> +	if (ret) {
> +		fprintf(stderr, "Could not read EXT_CSD from %s\n", device);
> +		exit(1);
> +	}
> +
> +	native_sector_size = ext_csd[EXT_CSD_NATIVE_SECTOR_SIZE];
> +
> +	if (native_sector_size) {
Before setting the use_native_sector field, can you also check if 
NATIVE_SECTOR_SIZE and DATA_SECTOR_SIZE fields are different. If they 
are same then there is no need to set the USE_NATIVE_SECTOR size field.

> +		ret = write_extcsd_value(fd, EXT_CSD_NATIVE_SECTOR, 1);
> +
> +		if (ret) {
> +			fprintf(stderr, "Could not write 0x%02x to "
> +				"EXT_CSD[%d] in %s\n",
> +				1, EXT_CSD_BOOT_WP, device);
> +			exit(1);
> +		}
> +	} else {
> +		printf("MMC does not support 4KB native sector\n");
> +	}
> +
> +	return ret;
> +}
> +
> +
>   int do_read_extcsd(int nargs, char **argv)
>   {
>   	__u8 ext_csd[512], ext_csd_rev, reg;
> diff --git a/mmc_cmds.h b/mmc_cmds.h
> index 66e9acb..dd107d5 100644
> --- a/mmc_cmds.h
> +++ b/mmc_cmds.h
> @@ -19,3 +19,4 @@ int do_read_extcsd(int nargs, char **argv);
>   int do_write_extcsd(int nargs, char **argv);
>   int do_writeprotect_get(int nargs, char **argv);
>   int do_writeprotect_set(int nargs, char **argv);
> +int do_disable_emulation(int nargs, char **argv);


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

* Re: [RFC 1/2] [MMC-4.5] Disable emulation
  2012-05-14 10:25 ` [RFC 1/2] [MMC-4.5] " Subhash Jadavani
@ 2012-05-14 14:51   ` Saugata Das
  2012-05-15  6:40     ` Subhash Jadavani
  0 siblings, 1 reply; 13+ messages in thread
From: Saugata Das @ 2012-05-14 14:51 UTC (permalink / raw)
  To: Subhash Jadavani; +Cc: Saugata Das, linux-mmc, patches

On 14 May 2012 15:55, Subhash Jadavani <subhashj@codeaurora.org> wrote:
> On 5/9/2012 8:18 PM, Saugata Das wrote:
>>
>> From: Saugata Das<saugata.das@linaro.org>
>>
>> This patch adds the support for large sector size of 4KB by disabling
>> emulation.
>> This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
>> mmc_blk_alloc_req.
>>
>> In order to use this patch for 4KB sector size, ensure that
>> USE_NATIVE_SECTOR
>> is enabled, partition table is 4KB sector size aligned and file system
>> block
>> size is 4KB.
>>
>> Signed-off-by: Saugata Das<saugata.das@linaro.org>
>> ---
>>  drivers/mmc/card/block.c |    6 +++++-
>>  drivers/mmc/core/mmc.c   |    2 ++
>>  2 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index a7c75d8..0e54118e 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -1517,7 +1517,11 @@ static struct mmc_blk_data
>> *mmc_blk_alloc_req(struct mmc_card *card,
>>        snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
>>                 "mmcblk%d%s", md->name_idx, subname ? subname : "");
>>
>> -       blk_queue_logical_block_size(md->queue.queue, 512);
>> +       if (mmc_card_mmc(card))
>> +               blk_queue_logical_block_size(md->queue.queue,
>> +                       card->ext_csd.data_sector_size);
>
> Shouldn't we also set the physical block size to NATIVE_SECTOR_SIZE value?
>

The physical block size gets set from blk_queue_logical_block_size

> Other question,
> Did you find any eMMC device which 4K native sector size? If yes, please
> share the test results.
>

I have not yet seen the eMMC device implementing 4KB sector. But MMC
vendors are promising this feature, so I prepared this patch. So far,
I have tested by setting "data_sector_size" to 4KB (doing a hack in
mmc_read_ext_csd), configuring file system to have 4KB block size and
mounting it.

> Other than that, this patch looks good to me.
>
> Regards,
> Subhash
>
>> +       else
>> +               blk_queue_logical_block_size(md->queue.queue, 512);
>>        set_capacity(md->disk, size);
>>
>>        if (mmc_host_cmd23(card->host)) {
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 02914d6..8dcbe995 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8
>> *ext_csd)
>>                } else {
>>                        card->ext_csd.data_tag_unit_size = 0;
>>                }
>> +       } else {
>> +               card->ext_csd.data_sector_size = 512;
>>        }
>>
>>  out:
>
>

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

* Re: [RFC 2/2] [MMC-4.5] [MMC UTIL] Disable emulation
  2012-05-14 10:50   ` Subhash Jadavani
@ 2012-05-14 15:09     ` Saugata Das
  0 siblings, 0 replies; 13+ messages in thread
From: Saugata Das @ 2012-05-14 15:09 UTC (permalink / raw)
  To: Subhash Jadavani; +Cc: Saugata Das, linux-mmc, patches

On 14 May 2012 16:20, Subhash Jadavani <subhashj@codeaurora.org> wrote:
> On 5/9/2012 8:18 PM, Saugata Das wrote:
>>
>> From: Saugata Das<saugata.das@linaro.org>
>>
>> In this patch, we add utility to disable emulation mode in the eMMC-4.5.
>> This is done to increase the data sector size to 4KB.
>>
>> Signed-off-by: Saugata Das<saugata.das@linaro.org>
>> ---
>>  mmc.c      |    6 ++++++
>>  mmc.h      |    2 ++
>>  mmc_cmds.c |   42 ++++++++++++++++++++++++++++++++++++++++++
>>  mmc_cmds.h |    1 +
>>  4 files changed, 51 insertions(+), 0 deletions(-)
>>
>> diff --git a/mmc.c b/mmc.c
>> index c27fc24..43b95aa 100644
>> --- a/mmc.c
>> +++ b/mmc.c
>> @@ -65,6 +65,12 @@ static struct Command commands[] = {
>>                "Set the eMMC writeprotect status of<device>.",
>>          NULL
>>        },
>> +       { do_disable_emulation, -1,
>> +         "disable emulation", "<device>\n"
>> +               "Set the eMMC data sector size to 4KB by disabling
>> emulation<device>.",
>> +         NULL
>> +       },
>> +
>>        { 0, 0, 0, 0 }
>>  };
>>
>> diff --git a/mmc.h b/mmc.h
>> index 3af36f1..a2050fa 100644
>> --- a/mmc.h
>> +++ b/mmc.h
>> @@ -35,6 +35,8 @@
>>  #define EXT_CSD_PART_SWITCH_TIME      199
>>  #define EXT_CSD_BOOT_CFG              179
>>  #define EXT_CSD_BOOT_WP                       173
>> +#define EXT_CSD_NATIVE_SECTOR_SIZE     63 /* R */
>> +#define EXT_CSD_NATIVE_SECTOR  62 /* R/W */
>>
>>  /*
>>   * EXT_CSD field definitions
>> diff --git a/mmc_cmds.c b/mmc_cmds.c
>> index 4562cef..2713ccd 100644
>> --- a/mmc_cmds.c
>> +++ b/mmc_cmds.c
>> @@ -168,6 +168,48 @@ int do_writeprotect_set(int nargs, char **argv)
>>        return ret;
>>  }
>>
>> +
>> +int do_disable_emulation(int nargs, char **argv)
>> +{
>> +       __u8 ext_csd[512], native_sector_size;
>> +       int fd, ret;
>> +       char *device;
>> +
>> +       CHECK(nargs != 2, "Usage: mmc</path/to/mmcblkX>\n", exit(1));
>> +
>> +       device = argv[1];
>> +
>> +       fd = open(device, O_RDWR);
>> +       if (fd<  0) {
>> +               perror("open");
>> +               exit(1);
>> +       }
>> +
>> +       ret = read_extcsd(fd, ext_csd);
>> +       if (ret) {
>> +               fprintf(stderr, "Could not read EXT_CSD from %s\n",
>> device);
>> +               exit(1);
>> +       }
>> +
>> +       native_sector_size = ext_csd[EXT_CSD_NATIVE_SECTOR_SIZE];
>> +
>> +       if (native_sector_size) {
>
> Before setting the use_native_sector field, can you also check if
> NATIVE_SECTOR_SIZE and DATA_SECTOR_SIZE fields are different. If they are
> same then there is no need to set the USE_NATIVE_SECTOR size field.
>

Ok

>
>> +               ret = write_extcsd_value(fd, EXT_CSD_NATIVE_SECTOR, 1);
>> +
>> +               if (ret) {
>> +                       fprintf(stderr, "Could not write 0x%02x to "
>> +                               "EXT_CSD[%d] in %s\n",
>> +                               1, EXT_CSD_BOOT_WP, device);
>> +                       exit(1);
>> +               }
>> +       } else {
>> +               printf("MMC does not support 4KB native sector\n");
>> +       }
>> +
>> +       return ret;
>> +}
>> +
>> +
>>  int do_read_extcsd(int nargs, char **argv)
>>  {
>>        __u8 ext_csd[512], ext_csd_rev, reg;
>> diff --git a/mmc_cmds.h b/mmc_cmds.h
>> index 66e9acb..dd107d5 100644
>> --- a/mmc_cmds.h
>> +++ b/mmc_cmds.h
>> @@ -19,3 +19,4 @@ int do_read_extcsd(int nargs, char **argv);
>>  int do_write_extcsd(int nargs, char **argv);
>>  int do_writeprotect_get(int nargs, char **argv);
>>  int do_writeprotect_set(int nargs, char **argv);
>> +int do_disable_emulation(int nargs, char **argv);
>
>

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

* Re: [RFC 2/2] [MMC-4.5] [MMC UTIL] Disable emulation
  2012-05-14 10:39   ` Subhash Jadavani
@ 2012-05-14 15:25     ` Saugata Das
  0 siblings, 0 replies; 13+ messages in thread
From: Saugata Das @ 2012-05-14 15:25 UTC (permalink / raw)
  To: Subhash Jadavani; +Cc: Saugata Das, linux-mmc, patches

On 14 May 2012 16:09, Subhash Jadavani <subhashj@codeaurora.org> wrote:
> On 5/9/2012 8:18 PM, Saugata Das wrote:
>>
>> From: Saugata Das<saugata.das@linaro.org>
>>
>> In this patch, we add utility to disable emulation mode in the eMMC-4.5.
>> This is done to increase the data sector size to 4KB.
>>
>> Signed-off-by: Saugata Das<saugata.das@linaro.org>
>> ---
>>  mmc.c      |    6 ++++++
>>  mmc.h      |    2 ++
>>  mmc_cmds.c |   42 ++++++++++++++++++++++++++++++++++++++++++
>>  mmc_cmds.h |    1 +
>>  4 files changed, 51 insertions(+), 0 deletions(-)
>>
>> diff --git a/mmc.c b/mmc.c
>> index c27fc24..43b95aa 100644
>> --- a/mmc.c
>> +++ b/mmc.c
>> @@ -65,6 +65,12 @@ static struct Command commands[] = {
>>                "Set the eMMC writeprotect status of<device>.",
>>          NULL
>>        },
>> +       { do_disable_emulation, -1,
>
> can we add good name? which emulation we are disabling? It's 512B emulation
> mode, we are disabling.
>

Ok

>> +         "disable emulation", "<device>\n"
>> +               "Set the eMMC data sector size to 4KB by disabling
>> emulation<device>.",
>> +         NULL
>> +       },
>> +
>>        { 0, 0, 0, 0 }
>>  };
>>
>> diff --git a/mmc.h b/mmc.h
>> index 3af36f1..a2050fa 100644
>> --- a/mmc.h
>> +++ b/mmc.h
>> @@ -35,6 +35,8 @@
>>  #define EXT_CSD_PART_SWITCH_TIME      199
>>  #define EXT_CSD_BOOT_CFG              179
>>  #define EXT_CSD_BOOT_WP                       173
>> +#define EXT_CSD_NATIVE_SECTOR_SIZE     63 /* R */
>> +#define EXT_CSD_NATIVE_SECTOR  62 /* R/W */
>
> Can we name this as EXT_CSD_USE_NATIVE_SECTOR?
>

Ok

>>
>>  /*
>>   * EXT_CSD field definitions
>> diff --git a/mmc_cmds.c b/mmc_cmds.c
>> index 4562cef..2713ccd 100644
>> --- a/mmc_cmds.c
>> +++ b/mmc_cmds.c
>> @@ -168,6 +168,48 @@ int do_writeprotect_set(int nargs, char **argv)
>>        return ret;
>>  }
>>
>> +
>> +int do_disable_emulation(int nargs, char **argv)
>> +{
>> +       __u8 ext_csd[512], native_sector_size;
>> +       int fd, ret;
>> +       char *device;
>> +
>> +       CHECK(nargs != 2, "Usage: mmc</path/to/mmcblkX>\n", exit(1));
>> +
>> +       device = argv[1];
>> +
>> +       fd = open(device, O_RDWR);
>> +       if (fd<  0) {
>> +               perror("open");
>> +               exit(1);
>> +       }
>> +
>> +       ret = read_extcsd(fd, ext_csd);
>> +       if (ret) {
>> +               fprintf(stderr, "Could not read EXT_CSD from %s\n",
>> device);
>> +               exit(1);
>> +       }
>> +
>> +       native_sector_size = ext_csd[EXT_CSD_NATIVE_SECTOR_SIZE];
>> +
>> +       if (native_sector_size) {
>> +               ret = write_extcsd_value(fd, EXT_CSD_NATIVE_SECTOR, 1);
>
> Just curious, how are we going to power cycle the device after setting the
> USE_NATIVE_SECTOR? because DATA_SECTOR_SIZE won't be changed to 4K until we
> explicitly power cycle after setting this field.
>

I will add a "printf" instructing the user to power cycle the eMMC at
the end of the switch.

>> +
>> +               if (ret) {
>> +                       fprintf(stderr, "Could not write 0x%02x to "
>> +                               "EXT_CSD[%d] in %s\n",
>> +                               1, EXT_CSD_BOOT_WP, device);
>> +                       exit(1);
>> +               }
>> +       } else {
>> +               printf("MMC does not support 4KB native sector\n");
>> +       }
>> +
>> +       return ret;
>> +}
>> +
>> +
>>  int do_read_extcsd(int nargs, char **argv)
>>  {
>>        __u8 ext_csd[512], ext_csd_rev, reg;
>> diff --git a/mmc_cmds.h b/mmc_cmds.h
>> index 66e9acb..dd107d5 100644
>> --- a/mmc_cmds.h
>> +++ b/mmc_cmds.h
>> @@ -19,3 +19,4 @@ int do_read_extcsd(int nargs, char **argv);
>>  int do_write_extcsd(int nargs, char **argv);
>>  int do_writeprotect_get(int nargs, char **argv);
>>  int do_writeprotect_set(int nargs, char **argv);
>> +int do_disable_emulation(int nargs, char **argv);
>
>

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

* Re: [RFC 1/2] [MMC-4.5] Disable emulation
  2012-05-14 14:51   ` Saugata Das
@ 2012-05-15  6:40     ` Subhash Jadavani
  2012-05-15  9:41       ` Luca Porzio (lporzio)
                         ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Subhash Jadavani @ 2012-05-15  6:40 UTC (permalink / raw)
  To: Saugata Das; +Cc: Saugata Das, linux-mmc, patches

On 5/14/2012 8:21 PM, Saugata Das wrote:
> On 14 May 2012 15:55, Subhash Jadavani<subhashj@codeaurora.org>  wrote:
>> On 5/9/2012 8:18 PM, Saugata Das wrote:
>>> From: Saugata Das<saugata.das@linaro.org>
>>>
>>> This patch adds the support for large sector size of 4KB by disabling
>>> emulation.
>>> This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
>>> mmc_blk_alloc_req.
>>>
>>> In order to use this patch for 4KB sector size, ensure that
>>> USE_NATIVE_SECTOR
>>> is enabled, partition table is 4KB sector size aligned and file system
>>> block
>>> size is 4KB.
>>>
>>> Signed-off-by: Saugata Das<saugata.das@linaro.org>
>>> ---
>>>   drivers/mmc/card/block.c |    6 +++++-
>>>   drivers/mmc/core/mmc.c   |    2 ++
>>>   2 files changed, 7 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>> index a7c75d8..0e54118e 100644
>>> --- a/drivers/mmc/card/block.c
>>> +++ b/drivers/mmc/card/block.c
>>> @@ -1517,7 +1517,11 @@ static struct mmc_blk_data
>>> *mmc_blk_alloc_req(struct mmc_card *card,
>>>         snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
>>>                  "mmcblk%d%s", md->name_idx, subname ? subname : "");
>>>
>>> -       blk_queue_logical_block_size(md->queue.queue, 512);
>>> +       if (mmc_card_mmc(card))
>>> +               blk_queue_logical_block_size(md->queue.queue,
>>> +                       card->ext_csd.data_sector_size);
>> Shouldn't we also set the physical block size to NATIVE_SECTOR_SIZE value?
>>
> The physical block size gets set from blk_queue_logical_block_size
>
>> Other question,
>> Did you find any eMMC device which 4K native sector size? If yes, please
>> share the test results.
>>
> I have not yet seen the eMMC device implementing 4KB sector. But MMC
> vendors are promising this feature, so I prepared this patch. So far,
> I have tested by setting "data_sector_size" to 4KB (doing a hack in
> mmc_read_ext_csd), configuring file system to have 4KB block size and
> mounting it.
Ok. So basically you are emulating the 512B native sector device as 4K 
native sector device and always read/write this device in 4K 
granularity. So this is just a proof of concept that setting the block 
queue logical sector size to 4K works or not?
Are vendors promising any performance improvement if we run the device 
in 4K sector size mode rather than emulation mode?

I have few other doubts (from specification point of view) when the 
device starts running in native sector size mode:

1. According spec, "A large sector device shall not support partial 
access and shall not support reliable write mode EN_REL_WR=0."
         Shouldn't this patch make ensure this?

2.  Some internal sizes reported by the device may change after 
successfully disabling of the emulation mode.
         Shouldn't  we take of this as well?

3. After a successful disabling of the emulation mode, the content of 
the User Data Area is undefined.
         If the contents of the user data area is undefined after 
disabling the emulation mode, i don't think device will be able to boot 
to kernel after power cycle. So does this mean we have to flash the 
kernel/file system images
         again? Basically i don't see a use of disabling the emulation 
mode from kernel. It should be done by basic build/image flashing 
utility which could flash the images after setting the use_native_sector 
field and power cycle.

4. Data transfers on the bus are still using 512B CRC-protected blocks, 
but data shall only be transferred in multiple of 8 such blocks (always 
multiples of 4KB)
         So this means host controller still will be configured in 512B 
sector mode but amount of data will be in multple of 8 such 512B blocks?

5. Sector addressing is still used, but sector addresses shall always be 
aligned to 8 (4KB)
         How the sector addressing work here? will the sector address 
(at argument of read/write commands) of byte address 0x1000 be 1 or 8?

         512B sector addressing:
                 (byte address)         (sector address)
                 0x0000                => 0
                 0x0200                => 1
                 0x0400                => 2
                 0x0600                => 3
                 0x0800                => 4
                 0x0A00                => 5
                 0x0C00                => 6
                 0x0E00                => 7
                 0x1000                => 8

         4K sector addressing:
                 (byte address)         (sector address)
                 0x0000                => 0
                 0x0200                => NA
                 0x0400                => NA
                 0x0600                => NA
                 0x0800                => NA
                 0x0A00                => NA
                 0x0C00                => NA
                 0x0E00                => NA
                 0x1000                => 1

6. Arguments for read commands (CMD17/18) and write commands (CMD24/25) 
shall always be aligned to 8 (4KB)
         What will be meaning of the single block read now? Should it be 
use single 512B block or single 4KB block? If CMD17 and CMD24 now mean 
that access to 4KB memory area, don't you need to take of the same in MMC
         block driver?

7. what should be the block length set by CMD16 (SET_BLOCK_LENGTH) command?
         I would guess that in 4KB native sector size mode, this command 
is redundant and will be ignored by the card but it's no where 
explicitly mentioned in specification.

Regards,
Subhash

>
>> Other than that, this patch looks good to me.
>>
>> Regards,
>> Subhash
>>
>>> +       else
>>> +               blk_queue_logical_block_size(md->queue.queue, 512);
>>>         set_capacity(md->disk, size);
>>>
>>>         if (mmc_host_cmd23(card->host)) {
>>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>>> index 02914d6..8dcbe995 100644
>>> --- a/drivers/mmc/core/mmc.c
>>> +++ b/drivers/mmc/core/mmc.c
>>> @@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8
>>> *ext_csd)
>>>                 } else {
>>>                         card->ext_csd.data_tag_unit_size = 0;
>>>                 }
>>> +       } else {
>>> +               card->ext_csd.data_sector_size = 512;
>>>         }
>>>
>>>   out:
>>
> --
> 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] 13+ messages in thread

* RE: [RFC 1/2] [MMC-4.5] Disable emulation
  2012-05-15  6:40     ` Subhash Jadavani
@ 2012-05-15  9:41       ` Luca Porzio (lporzio)
  2012-05-15 10:17       ` S, Venkatraman
  2012-05-15 14:49       ` Saugata Das
  2 siblings, 0 replies; 13+ messages in thread
From: Luca Porzio (lporzio) @ 2012-05-15  9:41 UTC (permalink / raw)
  To: Subhash Jadavani, Saugata Das
  Cc: Saugata Das, linux-mmc@vger.kernel.org, patches@linaro.org

Hallo Subhash,

One general comment: native sector size is mandatory (as of Jedec spec) 
for >256GB devices. For other devices native sector size is optional.
This feature is not meant for performance improvement. Anyway if you 
start using your device with 4K alignment, you should already see 
some performance improvements on currently available market devices.

Other Comments below.

> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-owner@vger.kernel.org]
> On Behalf Of Subhash Jadavani
> Sent: Monday, May 14, 2012 11:40 PM
> To: Saugata Das
> Cc: Saugata Das; linux-mmc@vger.kernel.org; patches@linaro.org
> Subject: Re: [RFC 1/2] [MMC-4.5] Disable emulation
> 
> On 5/14/2012 8:21 PM, Saugata Das wrote:
> > On 14 May 2012 15:55, Subhash Jadavani<subhashj@codeaurora.org>  wrote:
> >> On 5/9/2012 8:18 PM, Saugata Das wrote:
> >>> From: Saugata Das<saugata.das@linaro.org>
> >>>
> >>> This patch adds the support for large sector size of 4KB by disabling
> >>> emulation.
> >>> This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
> >>> mmc_blk_alloc_req.
> >>>
> >>> In order to use this patch for 4KB sector size, ensure that
> >>> USE_NATIVE_SECTOR
> >>> is enabled, partition table is 4KB sector size aligned and file system
> >>> block
> >>> size is 4KB.
> >>>
> >>> Signed-off-by: Saugata Das<saugata.das@linaro.org>
> >>> ---
> >>>   drivers/mmc/card/block.c |    6 +++++-
> >>>   drivers/mmc/core/mmc.c   |    2 ++
> >>>   2 files changed, 7 insertions(+), 1 deletions(-)
> >>>
> >>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> >>> index a7c75d8..0e54118e 100644
> >>> --- a/drivers/mmc/card/block.c
> >>> +++ b/drivers/mmc/card/block.c
> >>> @@ -1517,7 +1517,11 @@ static struct mmc_blk_data
> >>> *mmc_blk_alloc_req(struct mmc_card *card,
> >>>         snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
> >>>                  "mmcblk%d%s", md->name_idx, subname ? subname : "");
> >>>
> >>> -       blk_queue_logical_block_size(md->queue.queue, 512);
> >>> +       if (mmc_card_mmc(card))
> >>> +               blk_queue_logical_block_size(md->queue.queue,
> >>> +                       card->ext_csd.data_sector_size);
> >> Shouldn't we also set the physical block size to NATIVE_SECTOR_SIZE value?
> >>
> > The physical block size gets set from blk_queue_logical_block_size
> >
> >> Other question,
> >> Did you find any eMMC device which 4K native sector size? If yes, please
> >> share the test results.
> >>
> > I have not yet seen the eMMC device implementing 4KB sector. But MMC
> > vendors are promising this feature, so I prepared this patch. So far,
> > I have tested by setting "data_sector_size" to 4KB (doing a hack in
> > mmc_read_ext_csd), configuring file system to have 4KB block size and
> > mounting it.
> Ok. So basically you are emulating the 512B native sector device as 4K
> native sector device and always read/write this device in 4K
> granularity. So this is just a proof of concept that setting the block
> queue logical sector size to 4K works or not?
> Are vendors promising any performance improvement if we run the device
> in 4K sector size mode rather than emulation mode?
> 
> I have few other doubts (from specification point of view) when the
> device starts running in native sector size mode:
> 
> 1. According spec, "A large sector device shall not support partial
> access and shall not support reliable write mode EN_REL_WR=0."
>          Shouldn't this patch make ensure this?
> 

I agree. Reliable write shall be disabled for native sector size 
but also I would suggest for performances (reliable writes act
As per Jedec spec as the FUA bit so unless this is intended behavior
I would suggest to remove it)

> 2.  Some internal sizes reported by the device may change after
> successfully disabling of the emulation mode.
>          Shouldn't  we take of this as well?
> 
> 3. After a successful disabling of the emulation mode, the content of
> the User Data Area is undefined.
>          If the contents of the user data area is undefined after
> disabling the emulation mode, i don't think device will be able to boot
> to kernel after power cycle. So does this mean we have to flash the
> kernel/file system images
>          again? Basically i don't see a use of disabling the emulation
> mode from kernel. It should be done by basic build/image flashing
> utility which could flash the images after setting the use_native_sector
> field and power cycle.
> 

I agree that use_native_sector size and its settings is something that 
Basically needs to happen in factory or any kind of "controlled environment".

Nevertheless my understanding here is that Saugata provided only the support 
within the Kernel to recognize the native sector setting. In my understanding
the userspace tool is more like a reference code for factory or development 
than something to be used for production. 

As such I think Saugata patch is ok because lets the kernel be aware of it.

> 4. Data transfers on the bus are still using 512B CRC-protected blocks,
> but data shall only be transferred in multiple of 8 such blocks (always
> multiples of 4KB)
>          So this means host controller still will be configured in 512B
> sector mode but amount of data will be in multple of 8 such 512B blocks?
>

Yes. Basically in the attempt to not be disruptive with legacy host 
Controllers, CRC, sectors and addressing will all still be in terms of 512B
sectors.
Actually my understanding is that as long as you guarantee a 4K alignment, 
Nothing changes at all with or without enabling native sector size.
 
> 5. Sector addressing is still used, but sector addresses shall always be
> aligned to 8 (4KB)
>          How the sector addressing work here? will the sector address
> (at argument of read/write commands) of byte address 0x1000 be 1 or 8?
> 
>          512B sector addressing:
>                  (byte address)         (sector address)
>                  0x0000                => 0
>                  0x0200                => 1
>                  0x0400                => 2
>                  0x0600                => 3
>                  0x0800                => 4
>                  0x0A00                => 5
>                  0x0C00                => 6
>                  0x0E00                => 7
>                  0x1000                => 8
> 

This is right

>          4K sector addressing:
>                  (byte address)         (sector address)
>                  0x0000                => 0
>                  0x0200                => NA
>                  0x0400                => NA
>                  0x0600                => NA
>                  0x0800                => NA
>                  0x0A00                => NA
>                  0x0C00                => NA
>                  0x0E00                => NA
>                  0x1000                => 1
> 

This is wrong.
As above, addressing is still in 512B sectors to guarantee retro-compatibility.

> 6. Arguments for read commands (CMD17/18) and write commands (CMD24/25)
> shall always be aligned to 8 (4KB)
>          What will be meaning of the single block read now? Should it be
> use single 512B block or single 4KB block? If CMD17 and CMD24 now mean
> that access to 4KB memory area, don't you need to take of the same in MMC
>          block driver?
> 

Single block read/write as per jedec spec cannot be used anymore as such they 
should be disabled on those devices where native sector size has been enabled.

> 7. what should be the block length set by CMD16 (SET_BLOCK_LENGTH) command?
>          I would guess that in 4KB native sector size mode, this command
> is redundant and will be ignored by the card but it's no where
> explicitly mentioned in specification.
> 
> Regards,
> Subhash
> 
> >
> >> Other than that, this patch looks good to me.
> >>
> >> Regards,
> >> Subhash
> >>
> >>> +       else
> >>> +               blk_queue_logical_block_size(md->queue.queue, 512);
> >>>         set_capacity(md->disk, size);
> >>>
> >>>         if (mmc_host_cmd23(card->host)) {
> >>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> >>> index 02914d6..8dcbe995 100644
> >>> --- a/drivers/mmc/core/mmc.c
> >>> +++ b/drivers/mmc/core/mmc.c
> >>> @@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8
> >>> *ext_csd)
> >>>                 } else {
> >>>                         card->ext_csd.data_tag_unit_size = 0;
> >>>                 }
> >>> +       } else {
> >>> +               card->ext_csd.data_sector_size = 512;
> >>>         }
> >>>
> >>>   out:
> >>
> > --
> > 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
> 
> --
> 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] 13+ messages in thread

* Re: [RFC 1/2] [MMC-4.5] Disable emulation
  2012-05-15  6:40     ` Subhash Jadavani
  2012-05-15  9:41       ` Luca Porzio (lporzio)
@ 2012-05-15 10:17       ` S, Venkatraman
  2012-05-15 14:55         ` Saugata Das
  2012-05-15 14:49       ` Saugata Das
  2 siblings, 1 reply; 13+ messages in thread
From: S, Venkatraman @ 2012-05-15 10:17 UTC (permalink / raw)
  To: Subhash Jadavani; +Cc: Saugata Das, Saugata Das, linux-mmc, patches

On Tue, May 15, 2012 at 12:10 PM, Subhash Jadavani
<subhashj@codeaurora.org> wrote:
> On 5/14/2012 8:21 PM, Saugata Das wrote:
>>
>> On 14 May 2012 15:55, Subhash Jadavani<subhashj@codeaurora.org>  wrote:
>>>
>>> On 5/9/2012 8:18 PM, Saugata Das wrote:
>>>>
>>>> From: Saugata Das<saugata.das@linaro.org>
>>>>
>>>> This patch adds the support for large sector size of 4KB by disabling
>>>> emulation.
>>>> This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
>>>> mmc_blk_alloc_req.
>>>>
>>>> In order to use this patch for 4KB sector size, ensure that
>>>> USE_NATIVE_SECTOR
>>>> is enabled, partition table is 4KB sector size aligned and file system
>>>> block
>>>> size is 4KB.
>>>>
>>>> Signed-off-by: Saugata Das<saugata.das@linaro.org>
>>>> ---
>>>>  drivers/mmc/card/block.c |    6 +++++-
>>>>  drivers/mmc/core/mmc.c   |    2 ++
>>>>  2 files changed, 7 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>>> index a7c75d8..0e54118e 100644
>>>> --- a/drivers/mmc/card/block.c
>>>> +++ b/drivers/mmc/card/block.c
>>>> @@ -1517,7 +1517,11 @@ static struct mmc_blk_data
>>>> *mmc_blk_alloc_req(struct mmc_card *card,
>>>>        snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
>>>>                 "mmcblk%d%s", md->name_idx, subname ? subname : "");
>>>>
>>>> -       blk_queue_logical_block_size(md->queue.queue, 512);
>>>> +       if (mmc_card_mmc(card))
>>>> +               blk_queue_logical_block_size(md->queue.queue,
>>>> +                       card->ext_csd.data_sector_size);
>>>
>>> Shouldn't we also set the physical block size to NATIVE_SECTOR_SIZE
>>> value?
>>>
>> The physical block size gets set from blk_queue_logical_block_size
>>
>>> Other question,
>>> Did you find any eMMC device which 4K native sector size? If yes, please
>>> share the test results.
>>>
>> I have not yet seen the eMMC device implementing 4KB sector. But MMC
>> vendors are promising this feature, so I prepared this patch. So far,
>> I have tested by setting "data_sector_size" to 4KB (doing a hack in
>> mmc_read_ext_csd), configuring file system to have 4KB block size and
>> mounting it.
>
> Ok. So basically you are emulating the 512B native sector device as 4K
> native sector device and always read/write this device in 4K granularity. So
> this is just a proof of concept that setting the block queue logical sector
> size to 4K works or not?
> Are vendors promising any performance improvement if we run the device in 4K
> sector size mode rather than emulation mode?
>
> I have few other doubts (from specification point of view) when the device
> starts running in native sector size mode:
>
> 1. According spec, "A large sector device shall not support partial access
> and shall not support reliable write mode EN_REL_WR=0."
>        Shouldn't this patch make ensure this?
>
> 2.  Some internal sizes reported by the device may change after successfully
> disabling of the emulation mode.
>        Shouldn't  we take of this as well?
This would be because if a single 512byte sector was marked as bad
(unusable) initially, the entire
aligned 4K block would be marked as bad now after switching to 4K
sector size, resulting in a slight capacity shrinkage.
  This would only matter if the switch happens for a fairly old
device. Typically, the sector size change should happen during factory
initialization, so there wouldn't be too many bad blocks, so it
shouldn't be much of an issue now.
  Of course, this is just one aspect of a problem for the "dynamic
device capacity" feature of eMMC4.5, and can be solved if we get to
that..


>
> 3. After a successful disabling of the emulation mode, the content of the
> User Data Area is undefined.
>        If the contents of the user data area is undefined after disabling
> the emulation mode, i don't think device will be able to boot to kernel
> after power cycle. So does this mean we have to flash the kernel/file system
> images
>        again? Basically i don't see a use of disabling the emulation mode
> from kernel. It should be done by basic build/image flashing utility which
> could flash the images after setting the use_native_sector field and power
> cycle.
>
> 4. Data transfers on the bus are still using 512B CRC-protected blocks, but
> data shall only be transferred in multiple of 8 such blocks (always
> multiples of 4KB)
>        So this means host controller still will be configured in 512B sector
> mode but amount of data will be in multple of 8 such 512B blocks?
>
> 5. Sector addressing is still used, but sector addresses shall always be
> aligned to 8 (4KB)
>        How the sector addressing work here? will the sector address (at
> argument of read/write commands) of byte address 0x1000 be 1 or 8?
>
>        512B sector addressing:
>                (byte address)         (sector address)
>                0x0000                => 0
>                0x0200                => 1
>                0x0400                => 2
>                0x0600                => 3
>                0x0800                => 4
>                0x0A00                => 5
>                0x0C00                => 6
>                0x0E00                => 7
>                0x1000                => 8
>
>        4K sector addressing:
>                (byte address)         (sector address)
>                0x0000                => 0
>                0x0200                => NA
>                0x0400                => NA
>                0x0600                => NA
>                0x0800                => NA
>                0x0A00                => NA
>                0x0C00                => NA
>                0x0E00                => NA
>                0x1000                => 1
>
> 6. Arguments for read commands (CMD17/18) and write commands (CMD24/25)
> shall always be aligned to 8 (4KB)
>        What will be meaning of the single block read now? Should it be use
> single 512B block or single 4KB block? If CMD17 and CMD24 now mean that
> access to 4KB memory area, don't you need to take of the same in MMC
>        block driver?
>
> 7. what should be the block length set by CMD16 (SET_BLOCK_LENGTH) command?
>        I would guess that in 4KB native sector size mode, this command is
> redundant and will be ignored by the card but it's no where explicitly
> mentioned in specification.
>
> Regards,
> Subhash
>
>
>>
>>> Other than that, this patch looks good to me.
>>>
>>> Regards,
>>> Subhash
>>>
>>>> +       else
>>>> +               blk_queue_logical_block_size(md->queue.queue, 512);
>>>>        set_capacity(md->disk, size);
>>>>
>>>>        if (mmc_host_cmd23(card->host)) {
>>>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>>>> index 02914d6..8dcbe995 100644
>>>> --- a/drivers/mmc/core/mmc.c
>>>> +++ b/drivers/mmc/core/mmc.c
>>>> @@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card,
>>>> u8
>>>> *ext_csd)
>>>>                } else {
>>>>                        card->ext_csd.data_tag_unit_size = 0;
>>>>                }
>>>> +       } else {
>>>> +               card->ext_csd.data_sector_size = 512;
>>>>        }
>>>>
>>>>  out:
>>>
>>>
>> --
>> 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
>
>
> --
> 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] 13+ messages in thread

* Re: [RFC 1/2] [MMC-4.5] Disable emulation
  2012-05-15  6:40     ` Subhash Jadavani
  2012-05-15  9:41       ` Luca Porzio (lporzio)
  2012-05-15 10:17       ` S, Venkatraman
@ 2012-05-15 14:49       ` Saugata Das
  2 siblings, 0 replies; 13+ messages in thread
From: Saugata Das @ 2012-05-15 14:49 UTC (permalink / raw)
  To: Subhash Jadavani; +Cc: Saugata Das, linux-mmc, patches

On 15 May 2012 12:10, Subhash Jadavani <subhashj@codeaurora.org> wrote:
> On 5/14/2012 8:21 PM, Saugata Das wrote:
>>
>> On 14 May 2012 15:55, Subhash Jadavani<subhashj@codeaurora.org>  wrote:
>>>
>>> On 5/9/2012 8:18 PM, Saugata Das wrote:
>>>>
>>>> From: Saugata Das<saugata.das@linaro.org>
>>>>
>>>> This patch adds the support for large sector size of 4KB by disabling
>>>> emulation.
>>>> This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
>>>> mmc_blk_alloc_req.
>>>>
>>>> In order to use this patch for 4KB sector size, ensure that
>>>> USE_NATIVE_SECTOR
>>>> is enabled, partition table is 4KB sector size aligned and file system
>>>> block
>>>> size is 4KB.
>>>>
>>>> Signed-off-by: Saugata Das<saugata.das@linaro.org>
>>>> ---
>>>>  drivers/mmc/card/block.c |    6 +++++-
>>>>  drivers/mmc/core/mmc.c   |    2 ++
>>>>  2 files changed, 7 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>>> index a7c75d8..0e54118e 100644
>>>> --- a/drivers/mmc/card/block.c
>>>> +++ b/drivers/mmc/card/block.c
>>>> @@ -1517,7 +1517,11 @@ static struct mmc_blk_data
>>>> *mmc_blk_alloc_req(struct mmc_card *card,
>>>>        snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
>>>>                 "mmcblk%d%s", md->name_idx, subname ? subname : "");
>>>>
>>>> -       blk_queue_logical_block_size(md->queue.queue, 512);
>>>> +       if (mmc_card_mmc(card))
>>>> +               blk_queue_logical_block_size(md->queue.queue,
>>>> +                       card->ext_csd.data_sector_size);
>>>
>>> Shouldn't we also set the physical block size to NATIVE_SECTOR_SIZE
>>> value?
>>>
>> The physical block size gets set from blk_queue_logical_block_size
>>
>>> Other question,
>>> Did you find any eMMC device which 4K native sector size? If yes, please
>>> share the test results.
>>>
>> I have not yet seen the eMMC device implementing 4KB sector. But MMC
>> vendors are promising this feature, so I prepared this patch. So far,
>> I have tested by setting "data_sector_size" to 4KB (doing a hack in
>> mmc_read_ext_csd), configuring file system to have 4KB block size and
>> mounting it.
>
> Ok. So basically you are emulating the 512B native sector device as 4K
> native sector device and always read/write this device in 4K granularity. So
> this is just a proof of concept that setting the block queue logical sector
> size to 4K works or not?

Yes and it works. Note that, even the partition tables need to be 4KB aligned.

> Are vendors promising any performance improvement if we run the device in 4K
> sector size mode rather than emulation mode?
>

Atleast from the explanation in the spec on emulation mode, this
promises to provide some improvement. Some vendors may already have
some proprietary optimization to optimize access which are not 4KB
aligned. But lets target this 4KB alignment to have a good performance
across devices.

> I have few other doubts (from specification point of view) when the device
> starts running in native sector size mode:
>
> 1. According spec, "A large sector device shall not support partial access
> and shall not support reliable write mode EN_REL_WR=0."
>        Shouldn't this patch make ensure this?
>

Yes, May be, we should add a check in mmc-util i.e. set
USE_NATIVE_SECTOR only if EN_REL_WR = 1 .


> 2.  Some internal sizes reported by the device may change after successfully
> disabling of the emulation mode.
>        Shouldn't  we take of this as well?
>

Which parameter size will change ? I did not come across such remark
in the specification.


> 3. After a successful disabling of the emulation mode, the content of the
> User Data Area is undefined.
>        If the contents of the user data area is undefined after disabling
> the emulation mode, i don't think device will be able to boot to kernel
> after power cycle. So does this mean we have to flash the kernel/file system
> images
>        again? Basically i don't see a use of disabling the emulation mode
> from kernel. It should be done by basic build/image flashing utility which
> could flash the images after setting the use_native_sector field and power
> cycle.

Kernel is not disabling emulation mode. The mmc-util tool is doing it.
You are right, the flashing utility will disable the emulation mode
(mmc-util change can be used as a reference for the flashing utility).
Kernel (mmc driver) just needs to understand that the mode has changed
and notify file system accordingly (blk_queue_logical_block_size)

>
> 4. Data transfers on the bus are still using 512B CRC-protected blocks, but
> data shall only be transferred in multiple of 8 such blocks (always
> multiples of 4KB)
>        So this means host controller still will be configured in 512B sector
> mode but amount of data will be in multple of 8 such 512B blocks?
>

Yes, there is no host controller change.

> 5. Sector addressing is still used, but sector addresses shall always be
> aligned to 8 (4KB)
>        How the sector addressing work here? will the sector address (at
> argument of read/write commands) of byte address 0x1000 be 1 or 8?
>
>        512B sector addressing:
>                (byte address)         (sector address)
>                0x0000                => 0
>                0x0200                => 1
>                0x0400                => 2
>                0x0600                => 3
>                0x0800                => 4
>                0x0A00                => 5
>                0x0C00                => 6
>                0x0E00                => 7
>                0x1000                => 8
>

Yes, it continues to be 512B addressing.

>        4K sector addressing:
>                (byte address)         (sector address)
>                0x0000                => 0
>                0x0200                => NA
>                0x0400                => NA
>                0x0600                => NA
>                0x0800                => NA
>                0x0A00                => NA
>                0x0C00                => NA
>                0x0E00                => NA
>                0x1000                => 1
>
> 6. Arguments for read commands (CMD17/18) and write commands (CMD24/25)
> shall always be aligned to 8 (4KB)
>        What will be meaning of the single block read now? Should it be use
> single 512B block or single 4KB block? If CMD17 and CMD24 now mean that
> access to 4KB memory area, don't you need to take of the same in MMC
>        block driver?

Yes, single block read/write is not be allowed. From file system, we
should not have 512B read/write once we have indicated 4KB logical
sector size from blk_queue_logical_block_size.

I think we can have a check on this from mmc_blk_rw_rq_prep, where a
single block read/write request will be returned with,
__blk_end_request(req, -EIO, blk_rq_cur_bytes(req));

>
> 7. what should be the block length set by CMD16 (SET_BLOCK_LENGTH) command?
>        I would guess that in 4KB native sector size mode, this command is
> redundant and will be ignored by the card but it's no where explicitly
> mentioned in specification.
>

I guess, it should be multiple of 4KB ! I see that mmc_set_blocklen is
returning the error code to the caller. So, I see nothing to be done
there.


> Regards,
> Subhash
>
>>
>>> Other than that, this patch looks good to me.
>>>
>>> Regards,
>>> Subhash
>>>
>>>> +       else
>>>> +               blk_queue_logical_block_size(md->queue.queue, 512);
>>>>        set_capacity(md->disk, size);
>>>>
>>>>        if (mmc_host_cmd23(card->host)) {
>>>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>>>> index 02914d6..8dcbe995 100644
>>>> --- a/drivers/mmc/core/mmc.c
>>>> +++ b/drivers/mmc/core/mmc.c
>>>> @@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card,
>>>> u8
>>>> *ext_csd)
>>>>                } else {
>>>>                        card->ext_csd.data_tag_unit_size = 0;
>>>>                }
>>>> +       } else {
>>>> +               card->ext_csd.data_sector_size = 512;
>>>>        }
>>>>
>>>>  out:
>>>
>>>
>> --
>> 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] 13+ messages in thread

* Re: [RFC 1/2] [MMC-4.5] Disable emulation
  2012-05-15 10:17       ` S, Venkatraman
@ 2012-05-15 14:55         ` Saugata Das
  0 siblings, 0 replies; 13+ messages in thread
From: Saugata Das @ 2012-05-15 14:55 UTC (permalink / raw)
  To: S, Venkatraman; +Cc: Subhash Jadavani, Saugata Das, linux-mmc, patches

On 15 May 2012 15:47, S, Venkatraman <svenkatr@ti.com> wrote:
> On Tue, May 15, 2012 at 12:10 PM, Subhash Jadavani
> <subhashj@codeaurora.org> wrote:
>> On 5/14/2012 8:21 PM, Saugata Das wrote:
>>>
>>> On 14 May 2012 15:55, Subhash Jadavani<subhashj@codeaurora.org>  wrote:
>>>>
>>>> On 5/9/2012 8:18 PM, Saugata Das wrote:
>>>>>
>>>>> From: Saugata Das<saugata.das@linaro.org>
>>>>>
>>>>> This patch adds the support for large sector size of 4KB by disabling
>>>>> emulation.
>>>>> This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during
>>>>> mmc_blk_alloc_req.
>>>>>
>>>>> In order to use this patch for 4KB sector size, ensure that
>>>>> USE_NATIVE_SECTOR
>>>>> is enabled, partition table is 4KB sector size aligned and file system
>>>>> block
>>>>> size is 4KB.
>>>>>
>>>>> Signed-off-by: Saugata Das<saugata.das@linaro.org>
>>>>> ---
>>>>>  drivers/mmc/card/block.c |    6 +++++-
>>>>>  drivers/mmc/core/mmc.c   |    2 ++
>>>>>  2 files changed, 7 insertions(+), 1 deletions(-)
>>>>>
>>>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>>>> index a7c75d8..0e54118e 100644
>>>>> --- a/drivers/mmc/card/block.c
>>>>> +++ b/drivers/mmc/card/block.c
>>>>> @@ -1517,7 +1517,11 @@ static struct mmc_blk_data
>>>>> *mmc_blk_alloc_req(struct mmc_card *card,
>>>>>        snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
>>>>>                 "mmcblk%d%s", md->name_idx, subname ? subname : "");
>>>>>
>>>>> -       blk_queue_logical_block_size(md->queue.queue, 512);
>>>>> +       if (mmc_card_mmc(card))
>>>>> +               blk_queue_logical_block_size(md->queue.queue,
>>>>> +                       card->ext_csd.data_sector_size);
>>>>
>>>> Shouldn't we also set the physical block size to NATIVE_SECTOR_SIZE
>>>> value?
>>>>
>>> The physical block size gets set from blk_queue_logical_block_size
>>>
>>>> Other question,
>>>> Did you find any eMMC device which 4K native sector size? If yes, please
>>>> share the test results.
>>>>
>>> I have not yet seen the eMMC device implementing 4KB sector. But MMC
>>> vendors are promising this feature, so I prepared this patch. So far,
>>> I have tested by setting "data_sector_size" to 4KB (doing a hack in
>>> mmc_read_ext_csd), configuring file system to have 4KB block size and
>>> mounting it.
>>
>> Ok. So basically you are emulating the 512B native sector device as 4K
>> native sector device and always read/write this device in 4K granularity. So
>> this is just a proof of concept that setting the block queue logical sector
>> size to 4K works or not?
>> Are vendors promising any performance improvement if we run the device in 4K
>> sector size mode rather than emulation mode?
>>
>> I have few other doubts (from specification point of view) when the device
>> starts running in native sector size mode:
>>
>> 1. According spec, "A large sector device shall not support partial access
>> and shall not support reliable write mode EN_REL_WR=0."
>>        Shouldn't this patch make ensure this?
>>
>> 2.  Some internal sizes reported by the device may change after successfully
>> disabling of the emulation mode.
>>        Shouldn't  we take of this as well?
> This would be because if a single 512byte sector was marked as bad
> (unusable) initially, the entire
> aligned 4K block would be marked as bad now after switching to 4K
> sector size, resulting in a slight capacity shrinkage.
>  This would only matter if the switch happens for a fairly old
> device. Typically, the sector size change should happen during factory
> initialization, so there wouldn't be too many bad blocks, so it
> shouldn't be much of an issue now.
>  Of course, this is just one aspect of a problem for the "dynamic
> device capacity" feature of eMMC4.5, and can be solved if we get to
> that..
>

If 512byte sector becomes bad, then the complete NAND block (much
larger than 4KB) will be marked bad. As such, there should be no
difference in terms of amount of shrinkage. But yes, we need to start
thinking about "dynamic device capacity" once the number of bad NAND
blocks exceeds what eMMC can afford.

>
>>
>> 3. After a successful disabling of the emulation mode, the content of the
>> User Data Area is undefined.
>>        If the contents of the user data area is undefined after disabling
>> the emulation mode, i don't think device will be able to boot to kernel
>> after power cycle. So does this mean we have to flash the kernel/file system
>> images
>>        again? Basically i don't see a use of disabling the emulation mode
>> from kernel. It should be done by basic build/image flashing utility which
>> could flash the images after setting the use_native_sector field and power
>> cycle.
>>
>> 4. Data transfers on the bus are still using 512B CRC-protected blocks, but
>> data shall only be transferred in multiple of 8 such blocks (always
>> multiples of 4KB)
>>        So this means host controller still will be configured in 512B sector
>> mode but amount of data will be in multple of 8 such 512B blocks?
>>
>> 5. Sector addressing is still used, but sector addresses shall always be
>> aligned to 8 (4KB)
>>        How the sector addressing work here? will the sector address (at
>> argument of read/write commands) of byte address 0x1000 be 1 or 8?
>>
>>        512B sector addressing:
>>                (byte address)         (sector address)
>>                0x0000                => 0
>>                0x0200                => 1
>>                0x0400                => 2
>>                0x0600                => 3
>>                0x0800                => 4
>>                0x0A00                => 5
>>                0x0C00                => 6
>>                0x0E00                => 7
>>                0x1000                => 8
>>
>>        4K sector addressing:
>>                (byte address)         (sector address)
>>                0x0000                => 0
>>                0x0200                => NA
>>                0x0400                => NA
>>                0x0600                => NA
>>                0x0800                => NA
>>                0x0A00                => NA
>>                0x0C00                => NA
>>                0x0E00                => NA
>>                0x1000                => 1
>>
>> 6. Arguments for read commands (CMD17/18) and write commands (CMD24/25)
>> shall always be aligned to 8 (4KB)
>>        What will be meaning of the single block read now? Should it be use
>> single 512B block or single 4KB block? If CMD17 and CMD24 now mean that
>> access to 4KB memory area, don't you need to take of the same in MMC
>>        block driver?
>>
>> 7. what should be the block length set by CMD16 (SET_BLOCK_LENGTH) command?
>>        I would guess that in 4KB native sector size mode, this command is
>> redundant and will be ignored by the card but it's no where explicitly
>> mentioned in specification.
>>
>> Regards,
>> Subhash
>>
>>
>>>
>>>> Other than that, this patch looks good to me.
>>>>
>>>> Regards,
>>>> Subhash
>>>>
>>>>> +       else
>>>>> +               blk_queue_logical_block_size(md->queue.queue, 512);
>>>>>        set_capacity(md->disk, size);
>>>>>
>>>>>        if (mmc_host_cmd23(card->host)) {
>>>>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>>>>> index 02914d6..8dcbe995 100644
>>>>> --- a/drivers/mmc/core/mmc.c
>>>>> +++ b/drivers/mmc/core/mmc.c
>>>>> @@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card,
>>>>> u8
>>>>> *ext_csd)
>>>>>                } else {
>>>>>                        card->ext_csd.data_tag_unit_size = 0;
>>>>>                }
>>>>> +       } else {
>>>>> +               card->ext_csd.data_sector_size = 512;
>>>>>        }
>>>>>
>>>>>  out:
>>>>
>>>>
>>> --
>>> 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
>>
>>
>> --
>> 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] 13+ messages in thread

end of thread, other threads:[~2012-05-15 14:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09 14:48 [RFC 1/2] [MMC-4.5] Disable emulation Saugata Das
2012-05-09 14:48 ` [RFC 2/2] [MMC-4.5] [MMC UTIL] " Saugata Das
2012-05-14 10:39   ` Subhash Jadavani
2012-05-14 15:25     ` Saugata Das
2012-05-14 10:50   ` Subhash Jadavani
2012-05-14 15:09     ` Saugata Das
2012-05-14 10:25 ` [RFC 1/2] [MMC-4.5] " Subhash Jadavani
2012-05-14 14:51   ` Saugata Das
2012-05-15  6:40     ` Subhash Jadavani
2012-05-15  9:41       ` Luca Porzio (lporzio)
2012-05-15 10:17       ` S, Venkatraman
2012-05-15 14:55         ` Saugata Das
2012-05-15 14:49       ` Saugata Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox