Q: mmc au size

From: H Hartley Sweeten
Date: Fri Jun 28 2013 - 19:34:41 EST


Hello Chris,

I have a question concerning the "au" size of a SD Card.

I have an old Kingston 64MB SD-Card and lately I have noticed this
kernel message when I use the card:

mmc0: SD Status: Invalid Allocation Unit size.

This is due to the following commit:

commit b63b5e819d5b21ae493c17c356018ffa98d3ee1c
Author: Alan Cox <alan@xxxxxxxxxxxxxxx>
Date: Mon Jul 2 18:55:13 2012 +0100

mmc: core: correct invalid error checking


>From the "SD Specifications, Part 1, Physical Layer Specification",

* AU_SIZE
This 4-bit field indicates AU Size and the value can be selected from
16 KB.

AU_SIZE Value Definition
------- ----------------
0h Not Defined
1h 16 KB
2h 32 KB
3h 64 KB
4h 128 KB
5h 256 KB
6h 512 KB
7h 1 MB
8h 2 MB
9h 4 MB
Ah 8 MB
Bh 12 MB
Ch 16 MB
Dh 24 MB
Eh 32 MB
Fh 64 MB

Also in the specification is this note:

Sector: is the unit that is related to the erase commands. Its size
is the number of blocks that will be erased in one portion. The size
of a sector is fixed for each device. The information about the sector
size (in blocks) is stored in the CSD. Note that if the card specifies
AU size, sector size should be ignored.

And this:

* SECTOR_SIZE
This field is fixed to 7Fh, which indicates 64 KBytes. This value does
not relate to erase operations. High Capacity and Extended Capacity
cards indicate memory boundary by AU size and this field should not
be used.


So, if an au size of 0 is reported wouldn't the erase size be the
sector size? If nothing else I think the test needs to be adjusted to
not report the error for an au size of 0.

Regards,
Hartley
--
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/