FAILED: patch "[PATCH] fbdev: kyro: Release WC setup on registration failure" failed to apply to 5.15-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x d3bc005a62945aec57059201092b12b7c955e5a7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From d3bc005a62945aec57059201092b12b7c955e5a7 Mon Sep 17 00:00:00 2001
From: Myeonghun Pak <[email protected]>
Date: Mon, 14 Sep 2026 20:52:43 -0400
Subject: [PATCH] fbdev: kyro: Release WC setup on registration failure
If register_framebuffer() fails, kyrofb_probe() frees the framebuffer without releasing its write-combining range. Release the range before freeing the framebuffer. Earlier failures still skip this cleanup.
The missing cleanup already exists in the initial Git import, before the conversion from mtrr_add() to arch_phys_wc_add().
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/video/fbdev/kyro/fbdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/fbdev/kyro/fbdev.c +3 -1
@@ -765,7 +765,7 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)fb_memset_io (info->screen_base,0 , size);if (register_framebuffer (info) <0 ) - goto out_free_fb; + goto out_free_wc; fb_info(info, "%s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n", info->fix.id,
@@ -776,6 +776,8 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)return 0 ; +out_free_wc: +arch_phys_wc_del (currentpar->wc_cookie); out_free_fb:framebuffer_release (info);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/3 fbdev: kyro: Use devm_ioremap() for mmio registers
From: Giovanni Di Santi <[email protected]>
[ Upstream commit e0bf12a43243e6afc5a03fc55c58ec48aba48088 ]
Replace the manual ioremap() call for the MMIO registers with the device-managed devm_ioremap() variant.
This simplifies the driver's resource management by ensuring the memory is automatically unmapped when the driver detaches from the device.
Stable-dep-of: d3bc005a6294 ("fbdev: kyro: Release WC setup on registration failure")
--- drivers/video/fbdev/kyro/fbdev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/video/fbdev/kyro/fbdev.c +3 -5
@@ -713,13 +713,14 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) kyro_fix.mmio_len =pci_resource_len (pdev,1 ); currentpar->regbase = deviceInfo.pSTGReg = -ioremap (kyro_fix.mmio_start, kyro_fix.mmio_len); +devm_ioremap (&pdev->dev, kyro_fix.mmio_start, + kyro_fix.mmio_len);if (!currentpar->regbase) goto out_free_fb; info->screen_base =pci_ioremap_wc_bar (pdev,0 );if (!info->screen_base) - goto out_unmap_regs; + goto out_free_fb;if (!nomtrr) currentpar->wc_cookie = arch_phys_wc_add(kyro_fix.smem_start,
@@ -768,8 +769,6 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) out_unmap:iounmap (info->screen_base); -out_unmap_regs: -iounmap (currentpar->regbase); out_free_fb:framebuffer_release (info);
@@ -792,7 +791,6 @@ static void kyrofb_remove(struct pci_dev *pdev) deviceInfo.ulOverlayOffset =0 ;iounmap (info->screen_base); -iounmap (par->regbase);arch_phys_wc_del (par->wc_cookie);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/3 fbdev: kyro: Use devm_ioremap_wc() for screen mem
From: Giovanni Di Santi <[email protected]>
[ Upstream commit 32dfb6112ea3ca143636832cd34234f2be4830bb ]
Replace the manual pci_ioremap_wc() call for mapping screen memory with the device-managed devm_ioremap_wc() variant.
This simplifies the driver's resource management by ensuring the memory is automatically unmapped when the driver detaches from the device.
Stable-dep-of: d3bc005a6294 ("fbdev: kyro: Release WC setup on registration failure")
--- drivers/video/fbdev/kyro/fbdev.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/video/fbdev/kyro/fbdev.c +3 -6
@@ -718,7 +718,8 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (!currentpar->regbase) goto out_free_fb; - info->screen_base =pci_ioremap_wc_bar (pdev,0 ); + info->screen_base =devm_ioremap_wc (&pdev->dev, kyro_fix.smem_start, + kyro_fix.smem_len);if (!info->screen_base) goto out_free_fb;
@@ -756,7 +757,7 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)fb_memset (info->screen_base,0 , size);if (register_framebuffer (info) <0 ) - goto out_unmap; + goto out_free_fb; fb_info(info, "%s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n", info->fix.id,
@@ -767,8 +768,6 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)return 0 ; -out_unmap: -iounmap (info->screen_base); out_free_fb:framebuffer_release (info);
@@ -790,8 +789,6 @@ static void kyrofb_remove(struct pci_dev *pdev) deviceInfo.ulNextFreeVidMem =0 ; deviceInfo.ulOverlayOffset =0 ; -iounmap (info->screen_base); -arch_phys_wc_del (par->wc_cookie);unregister_framebuffer (info);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 3/3 fbdev: kyro: Release WC setup on registration failure
In reply to Sasha LevinFrom: Myeonghun Pak <[email protected]>
[ Upstream commit d3bc005a62945aec57059201092b12b7c955e5a7 ]
If register_framebuffer() fails, kyrofb_probe() frees the framebuffer without releasing its write-combining range. Release the range before freeing the framebuffer. Earlier failures still skip this cleanup.
The missing cleanup already exists in the initial Git import, before the conversion from mtrr_add() to arch_phys_wc_add().
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/video/fbdev/kyro/fbdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/fbdev/kyro/fbdev.c +3 -1
@@ -757,7 +757,7 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)fb_memset (info->screen_base,0 , size);if (register_framebuffer (info) <0 ) - goto out_free_fb; + goto out_free_wc; fb_info(info, "%s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n", info->fix.id,
@@ -768,6 +768,8 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)return 0 ; +out_free_wc: +arch_phys_wc_del (currentpar->wc_cookie); out_free_fb:framebuffer_release (info);
Signature · 1 line
2.53.0