Re: [PATCH v2] mmc: lower init clock frequency to 300kHz

From: Hein_Tibosch
Date: Wed Jan 06 2010 - 04:11:40 EST


On 6-1-2010 15:01, Pavel Machek wrote:
> Machine with minimum clock of 1MHz is clearly broken, yet you issue
> "soft" warning.
>
> What about:
>
> if (f_min > 400k)
> print existing warning
> else if (f_min > 300k)
> print warning 'if your card does not work, its broken, but
> your host is unhelpful'
> clock = f_min
> if (clock < 3o0)
> clock = 300
>
> ?
>
Later in this thread I mentioned that initialization at 300 Khz is
too fast for some platforms/cards (avr32 AP7000/main-stream cards).
They will report CRC-errors so the above won't work.

I have looked at the time it will take to exchange the initial data (about
85 bytes), using different busses and frequencies:

Intface: 8-bits 4-bits SPI
Bus-freq:
400000 (Hz) 0.213 0.425 1.700 (ms)
300000 0.283 0.567 2.267
200000 0.425 0.850 3.400
100000 0.850 1.700 6.800
50000 1.700 3.400 13.600
100 850 1700 6800

These are netto times, without the msleep's for power-up and without
overhead.

Looking at this table, I would use a fixed bottom of 100 Khz:

if (f_min > 400k)
print existing warning
clock = max (100k, host->f_min);

Regards, Hein







--
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/