public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus-list@drzeus.cx>
To: philipl@overt.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.18 2/2] mmc: Read mmc v4 EXT_CSD
Date: Tue, 03 Oct 2006 19:50:21 +0200	[thread overview]
Message-ID: <4522A2DD.9080803@drzeus.cx> (raw)
In-Reply-To: <15151.67.169.45.37.1159744878.squirrel@overt.org>

philipl@overt.org wrote:
> +	list_for_each_entry(card, &host->cards, node) {
> +		if (card->state & (MMC_STATE_DEAD|MMC_STATE_PRESENT))
> +			continue;
>   

Please use the macros.

> +		if (card->csd.mmca_vsn < CSD_SPEC_VER_4)
> +			continue;
> +
>   

You need to check that the card isn't SD before you can look at that
part of the csd structure. BUG_ON or similar is acceptable if you
consider it an error to call this function if SD cards are present.

> +		err = mmc_select_card(host, card);
> +		if (err != MMC_ERR_NONE) {
> +			mmc_card_set_dead(card);
> +			continue;
> +		}
> +
> +		memset(&cmd, 0, sizeof(struct mmc_command));
> +
> +		cmd.opcode = MMC_SEND_EXT_CSD;
> +		cmd.arg = 0;
> +		cmd.flags = MMC_RSP_R1;
> +
> +		memset(&data, 0, sizeof(struct mmc_data));
> +
> +		data.timeout_ns = card->csd.tacc_ns * 10;
> +		data.timeout_clks = card->csd.tacc_clks * 10;
>   

We have a new function for setting timeouts that you should use called
mmc_set_data_timeout().

Rgds
Pierre


  reply	other threads:[~2006-10-03 17:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-01 23:21 [PATCH 2.6.18 2/2] mmc: Read mmc v4 EXT_CSD philipl
2006-10-03 17:50 ` Pierre Ossman [this message]
2006-10-04  2:57   ` Philip Langdale
2006-10-05 15:56     ` Pierre Ossman
  -- strict thread matches above, loose matches on Subject: below --
2006-10-06  8:53 Frantisek Dufka

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=4522A2DD.9080803@drzeus.cx \
    --to=drzeus-list@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipl@overt.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