All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nath, Arindam" <Arindam.Nath@amd.com>
To: Andrei Warkentin <andreiw@motorola.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: "cjb@laptop.org" <cjb@laptop.org>, "arnd@arndb.de" <arnd@arndb.de>
Subject: RE: [patchv3 4/5] MMC: Block CMD23 support for UHS104/SDXC cards.
Date: Sat, 16 Apr 2011 11:19:27 -0500	[thread overview]
Message-ID: <6C03668EAF45B747AF947A1603D1B300EB44438C@SAUSEXMBP01.amd.com> (raw)
In-Reply-To: <1302950458-1969-5-git-send-email-andreiw@motorola.com>

Hi Andrei,


> -----Original Message-----
> From: Andrei Warkentin [mailto:andreiw@motorola.com]
> Sent: Saturday, April 16, 2011 4:11 PM
> To: linux-mmc@vger.kernel.org
> Cc: Nath, Arindam; Andrei Warkentin; cjb@laptop.org; arnd@arndb.de
> Subject: [patchv3 4/5] MMC: Block CMD23 support for UHS104/SDXC cards.
> 
> SD cards operating at UHS104 or better support SET_BLOCK_COUNT.
> 
> Cc: arindam.nath@amd.com
> Cc: cjb@laptop.org
> Cc: arnd@arndb.de
> Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
> ---
>  drivers/mmc/card/block.c |    9 ++++++---
>  drivers/mmc/core/sd.c    |    1 +
>  include/linux/mmc/card.h |    1 +
>  include/linux/mmc/sd.h   |    1 +
>  4 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 4b1a58e..23da6e6 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -851,9 +851,12 @@ static struct mmc_blk_data
> *mmc_blk_alloc_req(struct mmc_card *card,
>  	blk_queue_logical_block_size(md->queue.queue, 512);
>  	set_capacity(md->disk, size);
> 
> -	if (mmc_host_cmd23(card->host) &&
> -	    mmc_card_mmc(card))
> -		md->flags |= MMC_BLK_CMD23;
> +	if (mmc_host_cmd23(card->host)) {
> +		if (mmc_card_mmc(card) ||
> +		    (mmc_card_sd(card) &&
> +		     card->scr.cmds & SCR_CMDS_CMD23))
> +			md->flags |= MMC_BLK_CMD23;
> +	}
> 
>  	if (mmc_card_mmc(card) &&
>  	    md->flags & MMC_BLK_CMD23 &&
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
> index 6dac89f..16a1f10 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -195,6 +195,7 @@ static int mmc_decode_scr(struct mmc_card *card)
>  	else
>  		card->erased_byte = 0x0;
> 
> +	scr->cmds = UNSTUFF_BITS(resp, 32, 2);

Since support for CMD20 and CMD23 have been added in Physical Layer Spec v3.01, IMO it is better to set scr->cmds based on the spec version, rather than doing it unconditionally. Something like,

+       if (scr->sda_vsn == SCR_SPEC_VER_2) {
+               /* Check if Physical Layer Spec v3.0 is supported*/
+               scr->sda_spec3 = UNSTUFF_BITS(resp, 47, 1);
+               if (scr->sda_spec3)
+                       scr->cmds = UNSTUFF_BITS(resp, 32, 2);
+       }

>  	return 0;
>  }
> 
> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index c758181..b33186a 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -70,6 +70,7 @@ struct sd_scr {
>  	unsigned char		bus_widths;
>  #define SD_SCR_BUS_WIDTH_1	(1<<0)
>  #define SD_SCR_BUS_WIDTH_4	(1<<2)
> +	unsigned char		cmds;
>  };

How about...

struct sd_scr {
       unsigned char           sda_vsn;
+       unsigned char           sda_spec3;
       unsigned char           bus_widths;
 #define SD_SCR_BUS_WIDTH_1     (1<<0)
 #define SD_SCR_BUS_WIDTH_4     (1<<2)
+       unsigned char           cmds;
+#define SD_SCR_CMD20_SUPPORT   (1<<0)
+#define SD_SCR_CMD23_SUPPORT   (1<<1)
 };

This way we can let go of...

> diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h
> index 3fd85e0..81ba37b 100644
> --- a/include/linux/mmc/sd.h
> +++ b/include/linux/mmc/sd.h
> +#define SCR_CMDS_CMD23		(1 << 1) /* Supports CMD23 */

Thanks,
Arindam
 



  reply	other threads:[~2011-04-16 16:19 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14  0:38 SET_BLOCK_COUNT-bounded multiblock transfers Andrei Warkentin
2011-04-14  0:03 ` Andrei Warkentin
2011-04-14  9:05   ` Gao, Yunpeng
2011-04-14 22:58     ` Andrei Warkentin
2011-04-14 23:18       ` Chris Ball
2011-04-15  7:10         ` Andrei Warkentin
2011-04-15 17:29           ` Andrei Warkentin
2011-04-14  0:38 ` [RFC 1/3] MMC: use CMD23 for multiblock transfers when we can Andrei Warkentin
2011-04-14  0:38 ` [RFC 2/3] MMC: Implement MMC_CAP_CMD23 for SDHCI Andrei Warkentin
2011-04-14  0:38 ` [RFC 3/3] MMC: Block CMD23 support for UHS104/SDXC cards Andrei Warkentin
2011-04-15 23:51 ` [patchv2 1/3] MMC: Use CMD23 for multiblock transfers when we can Andrei Warkentin
2011-04-15 23:51 ` [patchv2 2/3] MMC: Implement MMC_CAP_CMD23 for SDHCI Andrei Warkentin
2011-04-15 23:51 ` [patchv2 3/3] MMC: Block CMD23 support for UHS104/SDXC cards Andrei Warkentin
2011-04-16 10:40 ` CMD23 plumbing and support patchset Andrei Warkentin
2011-04-21  1:44   ` Chris Ball
2011-04-21  6:29     ` Andrei Warkentin
2011-04-21  6:30       ` Andrei Warkentin
2011-04-22  3:53         ` Andrei Warkentin
2011-04-23  2:51           ` Chris Ball
2011-04-26 23:30             ` Andrei Warkentin
2011-04-27  2:10   ` CMD23 plumbing patchset Andrei Warkentin
2011-04-27  2:10     ` [[v4] 1/5] MMC: Add/remove quirks conditional support Andrei Warkentin
2011-04-27  2:10       ` [[v4] 2/5] MMC: Use CMD23 for multiblock transfers when we can Andrei Warkentin
2011-04-27  2:10         ` [[v4] 3/5] MMC: Implement MMC_CAP_CMD23 for SDHCI Andrei Warkentin
2011-04-27  2:10           ` [[v4] 4/5] MMC: Block CMD23 support for UHS104/SDXC cards Andrei Warkentin
2011-04-27  2:10             ` [[v4] 5/5] MMC: SDHCI AutoCMD23 support Andrei Warkentin
2011-04-27  5:49               ` Nath, Arindam
2011-04-27  5:59                 ` Andrei Warkentin
2011-04-27  6:02                   ` Nath, Arindam
2011-04-27  6:05                     ` Andrei Warkentin
2011-04-28  8:34                       ` Nath, Arindam
2011-04-28 19:09                         ` Andrei Warkentin
2011-04-29  5:34                           ` Nath, Arindam
2011-05-19  2:37         ` [[v4] 2/5] MMC: Use CMD23 for multiblock transfers when we can Jaehoon Chung
2011-05-19 17:01           ` Andrei Warkentin
2011-05-20  4:38             ` Jaehoon Chung
     [not found]               ` <BANLkTik72KgftDWz6aNn=zGDqj1uMpwnYw@mail.gmail.com>
2011-05-20  6:54                 ` Andrei Warkentin
2011-05-20  9:05                   ` Jaehoon Chung
2011-05-23 12:40                   ` Jaehoon Chung
2011-05-23 19:25                     ` Andrei Warkentin
2011-05-23 19:33                       ` Andrei Warkentin
2011-05-23 19:34                     ` Andrei Warkentin
2011-05-23 20:45                       ` Andrei Warkentin
2011-05-24  0:07                       ` Jaehoon Chung
2011-04-29 23:25     ` CMD23 plumbing patchset Andrei Warkentin
2011-05-19 21:46     ` Andrei Warkentin
2011-05-23 20:06       ` Andrei Warkentin
2011-05-25  2:51         ` Chris Ball
2011-05-23 20:06       ` [v6 1/5] MMC: Add/remove quirks conditional support Andrei Warkentin
2011-05-23 20:06       ` [v6 2/5] MMC: Use CMD23 for multiblock transfers when we can Andrei Warkentin
2011-05-23 20:06       ` [v6 3/5] MMC: Implement MMC_CAP_CMD23 for SDHCI Andrei Warkentin
2011-05-23 20:06       ` [v6 4/5] MMC: Block CMD23 support for UHS104/SDXC cards Andrei Warkentin
2011-05-24  6:01         ` Nath, Arindam
2011-05-23 20:06       ` [v6 5/5] MMC: SDHCI AutoCMD23 support Andrei Warkentin
2011-05-24 23:27         ` Chris Ball
2011-05-25  0:37           ` Andrei Warkentin
2011-05-19 21:46     ` [v5 1/5] MMC: Add/remove quirks conditional support Andrei Warkentin
2011-05-19 21:46     ` [v5 2/5] MMC: Use CMD23 for multiblock transfers when we can Andrei Warkentin
2011-05-20 10:29       ` Jaehoon Chung
2011-05-20 18:12         ` Andrei Warkentin
2011-05-19 21:46     ` [v5 3/5] MMC: Implement MMC_CAP_CMD23 for SDHCI Andrei Warkentin
2011-05-19 21:46     ` [v5 4/5] MMC: Block CMD23 support for UHS104/SDXC cards Andrei Warkentin
2011-05-20 10:38       ` Nath, Arindam
2011-05-20 18:09         ` Andrei Warkentin
2011-05-19 21:46     ` [v5 5/5] MMC: SDHCI AutoCMD23 support Andrei Warkentin
2011-05-20 10:46       ` Nath, Arindam
2011-05-20 18:08         ` Andrei Warkentin
2011-04-16 10:40 ` [patchv3 1/5] MMC: Add/remove quirks conditional support Andrei Warkentin
2011-04-16 10:40 ` [patchv3 2/5] MMC: Use CMD23 for multiblock transfers when we can Andrei Warkentin
2011-04-17 17:23   ` Arnd Bergmann
2011-04-17 19:27     ` Andrei Warkentin
2011-04-19  3:44     ` Andrei Warkentin
2011-04-19  7:39       ` Arnd Bergmann
2011-04-19 15:18         ` Andrei Warkentin
2011-04-16 10:40 ` [patchv3 3/5] MMC: Implement MMC_CAP_CMD23 for SDHCI Andrei Warkentin
2011-04-16 10:40 ` [patchv3 4/5] MMC: Block CMD23 support for UHS104/SDXC cards Andrei Warkentin
2011-04-16 16:19   ` Nath, Arindam [this message]
2011-04-16 23:00     ` Andrei Warkentin
2011-04-16 23:38   ` [PATCH] " Andrei Warkentin
2011-04-16 10:40 ` [patchv3 5/5] MMC: SDHCI AutoCMD23 support Andrei Warkentin
2011-04-17 17:25   ` Arnd Bergmann
2011-04-17 19:31     ` Andrei Warkentin
2011-04-19  3:05       ` Andrei Warkentin
2011-04-19  3:19         ` Nath, Arindam
2011-04-19  3:32           ` Andrei Warkentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6C03668EAF45B747AF947A1603D1B300EB44438C@SAUSEXMBP01.amd.com \
    --to=arindam.nath@amd.com \
    --cc=andreiw@motorola.com \
    --cc=arnd@arndb.de \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.