Re: [PATCHv7] EDAC, altera: Add Altera L2 Cache and OCRAM EDAC Support

From: Thor Thayer
Date: Mon Jan 04 2016 - 21:10:32 EST




On 01/04/2016 04:01 PM, Borislav Petkov wrote:
On Mon, Jan 04, 2016 at 03:33:23PM -0600, Thor Thayer wrote:
The decision about ECC or non-ECC SDRAM is made before building the Linux
image and must be matched to the appropriate bootloader (ECC or non-ECC).

If ECC is desired for SDRAM, the bootloader enables SDRAM ECC and then
initializes the memory contents (scrub) before the Linux image is loaded
into SDRAM.

The ECC syndromes are calculated and stored in SDRAM only when SDRAM ECC is
enabled and the SDRAM data is written (in the bootloader case, this is the
Linux image). If we suddenly switched ECC on during Linux initialization,
we'd be flooded with ECC errors since the ECC syndromes won't match the data
for the Linux image.

The scrubbing process takes more time to boot which some of our customers
don't want. This is what Dinh was referring to.

So that still doesn't have any effect on what's compiled in the EDAC
module, AFAICT. You simply build everything in and depending on
whether ECC is enabled or not in the bootloader, altera_edac behaves
accordingly. On a system with ECC *not* enabled, it would simply have
the SDRAM ECC functionality inactive.

This is no different than an x86 system where you enter the BIOS and
enable or disable ECC. The EDAC module queries whether ECC has been
enabled or not and behaves accordingly.

OK. I see your point for SDRAM.

However, in the case of OCRAM and L2 cache ECC, we want to be able to enable them individually which is what the following does.

>> -obj-$(CONFIG_EDAC_ALTERA_MC) += altera_edac.o
>> +altr_edac-y := altera_edac.o
>> +obj-$(CONFIG_EDAC_ALTERA_MC) += altr_edac.o
>> +obj-$(CONFIG_EDAC_ALTERA_L2C) += altr_edac.o
>> +obj-$(CONFIG_EDAC_ALTERA_OCRAM) += altr_edac.o
>
> What are those supposed to accomplish?
>

and then the defines are also used to conditionally include the L2 or OCRAM ECC functions because everything is in one file.

However, the highbank and octeon edacs are split into separate files for L2 which Dinh pointed may be cleaner for individual control.

Thanks,

Thor
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/