public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Subhash Jadavani <subhashj@codeaurora.org>
Cc: linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org, "Nath,
	Arindam" <Arindam.Nath@amd.com>
Subject: Re: [PATCH v1 1/1] mmc: sd: Handle SD3.0 cards not supporting UHS-I bus speed mode
Date: Thu, 11 Aug 2011 17:33:04 -0400	[thread overview]
Message-ID: <m2k4ajpran.fsf@bob.laptop.org> (raw)
In-Reply-To: <1312955161-24844-1-git-send-email-subhashj@codeaurora.org> (Subhash Jadavani's message of "Wed, 10 Aug 2011 11:16:01 +0530")

Hi Subhash, Arindam,

On Wed, Aug 10 2011, Subhash Jadavani wrote:
> Here is Essential conditions to indicate Version 3.00 Card
> (SD_SPEC=2 and SD_SPEC3=1) :
> (1) The card shall support CMD6
> (2) The card shall support CMD8
> (3) The card shall support CMD42
> (4) User area capacity shall be up to 2GB (SDSC) or 32GB (SDHC)
>     User area capacity shall be more than or equal to 32GB and
>     up to 2TB (SDXC)
> (5) Speed Class shall be supported (SDHC or SDXC)
>
> So even if SD card doesn't support any of the newly defined
> UHS-I bus speed mode, it can advertise itself as SD3.0 cards
> as long as it supports all the essential conditions of
> SD3.0 cards. Given this, these type of cards should atleast
> run in High Speed mode @50MHZ if it supports HS.
>
> But current initialization sequence for SD3.0 cards is
> such that these non-UHS-I SD3.0 cards runs in Default
> Speed mode @25MHz.
>
> This patch makes sure that these non-UHS-I SD3.0 cards run
> in High Speed Mode @50MHz.
>
> Tested this patch with SanDisk Extreme SDHC 8GB Class 10 card.
>
> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
> ---
>  drivers/mmc/core/sd.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
> index ff27741..e2dcf23 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -306,6 +306,9 @@ static int mmc_read_switch(struct mmc_card *card)
>  		goto out;
>  	}
>  
> +	if (status[13] & 0x02)
> +		card->sw_caps.hs_max_dtr = 50000000;
> +
>  	if (card->scr.sda_spec3) {
>  		card->sw_caps.sd3_bus_mode = status[13];
>  
> @@ -348,9 +351,6 @@ static int mmc_read_switch(struct mmc_card *card)
>  		}
>  
>  		card->sw_caps.sd3_curr_limit = status[7];
> -	} else {
> -		if (status[13] & 0x02)
> -			card->sw_caps.hs_max_dtr = 50000000;
>  	}
>  
>  out:

The patch itself is fine, but please could one of you add some #defines
for the status response bit names and their possible values inside
mmc_read_switch()?  It's looking a bit opaque.

(I know that this patch doesn't introduce any of these magic numbers;
I just think that now is a good time to add documentation for them.)

Thanks very much,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  parent reply	other threads:[~2011-08-11 21:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-10  5:46 [PATCH v1 1/1] mmc: sd: Handle SD3.0 cards not supporting UHS-I bus speed mode Subhash Jadavani
     [not found] ` <000001cc5756$e04dc9a0$a0e95ce0$@org>
2011-08-10 12:19   ` Nath, Arindam
2011-08-11 21:33 ` Chris Ball [this message]
2011-08-12  7:26   ` Nath, Arindam
2011-08-22  9:44   ` Subhash Jadavani
2011-08-22 13:20     ` Chris Ball

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=m2k4ajpran.fsf@bob.laptop.org \
    --to=cjb@laptop.org \
    --cc=Arindam.Nath@amd.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=subhashj@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox