Re: [PATCH 01/12] mmc: sdhci: add support for auto CMD23

Nicolas Pitre
2011-02-15T20:58:39Z

On Tue, 15 Feb 2011, Arindam Nath wrote:

> Host Controller v3.00 and later support Auto CMD23 in the Transfer
> Mode register. Since Auto CMD23 can be used with or without DMA,
> and if used with DMA, it should _only_ be ADMA, we check against
> SDHCI_USE_SDMA not being set. This flag is reset when SDHCI_USE_ADMA
> is set.
>
> A new definition for SDHCI_ARGUMENT2 register has been added
> in v3.00 spec, which is the same as SDHCI_DMA_ADDRESS. We program the
> block count for CMD23 in SDHCI_ARGUMENT2, so we don't need CMD12 to
> stop multiple block transfers. But during error recovery procedure,
> we will need to send Abort command, so we use a global variable
> abort_cmd to save the stop command to be used later.

This is wrong. Don't use global variables for such things. Imagine
what might happen if you have more than one sdhci controller in a
system. This is a per instance issue certainly not a global driver
issue.

Nicolas