[PATCH] Move the flash size probe into bankValidate() - averts potential fatal exception

Nick Withers nick.withers at anu.edu.au
Thu Jan 30 02:15:13 UTC 2014


Hi all,

The attached patch "flash_probe.patch" moves the invocation of a flash
device size probe[1] in the powerpc flash driver framework from
argcheck() to bankValidate(). Previously, the latter was called by the
former before the probe had happened and bankValidate()s subsequent call
of BSP_flashCheckId() caused it to access memory that is potentially
unmapped.

On my MVME3100, this previous behaviour caused a machine check
exception.

[1] In my ever-humble opinion, this whole probe business is a bad idea
from the get-go... The attached diff "flash_don't_probe.patch" - which
I'm not suggesting be committed, but *is* what I'm using - reworks it on
the MVME3100 so that the board's configuration is read from the "Vital
Product Data" EEPROM, giving the flash address and size. I've had
trouble with the VPD routines, however (and haven't fully debugged
that)... The attached "vpd.patch" seems to have sorted that or me in the
interim. I'd be interested in hearing others' thoughts on this :-)
-- 
Nick Withers

Embedded Systems Programmer
Department of Nuclear Physics, Research School of Physics and Engineering
The Australian National University (CRICOS: 00120C)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flash_don't_probe.patch
Type: text/x-patch
Size: 2377 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140130/0a9a3221/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flash_probe.patch
Type: text/x-patch
Size: 1628 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140130/0a9a3221/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vpd.patch
Type: text/x-patch
Size: 536 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140130/0a9a3221/attachment-0002.bin>


More information about the devel mailing list