mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] EDAC/altera: two bug fixes
@ 2025-04-21 16:14 Matthew Gerlach
  2025-04-21 16:14 ` [PATCH v2 1/2] EDAC/altera: fix cut and paste error Matthew Gerlach
  2025-04-21 16:14 ` [PATCH v2 2/2] EDAC/altera: Set DDR and SDMMC interrupt mask before registration Matthew Gerlach
  0 siblings, 2 replies; 7+ messages in thread
From: Matthew Gerlach @ 2025-04-21 16:14 UTC (permalink / raw)
  To: dinguyen, bp, tony.luck, james.morse, mchehab, rric, tthayer,
	linux-edac, linux-kernel
  Cc: Matthew Gerlach

This patch set contains two bug fixes for the Altera ECC manager.

Patch 1:
 - Test the correct structure member before using it.

Patch 2:
 - Mask HW interrupts until handler registered.

Niravkumar L Rabara (2):
  EDAC/altera: fix cut and paste error
  EDAC/altera: Set DDR and SDMMC interrupt mask before registration

 drivers/edac/altera_edac.c | 9 +++++----
 drivers/edac/altera_edac.h | 2 ++
 2 files changed, 7 insertions(+), 4 deletions(-)

-- 
2.35.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/2] EDAC/altera: fix cut and paste error
  2025-04-21 16:14 [PATCH v2 0/2] EDAC/altera: two bug fixes Matthew Gerlach
@ 2025-04-21 16:14 ` Matthew Gerlach
  2025-04-24 22:53   ` Dinh Nguyen
  2025-04-21 16:14 ` [PATCH v2 2/2] EDAC/altera: Set DDR and SDMMC interrupt mask before registration Matthew Gerlach
  1 sibling, 1 reply; 7+ messages in thread
From: Matthew Gerlach @ 2025-04-21 16:14 UTC (permalink / raw)
  To: dinguyen, bp, tony.luck, james.morse, mchehab, rric, tthayer,
	linux-edac, linux-kernel
  Cc: Niravkumar L Rabara, stable, Matthew Gerlach

From: Niravkumar L Rabara <niravkumar.l.rabara@altera.com>

Test correct structure member, ecc_cecnt_offset, before using it.

Fixes: 73bcc942f4271 ("EDAC, altera: Add Arria10 EDAC support")
Cc: stable@kernel.org
Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@altera.com>
Signed-off-by: Matthew Gerlach <matthew.gerlach@altera.com>
---
v2:
 - Improve commit message.
 - Add Fixes: and Cc: tags.
---
 drivers/edac/altera_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 3e971f902363..88d9d2f458ee 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -99,7 +99,7 @@ static irqreturn_t altr_sdram_mc_err_handler(int irq, void *dev_id)
 	if (status & priv->ecc_stat_ce_mask) {
 		regmap_read(drvdata->mc_vbase, priv->ecc_saddr_offset,
 			    &err_addr);
-		if (priv->ecc_uecnt_offset)
+		if (priv->ecc_cecnt_offset)
 			regmap_read(drvdata->mc_vbase,  priv->ecc_cecnt_offset,
 				    &err_count);
 		edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, err_count,
-- 
2.35.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 2/2] EDAC/altera: Set DDR and SDMMC interrupt mask before registration
  2025-04-21 16:14 [PATCH v2 0/2] EDAC/altera: two bug fixes Matthew Gerlach
  2025-04-21 16:14 ` [PATCH v2 1/2] EDAC/altera: fix cut and paste error Matthew Gerlach
@ 2025-04-21 16:14 ` Matthew Gerlach
  2025-04-24 22:58   ` Dinh Nguyen
  1 sibling, 1 reply; 7+ messages in thread
From: Matthew Gerlach @ 2025-04-21 16:14 UTC (permalink / raw)
  To: dinguyen, bp, tony.luck, james.morse, mchehab, rric, tthayer,
	linux-edac, linux-kernel
  Cc: Niravkumar L Rabara, stable, Matthew Gerlach

