David Thompson(deleted)
|
ETFS 2048: hack workaround for read errors in spare area
|
David Thompson(deleted)
03/04/2009 2:57 PM
post23527
|
ETFS 2048: hack workaround for read errors in spare area
Quality Engineering at STMicro and new data sheets from Numonyx require that the spare area be protected from read
errors with ECC. Read errors are defined as when after some period of time a bit can change from program, 0, to un-
program state, 1. This new requirement was probably not anticipated by the ETFS design.
Recall, the data portion of the page already has ECC to prevent this error condition.
The following code snippet from devio.c devio_readcluster() will prevent a DATAERR from occurring in the case of a
single bit releasing from a 0 to a 1 in the spare area:
trp->tacode = ETFS_TRANS_ERASED;
else
trp->tacode = ETFS_TRANS_FOXES;
# hack >>>>
else if(dev->crc32((uint8_t *) sp, sizeof(*sp) - sizeof(sp->crctrans)) != sp->crctrans) {
// try brute force contingency of walking a 0 through
// since failure mode is a single bit releasing from
// 0 to 1
int i,j;
uint32_t mask;
uint32_t *ptr32 = (uint32_t*) sp;
//iterate through spare area 32bits at a time
for( j=0 ; j < sizeof(struct spare)/sizeof(uint32_t) ; j++, ptr32++ ){
for( i=0 ; i<8*sizeof(uint32_t) ; i++ ){
mask = 1 << i;
//only need to try making 1's a 0
if( ( *ptr32 & mask) == mask ){
*ptr32 = *ptr32 & ~mask;
//retry crc of spare
if(dev->crc32((uint8_t *) sp, sizeof(*sp) - sizeof(sp->crctrans)) == sp->crctrans) {
// error in spare found
dev->log(_SLOG_ERROR, "readcluster trans DATAERR FORCED CORRECTION on cluster %d", cluster);
trp->tacode = ETFS_TRANS_OK;
goto spare_area_2048_corrected;
}
else{
//this wasn't the bit in error so undo the change
*ptr32 = *ptr32 | mask;
}
}
}
}
// falling through means we were not able to correct the problem
dev->log(_SLOG_ERROR, "readcluster trans DATAERR on cluster %d", cluster);
trp->tacode = ETFS_TRANS_DATAERR;
} else
trp->tacode = ETFS_TRANS_OK;
spare_area_2048_corrected:
# hack <<<<
// Build transaction data from data in the spare area.
|
|
|