[LEDE-DEV] MMAP memory out of sync on AR71xx Rambutan (8devices) board.

Kevin Darbyshire-Bryant kevin at darbyshire-bryant.me.uk
Tue May 8 13:33:57 PDT 2018



> On 8 May 2018, at 21:11, Rosen Penev <rosenp at gmail.com> wrote:
> 
>> 
>> So out of curiosity I built this for my Archer C7 v2 ar71xx device.  I also modified the code to not give up on ‘OK’, so it always iterated 10 times.  I then ran this repeatedly using ‘watch’.  Observations:
>> 
>> 1) Failure only occurred on 1st check, it never appeared/re-appeared on subsequent passes.
>> 2) Failure offsets are always at 32 byte intervals.  That corresponds nicely with cache-line size.
> Yeah the L1
>> 
>> Grabbing at straws to some extent.

So I modified the user space code a little more, namely moving the usleep to before the check (obviously still after the mmap) - I am yet to see an error.

 printf("mmap addr: %p\n", addr);
        data = addr;

        for (i = 0; i < 10; i++) {
                usleep(500000);
                check_data(data, page_size);
        }

So that smells more of a race condition between the writer filling with 0xFF and the reader catching up.

Again, assume that I am an idiot and am missing something fundamental.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180508/3131900c/attachment.sig>


More information about the Lede-dev mailing list