From: Niravkumar L Rabara <niravkumar.l.rabara@altera.com>

Mask DDR and SDMMC in probe function to avoid spurious irq before
registration.  Removed invalid register write to system manager.

Fixes: 1166fde93d5b1 ("EDAC, altera: Add Arria10 ECC memory init functions")
Cc: stable@kernel.org
Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@altera.com>
Signed-off-by: Matthew Gerlach <matthew.gerlach@altera.com>
---
v2:
 - Add Fixes: and Cc: tags.
---
 drivers/edac/altera_edac.c | 7 ++++---
 drivers/edac/altera_edac.h | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 88d9d2f458ee..dcd7008fe06b 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1005,9 +1005,6 @@ altr_init_a10_ecc_block(struct device_node *np, u32 irq_mask,
 		}
 	}
 
-	/* Interrupt mode set to every SBERR */
-	regmap_write(ecc_mgr_map, ALTR_A10_ECC_INTMODE_OFST,
-		     ALTR_A10_ECC_INTMODE);
 	/* Enable ECC */
 	ecc_set_bits(ecc_ctrl_en_mask, (ecc_block_base +
 					ALTR_A10_ECC_CTRL_OFST));
@@ -2127,6 +2124,10 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
 		return PTR_ERR(edac->ecc_mgr_map);
 	}
 
+	/* Set irq mask for DDR SBE to avoid any pending irq before registration */
+	regmap_write(edac->ecc_mgr_map, A10_SYSMGR_ECC_INTMASK_SET_OFST,
+		     (A10_SYSMGR_ECC_INTMASK_SDMMCB | A10_SYSMGR_ECC_INTMASK_DDR0));
+
 	edac->irq_chip.name = pdev->dev.of_node->name;
 	edac->irq_chip.irq_mask = a10_eccmgr_irq_mask;
 	edac->irq_chip.irq_unmask = a10_eccmgr_irq_unmask;
diff --git a/drivers/edac/altera_edac.h b/drivers/edac/altera_edac.h
index 3727e72c8c2e..7248d24c4908 100644
--- a/drivers/edac/altera_edac.h
+++ b/drivers/edac/altera_edac.h
@@ -249,6 +249,8 @@ struct altr_sdram_mc_data {
 #define A10_SYSMGR_ECC_INTMASK_SET_OFST   0x94
 #define A10_SYSMGR_ECC_INTMASK_CLR_OFST   0x98
 #define A10_SYSMGR_ECC_INTMASK_OCRAM      BIT(1)
+#define A10_SYSMGR_ECC_INTMASK_SDMMCB     BIT(16)
+#define A10_SYSMGR_ECC_INTMASK_DDR0       BIT(17)
 
 #define A10_SYSMGR_ECC_INTSTAT_SERR_OFST  0x9C
 #define A10_SYSMGR_ECC_INTSTAT_DERR_OFST  0xA0
-- 
2.35.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/2] EDAC/altera: fix cut and paste error
  2025-04-21 16:14 ` [PATCH v2 1/2] EDAC/altera: fix cut and paste error Matthew Gerlach
@ 2025-04-24 22:53   ` Dinh Nguyen
  2025-04-25  0:32     ` Gerlach, Matthew
  0 siblings, 1 reply; 7+ messages in thread
From: Dinh Nguyen @ 2025-04-24 22:53 UTC (permalink / raw)
  To: Matthew Gerlach, bp, tony.luck, james.morse, mchehab, rric,
	tthayer, linux-edac, linux-kernel
  Cc: Niravkumar L Rabara, stable

On 4/21/25 11:14, Matthew Gerlach wrote:
> From: Niravkumar L Rabara <niravkumar.l.rabara@altera.com>
> 
> Test correct structure member, ecc_cecnt_offset, before using it.
> 
> Fixes: 73bcc942f4271 ("EDAC, altera: Add Arria10 EDAC support")

Please just use a 12-digit HASH...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/2] EDAC/altera: Set DDR and SDMMC interrupt mask before registration
  2025-04-21 16:14 ` [PATCH v2 2/2] EDAC/altera: Set DDR and SDMMC interrupt mask before registration Matthew Gerlach
