[SLOF] [PATCH] pci-scan: Fix pci-bridge-set-mem-base and pci-bridge-set-mem-limit

Thomas Huth thuth at redhat.com
Thu Jul 20 18:58:43 AEST 2017

On 20.07.2017 08:18, Alexey Kardashevskiy wrote:
> On 19/07/17 01:30, Thomas Huth wrote:
>> The functions used a bogus mixture between programming the registers
>> with pci-next-mem64 and pci-next-mem - the upper register bits were
>> filled with the value from the 64-bit memory space while the lower
>> bits were filled with the bits from the 32-bit memory space variable.
> It is a total rework of two pretty old pieces of code with fewer comments
> than before (and no new stack comments or smaller words...) and no clear
> indication of whether it changes the actual behaviour, or does not it?

Just have a closer look at https://github.com/aik/SLOF/commit/9633e036
and you'll note what's wrong with the code: Initially, all PCI bridge
prefetchable memory base registers were programmed with the value from
pci-next-mem and the limit registers with the value from pci-max-mem.

After that patch, the upper bits were programmed with pci-next-mem64 and
pci-max-mem64, while the lower bits were still programmed with
pci-next-mem and pci-max-mem! A complete mess, I wonder why this did not
cause any trouble before (well, likely because hardly anybody tested PCI
bridges before)...

I think we really should clean that up ... so would you be willing to
accept my patch if I add some more comments to the code there?


More information about the SLOF mailing list