From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 288444EFFA9; Thu, 17 Sep 2026 16:00:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789660812; cv=none; b=JVxCmDKr3fadZFVkwmEAF2A7yzcRy2WZdqAlL3iwci8ME0pgREuIx4tAuHdXqW/9YMWTEk8Mrp38pMSmvNbSJRkA1krn8M2J/JB8Hs9TPbU4JCoVpenZT1TNHO/nPzovcDhic3Lk5VRdb2Ycu0iFno1LG1ip6iPcgYo84qLHyXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789660812; c=relaxed/simple; bh=Qq3YYBNrRu5XHAHNNmjUkOh0vrmn715og9z0YDXFIcs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dxt46UDEqTIHvzLYlocqhgDIntbLXFNK1PowmPBILhq+cBBxrjhr1FAyaEnhL12fehSubjEWekM9RFIvqICgKZspcWddvt3TmMcp6HFSuXv4veK2WRHlJauoTJ2o7aBlcWIPzWunbF+/vicXtWIOMTcl0KgipVtdU2MbH4ylPvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FwyRmIUU; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FwyRmIUU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CEFA1F000FF; Thu, 17 Sep 2026 16:00:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789660811; bh=Yar1HNTM+09VChMBUV8qiT+08FvF0Ah68znSy5kna5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FwyRmIUUpRzg5Tpwv7VOd3a8iRwgwiBUy+hqFtGe4sBwFuuQp7PwyRzRq7uYg9KTv SUTTloPWCNuSi48ow0XQ/5FZtH53ArhGFmMjorRmau647LpuRmfWKf6+U/I2skUAF+ RJphliYCeRzsKag9da20UZoSYdl7dX1XySUJxNKA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Borislav Petkov (AMD)" , Dinh Nguyen Subject: [PATCH 7.2 717/733] EDAC/altera: Use parent device for devres in altr_portb_setup() Date: Thu, 17 Sep 2026 16:17:05 +0100 Message-ID: <20260917151410.796149000@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151350.597953846@linuxfoundation.org> References: <20260917151350.597953846@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dinh Nguyen commit 9868f5c077dfe0b606331f2e782484f91a5789a5 upstream. 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") Closes: https://sashiko.dev/#/patchset/20260503212558.2811480-1-dbgh9129%40gmail.com Assisted-by: LLM Signed-off-by: Borislav Petkov (AMD) Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260617164303.585555-1-dinguyen@kernel.org Signed-off-by: Dinh Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/edac/altera_edac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -1533,7 +1533,7 @@ static int altr_portb_setup(struct altr_ 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_ 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_ 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_ 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;