@ 2025-04-24 22:58   ` Dinh Nguyen
  0 siblings, 0 replies; 7+ messages in thread
From: Dinh Nguyen @ 2025-04-24 22:58 UTC (permalink / raw)
  To: Matthew Gerlach, bp, tony.luck, james.morse, mchehab, rric,
	tthayer, linux-edac, linux-kernel
  Cc: Niravkumar L Rabara, stable

On 4/21/25 11:14, Matthew Gerlach wrote:
> From: Niravkumar L Rabara <niravkumar.l.rabara@altera.com>
> 
> Mask DDR and SDMMC in probe function to avoid spurious irq before
> registration.  Removed invalid register write to system manager.
> 
> Fixes: 1166fde93d5b1 ("EDAC, altera: Add Arria10 ECC memory init functions")

Please just use 12-digits

Dinh


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/2] EDAC/altera: fix cut and paste error
  2025-04-24 22:53   ` Dinh Nguyen
@ 2025-04-25  0:32     ` Gerlach, Matthew
  2025-04-25  0:40       ` Luck, Tony
  0 siblings, 1 reply; 7+ messages in thread
From: Gerlach, Matthew @ 2025-04-25  0:32 UTC (permalink / raw)
  To: Dinh Nguyen, bp, tony.luck, james.morse, mchehab, rric, tthayer,
	linux-edac, linux-kernel
  Cc: Niravkumar L Rabara, stable



On 4/24/2025 3:53 PM, Dinh Nguyen wrote:
> 
> On 4/21/25 11:14, Matthew Gerlach wrote:
>> From: Niravkumar L Rabara <niravkumar.l.rabara@altera.com>
>>
>> Test correct structure member, ecc_cecnt_offset, before using it.
>>
>> Fixes: 73bcc942f4271 ("EDAC, altera: Add Arria10 EDAC support")
> 
> Please just use a 12-digit HASH...

I cut 'n pasted from git blame. I will use a 12-digit HASH for Fixes: 
tag in v3.

Thanks for the review,
Matthew Geralch


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH v2 1/2] EDAC/altera: fix cut and paste error
  2025-04-25  0:32     ` Gerlach, Matthew
@ 2025-04-25  0:40       ` Luck, Tony
  0 siblings, 0 replies; 7+ messages in thread
From: Luck, Tony @ 2025-04-25  0:40 UTC (permalink / raw)
  To: Gerlach, MatthewH (Altera Corp),
	Dinh Nguyen, bp, james.morse, mchehab, rric, tthayer, linux-edac,
	linux-kernel
  Cc: Niravkumar L Rabara, stable

>> Please just use a 12-digit HASH...
>
> I cut 'n pasted from git blame. I will use a 12-digit HASH for Fixes: 
> tag in v3.

Here's a useful alias I picked up (I think from Boris).  My ~/.gitconfig has
these lines:

[core]
	abbrev = 12
[alias]
	one = show -s --pretty='format:%h (\"%s\")'

So I can type this (with the 13 chars from git blame, or any other SHA1)

$ git one 73bcc942f4271
73bcc942f427 ("EDAC, altera: Add Arria10 EDAC support")

and get the canonical form to reference an earlier commit
in e-mail or git commit messages and tags.

-Tony

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-25  0:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-21 16:14 [PATCH v2 0/2] EDAC/altera: two bug fixes Matthew Gerlach
2025-04-21 16:14 ` [PATCH v2 1/2] EDAC/altera: fix cut and paste error Matthew Gerlach
2025-04-24 22:53   ` Dinh Nguyen
2025-04-25  0:32     ` Gerlach, Matthew
2025-04-25  0:40       ` Luck, Tony
2025-04-21 16:14 ` [PATCH v2 2/2] EDAC/altera: Set DDR and SDMMC interrupt mask before registration Matthew Gerlach
2025-04-24 22:58   ` Dinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®