Re: [PATCH 2.6.18 2/2] mmc: Read mmc v4 EXT_CSD

From: Pierre Ossman
Date: Tue Oct 03 2006 - 13:50:48 EST


philipl@xxxxxxxxx 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/