kernel-aes67/drivers/edac
Serge Semin 591c946675 EDAC/synopsys: Fix ECC status and IRQ control race condition
The race condition around the ECCCLR register access happens in the IRQ
disable method called in the device remove() procedure and in the ECC IRQ
handler:

  1. Enable IRQ:
     a. ECCCLR = EN_CE | EN_UE
  2. Disable IRQ:
     a. ECCCLR = 0
  3. IRQ handler:
     a. ECCCLR = CLR_CE | CLR_CE_CNT | CLR_CE | CLR_CE_CNT
     b. ECCCLR = 0
     c. ECCCLR = EN_CE | EN_UE

So if the IRQ disabling procedure is called concurrently with the IRQ
handler method the IRQ might be actually left enabled due to the
statement 3c.

The root cause of the problem is that ECCCLR register (which since
v3.10a has been called as ECCCTL) has intermixed ECC status data clear
flags and the IRQ enable/disable flags. Thus the IRQ disabling (clear EN
flags) and handling (write 1 to clear ECC status data) procedures must
be serialised around the ECCCTL register modification to prevent the
race.

So fix the problem described above by adding the spin-lock around the
ECCCLR modifications and preventing the IRQ-handler from modifying the
IRQs enable flags (there is no point in disabling the IRQ and then
re-enabling it again within a single IRQ handler call, see the
statements 3a/3b and 3c above).

Fixes: f7824ded41 ("EDAC/synopsys: Add support for version 3 of the Synopsys EDAC DDR")
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240222181324.28242-2-fancer.lancer@gmail.com
2024-05-06 14:19:07 +02:00
..
Kconfig EDAC/amd64: Use new AMD Address Translation Library 2024-01-24 12:55:00 +01:00
Makefile EDAC/versal: Add a Xilinx Versal memory controller driver 2023-10-23 19:41:27 +02:00
al_mc_edac.c
altera_edac.c EDAC/altera: Convert to platform remove callback returning void 2023-11-20 19:43:18 +01:00
altera_edac.h
amd64_edac.c - Add a FRU (Field Replaceable Unit) memory poison manager which 2024-03-11 18:14:06 -07:00
amd64_edac.h EDAC/amd64: Add support for family 0x19, models 0x90-9f devices 2023-11-29 11:21:05 +01:00
amd76x_edac.c
amd8111_edac.c EDAC/amd81[13]1: Remove trailing newline from MODULE_AUTHOR 2023-03-28 15:26:52 +02:00
amd8111_edac.h
amd8131_edac.c EDAC/amd81[13]1: Remove trailing newline from MODULE_AUTHOR 2023-03-28 15:26:52 +02:00
amd8131_edac.h
armada_xp_edac.c EDAC/armada_xp: Explicitly include correct DT includes 2023-11-27 18:20:51 +01:00
aspeed_edac.c EDAC/aspeed: Convert to platform remove callback returning void 2023-11-20 21:26:01 +01:00
bluefield_edac.c EDAC/bluefield: Convert to platform remove callback returning void 2023-11-20 21:28:08 +01:00
cell_edac.c EDAC/cell: Convert to platform remove callback returning void 2023-11-20 21:39:13 +01:00
cpc925_edac.c EDAC/cpc925: Convert to platform remove callback returning void 2023-11-20 21:56:49 +01:00
debugfs.c
dmc520_edac.c EDAC/dmc520: Convert to platform remove callback returning void 2023-11-20 22:01:16 +01:00
e7xxx_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
e752x_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
edac_device.c
edac_device.h EDAC: constantify the struct bus_type usage 2024-01-04 14:34:27 +01:00
edac_device_sysfs.c EDAC: constantify the struct bus_type usage 2024-01-04 14:34:27 +01:00
edac_mc.c EDAC/mc: Add support for HBM3 memory type 2023-11-28 16:39:12 +01:00
edac_mc.h
edac_mc_sysfs.c EDAC/mc_sysfs: Replace deprecated strncpy() with memcpy() 2023-09-29 14:48:32 -07:00
edac_module.c EDAC: constantify the struct bus_type usage 2024-01-04 14:34:27 +01:00
edac_module.h
edac_pci.c
edac_pci.h
edac_pci_sysfs.c Driver core changes for 6.8-rc1 2024-01-18 09:48:40 -08:00
fsl_ddr_edac.c EDAC/fsl_ddr: Convert to platform remove callback returning void 2023-11-20 23:34:04 +01:00
fsl_ddr_edac.h EDAC/fsl_ddr: Convert to platform remove callback returning void 2023-11-20 23:34:04 +01:00
ghes_edac.c
highbank_l2_edac.c EDAC/highbank_l2: Convert to platform remove callback returning void 2023-11-20 22:33:22 +01:00
highbank_mc_edac.c EDAC/highbank_mc: Convert to platform remove callback returning void 2023-11-20 22:33:52 +01:00
i7core_edac.c EDAC/{sb,i7core}_edac: Do not use a plain integer for a NULL pointer 2023-11-28 15:43:43 +01:00
i10nm_base.c EDAC/i10nm: Add Intel Grand Ridge micro-server support 2024-02-01 12:36:50 -08:00
i3000_edac.c
i3200_edac.c
i5000_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
i5100_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
i5400_edac.c
i7300_edac.c
i82443bxgx_edac.c
i82860_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
i82875p_edac.c
i82975x_edac.c
ie31200_edac.c
igen6_edac.c EDAC/igen6: Add one more Intel Alder Lake-N SoC support 2024-02-01 12:36:50 -08:00
layerscape_edac.c EDAC/fsl_ddr: Convert to platform remove callback returning void 2023-11-20 23:34:04 +01:00
mce_amd.c x86/cpu/amd: Provide a separate accessor for Node ID 2024-02-15 22:07:37 +01:00
mce_amd.h
mpc85xx_edac.c EDAC/fsl_ddr: Convert to platform remove callback returning void 2023-11-20 23:34:04 +01:00
mpc85xx_edac.h
npcm_edac.c EDAC/npcm: Convert to platform remove callback returning void 2023-11-20 22:52:14 +01:00
octeon_edac-l2c.c EDAC/octeon-l2c: Convert to platform remove callback returning void 2023-11-20 23:09:07 +01:00
octeon_edac-lmc.c EDAC/octeon-lmc: Convert to platform remove callback returning void 2023-11-20 23:09:49 +01:00
octeon_edac-pc.c EDAC/octeon-pc: Convert to platform remove callback returning void 2023-11-20 23:10:37 +01:00
octeon_edac-pci.c EDAC/octeon-pci: Convert to platform remove callback returning void 2023-11-20 23:11:21 +01:00
pasemi_edac.c
pnd2_edac.c EDAC, pnd2: Sort headers alphabetically 2023-12-05 13:04:57 -08:00
pnd2_edac.h
ppc4xx_edac.c EDAC/ppc4xx: Convert to platform remove callback returning void 2023-11-20 23:24:46 +01:00
ppc4xx_edac.h
qcom_edac.c EDAC/qcom: Convert to platform remove callback returning void 2023-11-20 23:28:17 +01:00
r82600_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
sb_edac.c EDAC/{sb,i7core}_edac: Do not use a plain integer for a NULL pointer 2023-11-28 15:43:43 +01:00
sifive_edac.c
skx_base.c EDAC/skx: Fix overflows on the DRAM row address mapping arrays 2023-03-13 10:42:00 -07:00
skx_common.c EDAC/skx_common: Filter out the invalid address 2024-01-02 09:20:08 -08:00
skx_common.h EDAC/i10nm: Add Intel Granite Rapids server support 2023-01-25 08:17:30 -08:00
synopsys_edac.c EDAC/synopsys: Fix ECC status and IRQ control race condition 2024-05-06 14:19:07 +02:00
thunderx_edac.c EDAC/thunderx: Fix possible out-of-bounds string access 2023-11-23 17:44:09 +01:00
ti_edac.c EDAC/ti: Convert to platform remove callback returning void 2023-11-20 23:30:09 +01:00
versal_edac.c EDAC/versal: Do not log total error counts 2024-04-25 18:08:05 +02:00
wq.c
x38_edac.c
xgene_edac.c EDAC/xgene: Convert to platform remove callback returning void 2023-11-20 23:31:44 +01:00
zynqmp_edac.c EDAC/zynqmp: Convert to platform remove callback returning void 2023-11-20 23:33:21 +01:00