* [PATCH] EDAC/altera: Use parent device for devres in altr_portb_setup()
@ 2026-06-17 16:43 Dinh Nguyen
2026-06-17 22:18 ` Borislav Petkov
0 siblings, 1 reply; 2+ messages in thread
From: Dinh Nguyen @ 2026-06-17 16:43 UTC (permalink / raw)
To: bp, tony.luck; +Cc: dinguyen, dbgh9129, linux-edac, linux-kernel, stable
Anchor the devres group and the devm-managed IRQ requests in
altr_portb_setup() to the actual parent device (device->edac->dev)
instead of the embedded struct device inside the copied per-port
altr_edac_device_dev. This keeps devres_open_group(),
devm_request_irq(), devres_remove_group() and devres_release_group()
all referring to the same long-lived device so the group and the
resources allocated inside it are torn down together.
Fixes: 911049845d70 ("EDAC, altera: Add Arria10 SD-MMC EDAC support")
Cc: stable@vger.kernel.org
Closes: https://sashiko.dev/#/patchset/20260503212558.2811480-1-dbgh9129%40gmail.com
Assisted-by: Claude:claude-opus-4-7
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
drivers/edac/altera_edac.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 4edd2088c2db..5914b2fd94d9 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1533,7 +1533,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
altdev = dci->pvt_info;
*altdev = *device;
- if (!devres_open_group(&altdev->ddev, altr_portb_setup, GFP_KERNEL))
+ if (!devres_open_group(device->edac->dev, altr_portb_setup, GFP_KERNEL))
return -ENOMEM;
/* Update PortB specific values */
@@ -1562,7 +1562,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
rc = -ENODEV;
goto err_release_group_1;
}
- rc = devm_request_irq(&altdev->ddev, altdev->sb_irq,
+ rc = devm_request_irq(device->edac->dev, altdev->sb_irq,
prv->ecc_irq_handler, IRQF_TRIGGER_HIGH,
ecc_name, altdev);
if (rc) {
@@ -1585,7 +1585,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
rc = -ENODEV;
goto err_release_group_1;
}
- rc = devm_request_irq(&altdev->ddev, altdev->db_irq,
+ rc = devm_request_irq(device->edac->dev, altdev->db_irq,
prv->ecc_irq_handler, IRQF_TRIGGER_HIGH,
ecc_name, altdev);
if (rc) {
@@ -1605,13 +1605,13 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
list_add(&altdev->next, &altdev->edac->a10_ecc_devices);
- devres_remove_group(&altdev->ddev, altr_portb_setup);
+ devres_remove_group(device->edac->dev, altr_portb_setup);
return 0;
err_release_group_1:
edac_device_free_ctl_info(dci);
- devres_release_group(&altdev->ddev, altr_portb_setup);
+ devres_release_group(device->edac->dev, altr_portb_setup);
edac_printk(KERN_ERR, EDAC_DEVICE,
"%s:Error setting up EDAC device: %d\n", ecc_name, rc);
return rc;
--
2.42.0.411.g813d9a9188
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] EDAC/altera: Use parent device for devres in altr_portb_setup()
2026-06-17 16:43 [PATCH] EDAC/altera: Use parent device for devres in altr_portb_setup() Dinh Nguyen
@ 2026-06-17 22:18 ` Borislav Petkov
0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2026-06-17 22:18 UTC (permalink / raw)
To: Dinh Nguyen; +Cc: tony.luck, dbgh9129, linux-edac, linux-kernel, stable
On Wed, Jun 17, 2026 at 11:43:03AM -0500, Dinh Nguyen wrote:
> Anchor the devres group and the devm-managed IRQ requests in
> altr_portb_setup() to the actual parent device (device->edac->dev)
> instead of the embedded struct device inside the copied per-port
> altr_edac_device_dev. This keeps devres_open_group(),
> devm_request_irq(), devres_remove_group() and devres_release_group()
> all referring to the same long-lived device so the group and the
> resources allocated inside it are torn down together.
>
> Fixes: 911049845d70 ("EDAC, altera: Add Arria10 SD-MMC EDAC support")
> Cc: stable@vger.kernel.org
> Closes: https://sashiko.dev/#/patchset/20260503212558.2811480-1-dbgh9129%40gmail.com
> Assisted-by: Claude:claude-opus-4-7
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
> drivers/edac/altera_edac.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
How urgent is this? Can it wait until the merge window is over?
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-17 22:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17 16:43 [PATCH] EDAC/altera: Use parent device for devres in altr_portb_setup() Dinh Nguyen
2026-06-17 22:18 ` Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox