Skip to content

Commit 081bc61

Browse files
committed
Merge tag 'edac_urgent_for_v6.15_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull EDAC fixes from Borislav Petkov: - Test the correct structure member when handling correctable errors and avoid spurious interrupts, in altera_edac * tag 'edac_urgent_for_v6.15_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/altera: Set DDR and SDMMC interrupt mask before registration EDAC/altera: Test the correct error reg offset
2 parents 3d84c97 + 6dbe3c5 commit 081bc61

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/edac/altera_edac.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static irqreturn_t altr_sdram_mc_err_handler(int irq, void *dev_id)
9999
if (status & priv->ecc_stat_ce_mask) {
100100
regmap_read(drvdata->mc_vbase, priv->ecc_saddr_offset,
101101
&err_addr);
102-
if (priv->ecc_uecnt_offset)
102+
if (priv->ecc_cecnt_offset)
103103
regmap_read(drvdata->mc_vbase, priv->ecc_cecnt_offset,
104104
&err_count);
105105
edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, err_count,
@@ -1005,9 +1005,6 @@ altr_init_a10_ecc_block(struct device_node *np, u32 irq_mask,
10051005
}
10061006
}
10071007

1008-
/* Interrupt mode set to every SBERR */
1009-
regmap_write(ecc_mgr_map, ALTR_A10_ECC_INTMODE_OFST,
1010-
ALTR_A10_ECC_INTMODE);
10111008
/* Enable ECC */
10121009
ecc_set_bits(ecc_ctrl_en_mask, (ecc_block_base +
10131010
ALTR_A10_ECC_CTRL_OFST));
@@ -2127,6 +2124,10 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
21272124
return PTR_ERR(edac->ecc_mgr_map);
21282125
}
21292126

2127+
/* Set irq mask for DDR SBE to avoid any pending irq before registration */
2128+
regmap_write(edac->ecc_mgr_map, A10_SYSMGR_ECC_INTMASK_SET_OFST,
2129+
(A10_SYSMGR_ECC_INTMASK_SDMMCB | A10_SYSMGR_ECC_INTMASK_DDR0));
2130+
21302131
edac->irq_chip.name = pdev->dev.of_node->name;
21312132
edac->irq_chip.irq_mask = a10_eccmgr_irq_mask;
21322133
edac->irq_chip.irq_unmask = a10_eccmgr_irq_unmask;

drivers/edac/altera_edac.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ struct altr_sdram_mc_data {
249249
#define A10_SYSMGR_ECC_INTMASK_SET_OFST 0x94
250250
#define A10_SYSMGR_ECC_INTMASK_CLR_OFST 0x98
251251
#define A10_SYSMGR_ECC_INTMASK_OCRAM BIT(1)
252+
#define A10_SYSMGR_ECC_INTMASK_SDMMCB BIT(16)
253+
#define A10_SYSMGR_ECC_INTMASK_DDR0 BIT(17)
252254

253255
#define A10_SYSMGR_ECC_INTSTAT_SERR_OFST 0x9C
254256
#define A10_SYSMGR_ECC_INTSTAT_DERR_OFST 0xA0

0 commit comments

Comments
 (0)