EDAC/altera: Use parent device for devres in altr_portb_setup()
Subsystems (3)
Dinh Nguyen
maintainerPATCH 1/1 EDAC/altera: Use parent device for devres in altr_portb_setup()
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.
--- drivers/edac/altera_edac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/edac/altera_edac.c +5 -5
@@ -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;
Signature · 1 line
2.42.0.411.g813d9a9188
Borislav Petkov
maintainerQuoted 8 lines · Dinh Nguyen
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-portaltr_edac_device_dev. This keepsdevres_open_group(),devm_request_irq(),devres_remove_group()anddevres_release_group()all referring to the same long-lived device so the group and the resources allocated inside it are torn down together.
Quoted 8 lines
Fixes 911049845d70 ("EDAC, altera: Add Arria10 SD-MMC EDAC support")Assisted-by Claude:claude-opus-4-7Signed-off-by Dinh Nguyen <[email protected]>--- 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.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteDinh Nguyen
maintainerQuoted 18 lines · Borislav Petkov
Quoted 8 lines · Dinh Nguyen
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-portaltr_edac_device_dev. This keepsdevres_open_group(),devm_request_irq(),devres_remove_group()anddevres_release_group()all referring to the same long-lived device so the group and the resources allocated inside it are torn down together.Quoted 8 lines
Fixes 911049845d70 ("EDAC, altera: Add Arria10 SD-MMC EDAC support")Assisted-by Claude:claude-opus-4-7Signed-off-by Dinh Nguyen <[email protected]>--- drivers/edac/altera_edac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Quoted 2 lines
How urgent is this? Can it wait until the merge window is over?
Not urgent at all. It can wait until v7.2-rc1.
Thanks,
Dinh
Dinh Nguyen
maintainerQuoted 18 lines · Borislav Petkov
Quoted 8 lines · Dinh Nguyen
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-portaltr_edac_device_dev. This keepsdevres_open_group(),devm_request_irq(),devres_remove_group()anddevres_release_group()all referring to the same long-lived device so the group and the resources allocated inside it are torn down together.Quoted 8 lines
Fixes 911049845d70 ("EDAC, altera: Add Arria10 SD-MMC EDAC support")Assisted-by Claude:claude-opus-4-7Signed-off-by Dinh Nguyen <[email protected]>--- drivers/edac/altera_edac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Quoted 2 lines
How urgent is this? Can it wait until the merge window is over?
Can you please pick this up for v7.2?
Thanks,
Dinh
Quoted 21 lines · Dinh Nguyen
Quoted 18 lines · Borislav Petkov
Quoted 16 lines · Dinh Nguyen
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-portaltr_edac_device_dev. This keepsdevres_open_group(),devm_request_irq(),devres_remove_group()anddevres_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")Assisted-by Claude:claude-opus-4-7Signed-off-by Dinh Nguyen <[email protected]>--- drivers/edac/altera_edac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Quoted 4 lines
Quoted 2 lines
How urgent is this? Can it wait until the merge window is over?
Can you please pick this up for v7.2?
Applied, thanks.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette