This is a note to let you know that I've just added the patch titled EDAC/i10nm: Release mdev/mbase when failing to detect HBM to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: edac-i10nm-release-mdev-mbase-when-failing-to-detect-hbm.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From c370baa328022cbd46c59c821d1b467a97f047be Mon Sep 17 00:00:00 2001 From: Qiuxu Zhuo <qiuxu.zhuo@xxxxxxxxx> Date: Fri, 24 Dec 2021 04:11:26 -0500 Subject: EDAC/i10nm: Release mdev/mbase when failing to detect HBM From: Qiuxu Zhuo <qiuxu.zhuo@xxxxxxxxx> commit c370baa328022cbd46c59c821d1b467a97f047be upstream. On systems without HBM (High Bandwidth Memory) mdev/mbase are not released/unmapped. Add the code to release mdev/mbase when failing to detect HBM. [Tony: re-word commit message] Cc: <stable@xxxxxxxxxxxxxxx> Fixes: c945088384d0 ("EDAC/i10nm: Add support for high bandwidth memory") Reported-by: kernel test robot <lkp@xxxxxxxxx> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@xxxxxxxxx> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx> Link: https://lore.kernel.org/r/20211224091126.1246-1-qiuxu.zhuo@xxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/edac/i10nm_base.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/edac/i10nm_base.c +++ b/drivers/edac/i10nm_base.c @@ -358,6 +358,9 @@ static int i10nm_get_hbm_munits(void) mbase = ioremap(base + off, I10NM_HBM_IMC_MMIO_SIZE); if (!mbase) { + pci_dev_put(d->imc[lmc].mdev); + d->imc[lmc].mdev = NULL; + i10nm_printk(KERN_ERR, "Failed to ioremap for hbm mc 0x%llx\n", base + off); return -ENOMEM; @@ -368,6 +371,12 @@ static int i10nm_get_hbm_munits(void) mcmtr = I10NM_GET_MCMTR(&d->imc[lmc], 0); if (!I10NM_IS_HBM_IMC(mcmtr)) { + iounmap(d->imc[lmc].mbase); + d->imc[lmc].mbase = NULL; + d->imc[lmc].hbm_mc = false; + pci_dev_put(d->imc[lmc].mdev); + d->imc[lmc].mdev = NULL; + i10nm_printk(KERN_ERR, "This isn't an hbm mc!\n"); return -ENODEV; } Patches currently in stable-queue which might be from qiuxu.zhuo@xxxxxxxxx are queue-5.15/edac-i10nm-release-mdev-mbase-when-failing-to-detect-hbm.patch