Skip to content

Commit cd2715b

Browse files
committed
Merge tag 'edac_urgent_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull EDAC fixes from Borislav Petkov: - Relax the condition under which the DIMM label in ghes_edac is set in order to accomodate an HPE BIOS which sets only the device but not the bank - Two forgotten fixes to synopsys_edac when handling error interrupts * tag 'edac_urgent_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/ghes: Set the DIMM label unconditionally EDAC/synopsys: Re-enable the error interrupts on v3 hw EDAC/synopsys: Use the correct register to disable the error interrupt on v3 hw
2 parents 6a01025 + 5e2805d commit cd2715b

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

drivers/edac/ghes_edac.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,14 @@ static void dimm_setup_label(struct dimm_info *dimm, u16 handle)
103103

104104
dmi_memdev_name(handle, &bank, &device);
105105

106-
/* both strings must be non-zero */
107-
if (bank && *bank && device && *device)
108-
snprintf(dimm->label, sizeof(dimm->label), "%s %s", bank, device);
106+
/*
107+
* Set to a NULL string when both bank and device are zero. In this case,
108+
* the label assigned by default will be preserved.
109+
*/
110+
snprintf(dimm->label, sizeof(dimm->label), "%s%s%s",
111+
(bank && *bank) ? bank : "",
112+
(bank && *bank && device && *device) ? " " : "",
113+
(device && *device) ? device : "");
109114
}
110115

111116
static void assign_dmi_dimm_info(struct dimm_info *dimm, struct memdev_dmi_entry *entry)

drivers/edac/synopsys_edac.c

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,28 @@ static void handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p)
514514
memset(p, 0, sizeof(*p));
515515
}
516516

517+
static void enable_intr(struct synps_edac_priv *priv)
518+
{
519+
/* Enable UE/CE Interrupts */
520+
if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR)
521+
writel(DDR_UE_MASK | DDR_CE_MASK,
522+
priv->baseaddr + ECC_CLR_OFST);
523+
else
524+
writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK,
525+
priv->baseaddr + DDR_QOS_IRQ_EN_OFST);
526+
527+
}
528+
529+
static void disable_intr(struct synps_edac_priv *priv)
530+
{
531+
/* Disable UE/CE Interrupts */
532+
if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR)
533+
writel(0x0, priv->baseaddr + ECC_CLR_OFST);
534+
else
535+
writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK,
536+
priv->baseaddr + DDR_QOS_IRQ_DB_OFST);
537+
}
538+
517539
/**
518540
* intr_handler - Interrupt Handler for ECC interrupts.
519541
* @irq: IRQ number.
@@ -555,6 +577,9 @@ static irqreturn_t intr_handler(int irq, void *dev_id)
555577
/* v3.0 of the controller does not have this register */
556578
if (!(priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR))
557579
writel(regval, priv->baseaddr + DDR_QOS_IRQ_STAT_OFST);
580+
else
581+
enable_intr(priv);
582+
558583
return IRQ_HANDLED;
559584
}
560585

@@ -837,25 +862,6 @@ static void mc_init(struct mem_ctl_info *mci, struct platform_device *pdev)
837862
init_csrows(mci);
838863
}
839864

840-
static void enable_intr(struct synps_edac_priv *priv)
841-
{
842-
/* Enable UE/CE Interrupts */
843-
if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR)
844-
writel(DDR_UE_MASK | DDR_CE_MASK,
845-
priv->baseaddr + ECC_CLR_OFST);
846-
else
847-
writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK,
848-
priv->baseaddr + DDR_QOS_IRQ_EN_OFST);
849-
850-
}
851-
852-
static void disable_intr(struct synps_edac_priv *priv)
853-
{
854-
/* Disable UE/CE Interrupts */
855-
writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK,
856-
priv->baseaddr + DDR_QOS_IRQ_DB_OFST);
857-
}
858-
859865
static int setup_irq(struct mem_ctl_info *mci,
860866
struct platform_device *pdev)
861867
{

0 commit comments

Comments
 (0)