]> git.baikalelectronics.ru Git - uboot.git/commit
Merge tag 'arc-last-minute-fixes-for-2020.04' of https://gitlab.denx.de/u-boot/custod...
authorTom Rini <trini@konsulko.com>
Tue, 31 Mar 2020 19:10:54 +0000 (15:10 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 31 Mar 2020 19:10:54 +0000 (15:10 -0400)
commit838f24274593f042491c9d3306525aeda814c76a
tree0bbd9cb387f5fa4bbb0c5f1476bde01bd03604c6
parent3482e494da98827d67fa24db77e9d28ad363d534
parent0e3f8aa5b10ea6659ecde41e58fda3458b726789
Merge tag 'arc-last-minute-fixes-for-2020.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-arc

This last minute pull-request is intended to fix some drivers
when used on ARC boards. The problem was introduced by
https://gitlab.denx.de/u-boot/u-boot/-/commit/8f05295266ad3a252f47c69577a83b7e2e334626

What happened while doing one pretty simple improvement to make
U-Boot port more flexible and portable (by switching accessors from
assembly-written to plain C version) we implicitly added 2 problems:

 1. Downgraded accessors from being volatile which signalled to
    the compiler that it's now possible to do all kinds of optimizations
    which may easily include merge of subsequent byte reads/writes into
    word operations. Which is OK for accessing mormal memory but
    breaks operation of peripherals if we access its memory-mapped regs
    in such a "creative" manner.
 2. As a part of assembly-written implementation we had compiler barriers
    in form of the following construction 'asm volatile("" : : : "memory")',
    and we dropped it in C implemntation. This in its turn enabled compiler
    to mess with instruction ordering. Guess what it gives us in the end :)

So with all that we had in some corner-cases veeery funny instruction flows
generated. And in particular it broke DW SPI functionality when we were
writing large amount of data. Funny enough our tests which were writing
small amount of data still worked and only by the chance we caught that
breakage and unrolled that quite interesting loop of unexpected
problems.

The road to hell is paved with good intentions. Amen :)