Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH] staging: sm750fb: fix CamelCase variables name in sm750
From: kernel test robot @ 2026-05-17  2:57 UTC (permalink / raw)
  To: Emmanuel Arias, sudipm.mukherjee, teddy.wang, gregkh
  Cc: oe-kbuild-all, linux-fbdev, linux-staging, linux-kernel,
	Emmanuel Arias
In-Reply-To: <20260516222613.1178800-1-eamanu@riseup.net>

Hi Emmanuel,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Emmanuel-Arias/staging-sm750fb-fix-CamelCase-variables-name-in-sm750/20260517-062807
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260516222613.1178800-1-eamanu%40riseup.net
patch subject: [PATCH] staging: sm750fb: fix CamelCase variables name in sm750
config: parisc-randconfig-002-20260517 (https://download.01.org/0day-ci/archive/20260517/202605171049.KbaBnrJV-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260517/202605171049.KbaBnrJV-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605171049.KbaBnrJV-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/staging/sm750fb/sm750_hw.c: In function 'hw_sm750_map':
>> drivers/staging/sm750fb/sm750_hw.c:43:13: error: 'struct sm750_dev' has no member named 'pvReg'; did you mean 'pv_reg'?
     sm750_dev->pvReg =
                ^~~~~
                pv_reg
   drivers/staging/sm750fb/sm750_hw.c:45:18: error: 'struct sm750_dev' has no member named 'pvReg'; did you mean 'pv_reg'?
     if (!sm750_dev->pvReg) {
                     ^~~~~
                     pv_reg
   drivers/staging/sm750fb/sm750_hw.c:51:41: error: 'struct sm750_dev' has no member named 'pvReg'; did you mean 'pv_reg'?
     sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
                                            ^~~~~
                                            pv_reg
   drivers/staging/sm750fb/sm750_hw.c:52:45: error: 'struct sm750_dev' has no member named 'pvReg'; did you mean 'pv_reg'?
     sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
                                                ^~~~~
                                                pv_reg
   drivers/staging/sm750fb/sm750_hw.c:54:23: error: 'struct sm750_dev' has no member named 'pvReg'; did you mean 'pv_reg'?
     mmio750 = sm750_dev->pvReg;
                          ^~~~~
                          pv_reg
   drivers/staging/sm750fb/sm750_hw.c:78:21: error: 'struct sm750_dev' has no member named 'pvReg'; did you mean 'pv_reg'?
     iounmap(sm750_dev->pvReg);
                        ^~~~~
                        pv_reg


vim +43 drivers/staging/sm750fb/sm750_hw.c

efe9bc08bf479b Elise Lennion    2016-10-11  27  
700591a9adc8b1 Mike Rapoport    2015-10-26  28  int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
81dee67e215b23 Sudip Mukherjee  2015-03-03  29  {
81dee67e215b23 Sudip Mukherjee  2015-03-03  30  	int ret;
81dee67e215b23 Sudip Mukherjee  2015-03-03  31  
e359b6a863e19f Mike Rapoport    2015-10-26  32  	sm750_dev->vidreg_start = pci_resource_start(pdev, 1);
e359b6a863e19f Mike Rapoport    2015-10-26  33  	sm750_dev->vidreg_size = SZ_2M;
81dee67e215b23 Sudip Mukherjee  2015-03-03  34  
8225489ddb9006 Artem Lytkin     2026-02-16  35  	/* reserve the vidreg space of smi adaptor */
9a52ae2dd8c24a Anatoly Stepanov 2015-06-29  36  	ret = pci_request_region(pdev, 1, "sm750fb");
9a52ae2dd8c24a Anatoly Stepanov 2015-06-29  37  	if (ret) {
e5448f8d2ec5b4 Artem Lytkin     2026-02-23  38  		dev_err(&pdev->dev, "Can not request PCI regions.\n");
8225489ddb9006 Artem Lytkin     2026-02-16  39  		return ret;
81dee67e215b23 Sudip Mukherjee  2015-03-03  40  	}
81dee67e215b23 Sudip Mukherjee  2015-03-03  41  
81dee67e215b23 Sudip Mukherjee  2015-03-03  42  	/* now map mmio and vidmem */
fdc234d85210d9 Benjamin Philip  2021-07-28 @43  	sm750_dev->pvReg =
fdc234d85210d9 Benjamin Philip  2021-07-28  44  		ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
e359b6a863e19f Mike Rapoport    2015-10-26  45  	if (!sm750_dev->pvReg) {
e5448f8d2ec5b4 Artem Lytkin     2026-02-23  46  		dev_err(&pdev->dev, "mmio failed\n");
81dee67e215b23 Sudip Mukherjee  2015-03-03  47  		ret = -EFAULT;
8225489ddb9006 Artem Lytkin     2026-02-16  48  		goto err_release_region;
81dee67e215b23 Sudip Mukherjee  2015-03-03  49  	}
81dee67e215b23 Sudip Mukherjee  2015-03-03  50  
5865a858dbc9cb Yiming Qian      2025-09-09  51  	sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
5865a858dbc9cb Yiming Qian      2025-09-09  52  	sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
81dee67e215b23 Sudip Mukherjee  2015-03-03  53  
efe9bc08bf479b Elise Lennion    2016-10-11  54  	mmio750 = sm750_dev->pvReg;
efe9bc08bf479b Elise Lennion    2016-10-11  55  	sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
81dee67e215b23 Sudip Mukherjee  2015-03-03  56  
e359b6a863e19f Mike Rapoport    2015-10-26  57  	sm750_dev->vidmem_start = pci_resource_start(pdev, 0);
f5016082f63d42 Eric S. Stone    2016-10-22  58  	/*
f5016082f63d42 Eric S. Stone    2016-10-22  59  	 * don't use pdev_resource[x].end - resource[x].start to
878336c3362d09 Stefan Wolz      2016-06-23  60  	 * calculate the resource size, it's only the maximum available
878336c3362d09 Stefan Wolz      2016-06-23  61  	 * size but not the actual size, using
3fcb465f1e74ef Elise Lennion    2016-10-13  62  	 * @ddk750_get_vm_size function can be safe.
878336c3362d09 Stefan Wolz      2016-06-23  63  	 */
3fcb465f1e74ef Elise Lennion    2016-10-13  64  	sm750_dev->vidmem_size = ddk750_get_vm_size();
81dee67e215b23 Sudip Mukherjee  2015-03-03  65  
81dee67e215b23 Sudip Mukherjee  2015-03-03  66  	/* reserve the vidmem space of smi adaptor */
f50b4602fea62f Jennifer Guo     2026-05-09  67  	sm750_dev->vmem =
fdc234d85210d9 Benjamin Philip  2021-07-28  68  		ioremap_wc(sm750_dev->vidmem_start, sm750_dev->vidmem_size);
f50b4602fea62f Jennifer Guo     2026-05-09  69  	if (!sm750_dev->vmem) {
e5448f8d2ec5b4 Artem Lytkin     2026-02-23  70  		dev_err(&pdev->dev, "Map video memory failed\n");
81dee67e215b23 Sudip Mukherjee  2015-03-03  71  		ret = -EFAULT;
8225489ddb9006 Artem Lytkin     2026-02-16  72  		goto err_unmap_reg;
81dee67e215b23 Sudip Mukherjee  2015-03-03  73  	}
8225489ddb9006 Artem Lytkin     2026-02-16  74  
8225489ddb9006 Artem Lytkin     2026-02-16  75  	return 0;
8225489ddb9006 Artem Lytkin     2026-02-16  76  
8225489ddb9006 Artem Lytkin     2026-02-16  77  err_unmap_reg:
8225489ddb9006 Artem Lytkin     2026-02-16  78  	iounmap(sm750_dev->pvReg);
8225489ddb9006 Artem Lytkin     2026-02-16  79  err_release_region:
8225489ddb9006 Artem Lytkin     2026-02-16  80  	pci_release_region(pdev, 1);
81dee67e215b23 Sudip Mukherjee  2015-03-03  81  	return ret;
81dee67e215b23 Sudip Mukherjee  2015-03-03  82  }
81dee67e215b23 Sudip Mukherjee  2015-03-03  83  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* [PATCH] staging: sm750fb: fix CamelCase variables name in sm750
From: Emmanuel Arias @ 2026-05-16 22:26 UTC (permalink / raw)
  To: sudipm.mukherjee, teddy.wang, gregkh
  Cc: linux-fbdev, linux-staging, linux-kernel, Emmanuel Arias

Replace CamelCase variable name with snake_case:
- pvReg -> pv_reg
- setAllEngOff -> set_all_eng_off

Signed-off-by: Emmanuel Arias <eamanu@riseup.net>
---
 drivers/staging/sm750fb/sm750.c | 6 +++---
 drivers/staging/sm750fb/sm750.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 996a586a3727..9b30627a19d0 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -755,7 +755,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 	 * must be set after crtc member initialized
 	 */
 	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
-	crtc->cursor.mmio = sm750_dev->pvReg +
+	crtc->cursor.mmio = sm750_dev->pv_reg +
 		0x800f0 + (int)crtc->channel * 0x140;
 
 	crtc->cursor.max_h = 64;
@@ -860,7 +860,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
 	sm750_dev->init_parm.mem_clk = 0;
 	sm750_dev->init_parm.master_clk = 0;
 	sm750_dev->init_parm.power_mode = 0;
-	sm750_dev->init_parm.setAllEngOff = 0;
+	sm750_dev->init_parm.set_all_eng_off = 0;
 	sm750_dev->init_parm.reset_memory = 1;
 
 	/* defaultly turn g_hwcursor on for both view */
@@ -1059,7 +1059,7 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
 	sm750fb_framebuffer_release(sm750_dev);
 	arch_phys_wc_del(sm750_dev->mtrr.vram);
 
-	iounmap(sm750_dev->pvReg);
+	iounmap(sm750_dev->pv_reg);
 	iounmap(sm750_dev->vmem);
 	pci_release_region(pdev, 1);
 	kfree(g_settings);
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index d2c522e67f26..e8885133da2e 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -44,7 +44,7 @@ struct init_status {
 	ushort chip_clk;
 	ushort mem_clk;
 	ushort master_clk;
-	ushort setAllEngOff;
+	ushort set_all_eng_off;
 	ushort reset_memory;
 };
 
@@ -97,7 +97,7 @@ struct sm750_dev {
 	unsigned long vidreg_start;
 	__u32 vidmem_size;
 	__u32 vidreg_size;
-	void __iomem *pvReg;
+	void __iomem *pv_reg;
 	unsigned char __iomem *vmem;
 	/* locks*/
 	spinlock_t slock;
-- 
2.53.0


^ permalink raw reply related

* [PATCH] staging: sm750fb: Mark g_noaccel, g_nomtrr and g_dualview as __ro_after_init
From: Len Bao @ 2026-05-16 14:23 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: Len Bao, linux-fbdev, linux-staging, linux-kernel

The 'g_noaccel', 'g_nomtrr' and 'g_dualview' variables are initialized
only during the init phase in the 'lynxfb_setup' function and never
changed. So, mark them as __ro_after_init.

Signed-off-by: Len Bao <len.bao@gmx.us>
---
 drivers/staging/sm750fb/sm750.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e..99f5269f1 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -31,12 +31,12 @@
 
 /* common var for all device */
 static int g_hwcursor = 1;
-static int g_noaccel;
-static int g_nomtrr;
+static int g_noaccel __ro_after_init;
+static int g_nomtrr __ro_after_init;
 static const char *g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
-static int g_dualview;
+static int g_dualview __ro_after_init;
 static char *g_option;
 
 static const struct fb_videomode lynx750_ext[] = {
-- 
2.43.0


^ permalink raw reply related

* Re: [PATCH] staging: sm750: rename CamelCase variable in sm750.c
From: kernel test robot @ 2026-05-15 23:48 UTC (permalink / raw)
  To: Rupesh Majhi, gregkh
  Cc: oe-kbuild-all, sudipm.mukherjee, teddy.wang, linux-fbdev,
	linux-staging, linux-kernel, Rupesh Majhi
In-Reply-To: <20260515103811.2808620-1-zoone.rupert@gmail.com>

Hi Rupesh,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Rupesh-Majhi/staging-sm750-rename-CamelCase-variable-in-sm750-c/20260515-213450
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260515103811.2808620-1-zoone.rupert%40gmail.com
patch subject: [PATCH] staging: sm750: rename CamelCase variable in sm750.c
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20260516/202605160741.A9M01x77-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260516/202605160741.A9M01x77-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605160741.A9M01x77-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/staging/sm750fb/sm750.c: In function 'lynxfb_set_fbinfo':
>> drivers/staging/sm750fb/sm750.c:758:40: error: 'struct sm750_dev' has no member named 'pv_reg'; did you mean 'pvReg'?
     758 |         crtc->cursor.mmio = sm750_dev->pv_reg +
         |                                        ^~~~~~
         |                                        pvReg
   drivers/staging/sm750fb/sm750.c: In function 'sm750fb_setup':
>> drivers/staging/sm750fb/sm750.c:863:30: error: 'struct init_status' has no member named 'set_all_eng_off'; did you mean 'setAllEngOff'?
     863 |         sm750_dev->init_parm.set_all_eng_off = 0;
         |                              ^~~~~~~~~~~~~~~
         |                              setAllEngOff
   drivers/staging/sm750fb/sm750.c: In function 'lynxfb_pci_remove':
   drivers/staging/sm750fb/sm750.c:1062:28: error: 'struct sm750_dev' has no member named 'pv_reg'; did you mean 'pvReg'?
    1062 |         iounmap(sm750_dev->pv_reg);
         |                            ^~~~~~
         |                            pvReg


vim +758 drivers/staging/sm750fb/sm750.c

   719	
   720	static int lynxfb_set_fbinfo(struct fb_info *info, int index)
   721	{
   722		int i;
   723		struct lynxfb_par *par;
   724		struct sm750_dev *sm750_dev;
   725		struct lynxfb_crtc *crtc;
   726		struct lynxfb_output *output;
   727		struct fb_var_screeninfo *var;
   728		struct fb_fix_screeninfo *fix;
   729	
   730		const struct fb_videomode *pdb[] = {
   731			lynx750_ext, NULL, vesa_modes,
   732		};
   733		int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
   734		static const char * const fix_id[2] = {
   735			"sm750_fb1", "sm750_fb2",
   736		};
   737	
   738		int ret, line_length;
   739	
   740		ret = 0;
   741		par = (struct lynxfb_par *)info->par;
   742		sm750_dev = par->dev;
   743		crtc = &par->crtc;
   744		output = &par->output;
   745		var = &info->var;
   746		fix = &info->fix;
   747	
   748		/* set index */
   749		par->index = index;
   750		output->channel = &crtc->channel;
   751		sm750fb_set_drv(par);
   752	
   753		/*
   754		 * set current cursor variable and proc pointer,
   755		 * must be set after crtc member initialized
   756		 */
   757		crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
 > 758		crtc->cursor.mmio = sm750_dev->pv_reg +
   759			0x800f0 + (int)crtc->channel * 0x140;
   760	
   761		crtc->cursor.max_h = 64;
   762		crtc->cursor.max_w = 64;
   763		crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
   764		crtc->cursor.vstart = sm750_dev->vmem + crtc->cursor.offset;
   765	
   766		memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
   767		if (!g_hwcursor)
   768			sm750_hw_cursor_disable(&crtc->cursor);
   769	
   770		/* set info->fbops, must be set before fb_find_mode */
   771		if (!sm750_dev->accel_off) {
   772			/* use 2d acceleration */
   773			if (!g_hwcursor)
   774				info->fbops = &lynxfb_ops_accel;
   775			else
   776				info->fbops = &lynxfb_ops_accel_with_cursor;
   777		} else {
   778			if (!g_hwcursor)
   779				info->fbops = &lynxfb_ops;
   780			else
   781				info->fbops = &lynxfb_ops_with_cursor;
   782		}
   783	
   784		if (!g_fbmode[index]) {
   785			g_fbmode[index] = g_def_fbmode;
   786			if (index)
   787				g_fbmode[index] = g_fbmode[0];
   788		}
   789	
   790		for (i = 0; i < 3; i++) {
   791			ret = fb_find_mode(var, info, g_fbmode[index],
   792					   pdb[i], cdb[i], NULL, 8);
   793	
   794			if (ret == 1 || ret == 2)
   795				break;
   796		}
   797	
   798		/* set par */
   799		par->info = info;
   800	
   801		/* set info */
   802		line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
   803				    crtc->line_pad);
   804	
   805		info->pseudo_palette = &par->pseudo_palette[0];
   806		info->screen_base = crtc->v_screen;
   807		info->screen_size = line_length * var->yres_virtual;
   808	
   809		/* set info->fix */
   810		fix->type = FB_TYPE_PACKED_PIXELS;
   811		fix->type_aux = 0;
   812		fix->xpanstep = crtc->xpanstep;
   813		fix->ypanstep = crtc->ypanstep;
   814		fix->ywrapstep = crtc->ywrapstep;
   815		fix->accel = FB_ACCEL_SMI;
   816	
   817		strscpy(fix->id, fix_id[index], sizeof(fix->id));
   818	
   819		fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
   820		/*
   821		 * according to mmap experiment from user space application,
   822		 * fix->mmio_len should not larger than virtual size
   823		 * (xres_virtual x yres_virtual x ByPP)
   824		 * Below line maybe buggy when user mmap fb dev node and write
   825		 * data into the bound over virtual size
   826		 */
   827		fix->smem_len = crtc->vidmem_size;
   828		info->screen_size = fix->smem_len;
   829		fix->line_length = line_length;
   830		fix->mmio_start = sm750_dev->vidreg_start;
   831		fix->mmio_len = sm750_dev->vidreg_size;
   832	
   833		lynxfb_set_visual_mode(info);
   834	
   835		/* set var */
   836		var->activate = FB_ACTIVATE_NOW;
   837		var->accel_flags = 0;
   838		var->vmode = FB_VMODE_NONINTERLACED;
   839	
   840		ret = fb_alloc_cmap(&info->cmap, 256, 0);
   841		if (ret < 0) {
   842			dev_err(info->device, "Could not allocate memory for cmap.\n");
   843			goto exit;
   844		}
   845	
   846	exit:
   847		lynxfb_ops_check_var(var, info);
   848		return ret;
   849	}
   850	
   851	/*	chip specific g_option configuration routine */
   852	static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
   853	{
   854		char *opt;
   855		int swap;
   856	
   857		swap = 0;
   858	
   859		sm750_dev->init_parm.chip_clk = 0;
   860		sm750_dev->init_parm.mem_clk = 0;
   861		sm750_dev->init_parm.master_clk = 0;
   862		sm750_dev->init_parm.power_mode = 0;
 > 863		sm750_dev->init_parm.set_all_eng_off = 0;
   864		sm750_dev->init_parm.reset_memory = 1;
   865	
   866		/* defaultly turn g_hwcursor on for both view */
   867		g_hwcursor = 3;
   868	
   869		if (!src || !*src) {
   870			dev_warn(&sm750_dev->pdev->dev, "no specific g_option.\n");
   871			goto NO_PARAM;
   872		}
   873	
   874		while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
   875			dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
   876			dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
   877	
   878			if (!strncmp(opt, "swap", strlen("swap"))) {
   879				swap = 1;
   880			} else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
   881				sm750_dev->nocrt = 1;
   882			} else if (!strncmp(opt, "36bit", strlen("36bit"))) {
   883				sm750_dev->pnltype = SM750_DOUBLE_TFT;
   884			} else if (!strncmp(opt, "18bit", strlen("18bit"))) {
   885				sm750_dev->pnltype = SM750_DUAL_TFT;
   886			} else if (!strncmp(opt, "24bit", strlen("24bit"))) {
   887				sm750_dev->pnltype = SM750_24TFT;
   888			} else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
   889				g_hwcursor &= ~0x1;
   890			} else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
   891				g_hwcursor &= ~0x2;
   892			} else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
   893				g_hwcursor = 0;
   894			} else {
   895				if (!g_fbmode[0]) {
   896					g_fbmode[0] = opt;
   897					dev_info(&sm750_dev->pdev->dev,
   898						 "find fbmode0 : %s\n", g_fbmode[0]);
   899				} else if (!g_fbmode[1]) {
   900					g_fbmode[1] = opt;
   901					dev_info(&sm750_dev->pdev->dev,
   902						 "find fbmode1 : %s\n", g_fbmode[1]);
   903				} else {
   904					dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
   905				}
   906			}
   907		}
   908	
   909	NO_PARAM:
   910		if (sm750_dev->revid != SM750LE_REVISION_ID) {
   911			if (sm750_dev->fb_count > 1) {
   912				if (swap)
   913					sm750_dev->dataflow = sm750_dual_swap;
   914				else
   915					sm750_dev->dataflow = sm750_dual_normal;
   916			} else {
   917				if (swap)
   918					sm750_dev->dataflow = sm750_simul_sec;
   919				else
   920					sm750_dev->dataflow = sm750_simul_pri;
   921			}
   922		} else {
   923			/* SM750LE only have one crt channel */
   924			sm750_dev->dataflow = sm750_simul_sec;
   925			/* sm750le do not have complex attributes */
   926			sm750_dev->nocrt = 0;
   927		}
   928	}
   929	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* Re: [PATCH] staging: sm750: rename CamelCase variable in sm750.c
From: kernel test robot @ 2026-05-15 22:35 UTC (permalink / raw)
  To: Rupesh Majhi, gregkh
  Cc: llvm, oe-kbuild-all, sudipm.mukherjee, teddy.wang, linux-fbdev,
	linux-staging, linux-kernel, Rupesh Majhi
In-Reply-To: <20260515103811.2808620-1-zoone.rupert@gmail.com>

Hi Rupesh,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Rupesh-Majhi/staging-sm750-rename-CamelCase-variable-in-sm750-c/20260515-213450
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260515103811.2808620-1-zoone.rupert%40gmail.com
patch subject: [PATCH] staging: sm750: rename CamelCase variable in sm750.c
config: powerpc64-randconfig-002-20260516 (https://download.01.org/0day-ci/archive/20260516/202605160624.pd29nXG5-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260516/202605160624.pd29nXG5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605160624.pd29nXG5-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/staging/sm750fb/sm750.c:758:33: error: no member named 'pv_reg' in 'struct sm750_dev'
     758 |         crtc->cursor.mmio = sm750_dev->pv_reg +
         |                             ~~~~~~~~~  ^
>> drivers/staging/sm750fb/sm750.c:863:23: error: no member named 'set_all_eng_off' in 'struct init_status'
     863 |         sm750_dev->init_parm.set_all_eng_off = 0;
         |         ~~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/sm750fb/sm750.c:1062:21: error: no member named 'pv_reg' in 'struct sm750_dev'
    1062 |         iounmap(sm750_dev->pv_reg);
         |                 ~~~~~~~~~  ^
   3 errors generated.


vim +758 drivers/staging/sm750fb/sm750.c

   719	
   720	static int lynxfb_set_fbinfo(struct fb_info *info, int index)
   721	{
   722		int i;
   723		struct lynxfb_par *par;
   724		struct sm750_dev *sm750_dev;
   725		struct lynxfb_crtc *crtc;
   726		struct lynxfb_output *output;
   727		struct fb_var_screeninfo *var;
   728		struct fb_fix_screeninfo *fix;
   729	
   730		const struct fb_videomode *pdb[] = {
   731			lynx750_ext, NULL, vesa_modes,
   732		};
   733		int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
   734		static const char * const fix_id[2] = {
   735			"sm750_fb1", "sm750_fb2",
   736		};
   737	
   738		int ret, line_length;
   739	
   740		ret = 0;
   741		par = (struct lynxfb_par *)info->par;
   742		sm750_dev = par->dev;
   743		crtc = &par->crtc;
   744		output = &par->output;
   745		var = &info->var;
   746		fix = &info->fix;
   747	
   748		/* set index */
   749		par->index = index;
   750		output->channel = &crtc->channel;
   751		sm750fb_set_drv(par);
   752	
   753		/*
   754		 * set current cursor variable and proc pointer,
   755		 * must be set after crtc member initialized
   756		 */
   757		crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
 > 758		crtc->cursor.mmio = sm750_dev->pv_reg +
   759			0x800f0 + (int)crtc->channel * 0x140;
   760	
   761		crtc->cursor.max_h = 64;
   762		crtc->cursor.max_w = 64;
   763		crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
   764		crtc->cursor.vstart = sm750_dev->vmem + crtc->cursor.offset;
   765	
   766		memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
   767		if (!g_hwcursor)
   768			sm750_hw_cursor_disable(&crtc->cursor);
   769	
   770		/* set info->fbops, must be set before fb_find_mode */
   771		if (!sm750_dev->accel_off) {
   772			/* use 2d acceleration */
   773			if (!g_hwcursor)
   774				info->fbops = &lynxfb_ops_accel;
   775			else
   776				info->fbops = &lynxfb_ops_accel_with_cursor;
   777		} else {
   778			if (!g_hwcursor)
   779				info->fbops = &lynxfb_ops;
   780			else
   781				info->fbops = &lynxfb_ops_with_cursor;
   782		}
   783	
   784		if (!g_fbmode[index]) {
   785			g_fbmode[index] = g_def_fbmode;
   786			if (index)
   787				g_fbmode[index] = g_fbmode[0];
   788		}
   789	
   790		for (i = 0; i < 3; i++) {
   791			ret = fb_find_mode(var, info, g_fbmode[index],
   792					   pdb[i], cdb[i], NULL, 8);
   793	
   794			if (ret == 1 || ret == 2)
   795				break;
   796		}
   797	
   798		/* set par */
   799		par->info = info;
   800	
   801		/* set info */
   802		line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
   803				    crtc->line_pad);
   804	
   805		info->pseudo_palette = &par->pseudo_palette[0];
   806		info->screen_base = crtc->v_screen;
   807		info->screen_size = line_length * var->yres_virtual;
   808	
   809		/* set info->fix */
   810		fix->type = FB_TYPE_PACKED_PIXELS;
   811		fix->type_aux = 0;
   812		fix->xpanstep = crtc->xpanstep;
   813		fix->ypanstep = crtc->ypanstep;
   814		fix->ywrapstep = crtc->ywrapstep;
   815		fix->accel = FB_ACCEL_SMI;
   816	
   817		strscpy(fix->id, fix_id[index], sizeof(fix->id));
   818	
   819		fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
   820		/*
   821		 * according to mmap experiment from user space application,
   822		 * fix->mmio_len should not larger than virtual size
   823		 * (xres_virtual x yres_virtual x ByPP)
   824		 * Below line maybe buggy when user mmap fb dev node and write
   825		 * data into the bound over virtual size
   826		 */
   827		fix->smem_len = crtc->vidmem_size;
   828		info->screen_size = fix->smem_len;
   829		fix->line_length = line_length;
   830		fix->mmio_start = sm750_dev->vidreg_start;
   831		fix->mmio_len = sm750_dev->vidreg_size;
   832	
   833		lynxfb_set_visual_mode(info);
   834	
   835		/* set var */
   836		var->activate = FB_ACTIVATE_NOW;
   837		var->accel_flags = 0;
   838		var->vmode = FB_VMODE_NONINTERLACED;
   839	
   840		ret = fb_alloc_cmap(&info->cmap, 256, 0);
   841		if (ret < 0) {
   842			dev_err(info->device, "Could not allocate memory for cmap.\n");
   843			goto exit;
   844		}
   845	
   846	exit:
   847		lynxfb_ops_check_var(var, info);
   848		return ret;
   849	}
   850	
   851	/*	chip specific g_option configuration routine */
   852	static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
   853	{
   854		char *opt;
   855		int swap;
   856	
   857		swap = 0;
   858	
   859		sm750_dev->init_parm.chip_clk = 0;
   860		sm750_dev->init_parm.mem_clk = 0;
   861		sm750_dev->init_parm.master_clk = 0;
   862		sm750_dev->init_parm.power_mode = 0;
 > 863		sm750_dev->init_parm.set_all_eng_off = 0;
   864		sm750_dev->init_parm.reset_memory = 1;
   865	
   866		/* defaultly turn g_hwcursor on for both view */
   867		g_hwcursor = 3;
   868	
   869		if (!src || !*src) {
   870			dev_warn(&sm750_dev->pdev->dev, "no specific g_option.\n");
   871			goto NO_PARAM;
   872		}
   873	
   874		while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
   875			dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
   876			dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
   877	
   878			if (!strncmp(opt, "swap", strlen("swap"))) {
   879				swap = 1;
   880			} else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
   881				sm750_dev->nocrt = 1;
   882			} else if (!strncmp(opt, "36bit", strlen("36bit"))) {
   883				sm750_dev->pnltype = SM750_DOUBLE_TFT;
   884			} else if (!strncmp(opt, "18bit", strlen("18bit"))) {
   885				sm750_dev->pnltype = SM750_DUAL_TFT;
   886			} else if (!strncmp(opt, "24bit", strlen("24bit"))) {
   887				sm750_dev->pnltype = SM750_24TFT;
   888			} else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
   889				g_hwcursor &= ~0x1;
   890			} else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
   891				g_hwcursor &= ~0x2;
   892			} else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
   893				g_hwcursor = 0;
   894			} else {
   895				if (!g_fbmode[0]) {
   896					g_fbmode[0] = opt;
   897					dev_info(&sm750_dev->pdev->dev,
   898						 "find fbmode0 : %s\n", g_fbmode[0]);
   899				} else if (!g_fbmode[1]) {
   900					g_fbmode[1] = opt;
   901					dev_info(&sm750_dev->pdev->dev,
   902						 "find fbmode1 : %s\n", g_fbmode[1]);
   903				} else {
   904					dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
   905				}
   906			}
   907		}
   908	
   909	NO_PARAM:
   910		if (sm750_dev->revid != SM750LE_REVISION_ID) {
   911			if (sm750_dev->fb_count > 1) {
   912				if (swap)
   913					sm750_dev->dataflow = sm750_dual_swap;
   914				else
   915					sm750_dev->dataflow = sm750_dual_normal;
   916			} else {
   917				if (swap)
   918					sm750_dev->dataflow = sm750_simul_sec;
   919				else
   920					sm750_dev->dataflow = sm750_simul_pri;
   921			}
   922		} else {
   923			/* SM750LE only have one crt channel */
   924			sm750_dev->dataflow = sm750_simul_sec;
   925			/* sm750le do not have complex attributes */
   926			sm750_dev->nocrt = 0;
   927		}
   928	}
   929	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* Re: [PATCH] staging: sm750: rename CamelCase variable in sm750.c
From: Ahmet Sezgin Duran @ 2026-05-15 17:19 UTC (permalink / raw)
  To: Rupert Zoone, Greg KH
  Cc: M.samet Duman, sudipm.mukherjee, teddy.wang, linux-fbdev,
	linux-staging, linux-kernel
In-Reply-To: <CABpb+S7EcSUnmnCn_aRURnVON39Jyrxe3oktnPphyOFzpaTU0g@mail.gmail.com>

On 5/15/26 7:37 PM, Rupert Zoone wrote:
> Hi Ahmet,
> Yes, I compiled the patch successfully without errors and warnings.
> rupesh@yantra:~/patches/staging$ grep -n "pv_reg\|set_all_eng_off"
> drivers/staging/sm750fb/sm750.c | head -10
> 758: crtc->cursor.mmio = sm750_dev->pv_reg +
> 863: sm750_dev->init_parm.set_all_eng_off = 0;
> 1062: iounmap(sm750_dev->pv_reg);
> 

I asked if you compiled it, you wrote the grep results of variable names.

You might have forgotten to enable the sm750fb module. Make sure that 
you enable it, then please, actually compile the changes, using `make` 
or whatever actual command you use in order to compile.

Spoiler alert: No, it does not compile.

Regards,
Ahmet Sezgin Duran

^ permalink raw reply

* Re: [PATCH v2 2/2] backlight: Add SY7758 6-channel High Efficiency LED Driver support
From: Daniel Thompson @ 2026-05-15 16:28 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Lee Jones, Jingoo Han, Pavel Machek, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Helge Deller, dri-devel,
	linux-leds, devicetree, linux-kernel, linux-fbdev, KancyJoe
In-Reply-To: <20260430-topic-sm8650-ayaneo-pocket-s2-sy7758-v2-2-308140640de9@linaro.org>

On Thu, Apr 30, 2026 at 11:47:16AM +0200, Neil Armstrong wrote:
> From: KancyJoe <kancy2333@outlook.com>
>
> Implement support for the Silergy SY7758 6-channel High Efficiency LED
> Driver used for backlight brightness control in the Ayaneo Pocket S2
> dual-DSI panel.
>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: KancyJoe <kancy2333@outlook.com>
> ---
>  drivers/video/backlight/Kconfig  |   8 +
>  drivers/video/backlight/Makefile |   1 +
>  drivers/video/backlight/sy7758.c | 311 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 320 insertions(+)
> <snip>
> diff --git a/drivers/video/backlight/sy7758.c b/drivers/video/backlight/sy7758.c
> new file mode 100644
> index 000000000000..9b2d3bbb4ded
> --- /dev/null
> +++ b/drivers/video/backlight/sy7758.c
> @@ -0,0 +1,311 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Silergy SY7758 6-channel High Efficiency LED Driver
> + *
> + * Copyright (C) 2025 Kancy Joe <kancy2333@outlook.com>
> + * Copyright (C) 2026 Linaro Limited
> + * Author: Neil Armstrong <neil.armstrong@linaro.org>

I'm a bit confused by this comment. The git author and the
MODULE_AUTHOR() is Kancy Joe. What does this comment signify?


> + */
> <snip>
> +/* OTP memory */
> +#define REG_OTP_CFG98 0x98
> +#define REG_OTP_CFG9E 0x9E
> +#define REG_OTP_CFG0 0xA0
> +#define REG_OTP_CFG1 0xA1
> +#define REG_OTP_CFG2 0xA2
> +#define REG_OTP_CFG3 0xA3
> +#define REG_OTP_CFG4 0xA4
> +#define REG_OTP_CFG5 0xA5
> +#define REG_OTP_CFG6 0xA6
> +#define REG_OTP_CFG7 0xA7
> +#define REG_OTP_CFG9 0xA9
> +#define REG_OTP_CFGA 0xAA
> +#define REG_OTP_CFGE 0xAE

There seems to be a lot of unused macros here, especially
combined with the unused bitfields that tell us how to interpret
the values.

Do we need them?


> <snip>
> +static int sy7758_probe(struct i2c_client *client)
> +{
> +	struct backlight_properties props = { };
> +	struct device *dev = &client->dev;
> +	struct sy7758 *sydev;
> +	unsigned int dev_id;
> +	int ret;
> +
> +	sydev = devm_kzalloc(dev, sizeof(*sydev), GFP_KERNEL);
> +	if (!sydev)
> +		return -ENOMEM;
> +
> +	i2c_set_clientdata(client, sydev);
> +
> +	/* Initialize regmap */
> +	sydev->client = client;
> +	sydev->regmap = devm_regmap_init_i2c(client, &sy7758_regmap_config);
> +	if (IS_ERR(sydev->regmap))
> +		return dev_err_probe(dev, PTR_ERR(sydev->regmap),
> +				     "failed to init regmap\n");
> +
> +	/* Get and enable regulators */
> +	ret = devm_regulator_get_enable(dev, "vddio");
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to get regulator\n");
> +
> +	usleep_range(100, 200);

Any reason not to use fsleep() here?


> +	/* Get enable GPIO and set to high */
> +	sydev->gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
> +	if (IS_ERR(sydev->gpio))
> +		return dev_err_probe(dev, PTR_ERR(sydev->gpio),
> +				     "failed to get enable GPIO\n");
> +
> +	/* Let some time for HW to settle */
> +	usleep_range(10000, 11000);

And here?


> +
> +	/* try read and check device id */
> +	ret = regmap_read(sydev->regmap, REG_DEV_ID, &dev_id);
> +	if (ret < 0)
> +		return dev_err_probe(dev, ret, "failed to read device id\n");
> +	if (dev_id != 0x63) {
> +		dev_err(dev, "unexpected device id: 0x%02x\n", dev_id);
> +		return -ENODEV;
> +	}
> +
> +	/* Initialize and set default brightness */
> +	ret = sy7758_init(sydev);
> +	if (ret)
> +		return ret;
> +
> +	props.type = BACKLIGHT_RAW;
> +	props.max_brightness = MAX_BRIGHTNESS;
> +	props.brightness = DEFAULT_BRIGHTNESS;
> +	props.scale = BACKLIGHT_SCALE_LINEAR;
> +
> +	sydev->bl = devm_backlight_device_register(dev, "sy7758-backlight",
> +						   dev, sydev, &sy7758_backlight_ops,
> +						   &props);
> +	if (IS_ERR(sydev->bl))
> +		return dev_err_probe(dev, PTR_ERR(sydev->bl),
> +				     "failed to register backlight device\n");
> +
> +	return backlight_update_status(sydev->bl);
> +}


Daniel.

^ permalink raw reply

* Re: [PATCH v2 1/2] dt-bindings: leds: backlight: document the SY7758 6-channel High Efficiency LED Driver
From: Daniel Thompson @ 2026-05-15 16:16 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Lee Jones, Jingoo Han, Pavel Machek, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Helge Deller, dri-devel,
	linux-leds, devicetree, linux-kernel, linux-fbdev, KancyJoe,
	Krzysztof Kozlowski
In-Reply-To: <20260430-topic-sm8650-ayaneo-pocket-s2-sy7758-v2-1-308140640de9@linaro.org>

On Thu, Apr 30, 2026 at 11:47:15AM +0200, Neil Armstrong wrote:
> Document the Silergy SY7758 6-channel High Efficiency LED Driver
> used for backlight brightness control.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>

Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>


Daniel.

^ permalink raw reply

* [PATCH 6.6 395/474] firmware: google: framebuffer: Do not unregister platform device
From: Greg Kroah-Hartman @ 2026-05-15 15:48 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Thomas Zimmermann, Tzung-Bi Shih,
	Julius Werner, Javier Martinez Canillas, Hans de Goede,
	linux-fbdev, Sasha Levin
In-Reply-To: <20260515154715.053014143@linuxfoundation.org>

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Zimmermann <tzimmermann@suse.de>

[ Upstream commit 5cd28bd28c8ce426b56ce4230dbd17537181d5ad ]

The native driver takes over the framebuffer aperture by removing the
system- framebuffer platform device. Afterwards the pointer in drvdata
is dangling. Remove the entire logic around drvdata and let the kernel's
aperture helpers handle this. The platform device depends on the native
hardware device instead of the coreboot device anyway.

When commit 851b4c14532d ("firmware: coreboot: Add coreboot framebuffer
driver") added the coreboot framebuffer code, the kernel did not support
device-based aperture management. Instead native driviers only removed
the conflicting fbdev device. At that point, unregistering the framebuffer
device most likely worked correctly. It was definitely broken after
commit d9702b2a2171 ("fbdev/simplefb: Do not use struct
fb_info.apertures"). So take this commit for the Fixes tag. Earlier
releases might work depending on the native hardware driver.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: d9702b2a2171 ("fbdev/simplefb: Do not use struct fb_info.apertures")
Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>
Acked-by: Julius Werner <jwerner@chromium.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Hans de Goede <hansg@kernel.org>
Cc: linux-fbdev@vger.kernel.org
Cc: <stable@vger.kernel.org> # v6.3+
Link: https://patch.msgid.link/20260217155836.96267-2-tzimmermann@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/firmware/google/framebuffer-coreboot.c |   10 ----------
 1 file changed, 10 deletions(-)

--- a/drivers/firmware/google/framebuffer-coreboot.c
+++ b/drivers/firmware/google/framebuffer-coreboot.c
@@ -64,22 +64,12 @@ static int framebuffer_probe(struct core
 						 sizeof(pdata));
 	if (IS_ERR(pdev))
 		pr_warn("coreboot: could not register framebuffer\n");
-	else
-		dev_set_drvdata(&dev->dev, pdev);
 
 	return PTR_ERR_OR_ZERO(pdev);
 }
 
-static void framebuffer_remove(struct coreboot_device *dev)
-{
-	struct platform_device *pdev = dev_get_drvdata(&dev->dev);
-
-	platform_device_unregister(pdev);
-}
-
 static struct coreboot_driver framebuffer_driver = {
 	.probe = framebuffer_probe,
-	.remove = framebuffer_remove,
 	.drv = {
 		.name = "framebuffer",
 	},



^ permalink raw reply

* [PATCH 6.6 394/474] fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info
From: Greg Kroah-Hartman @ 2026-05-15 15:48 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Thomas Zimmermann, Helge Deller,
	linux-fbdev, dri-devel, Sasha Levin
In-Reply-To: <20260515154715.053014143@linuxfoundation.org>

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Zimmermann <tzimmermann@suse.de>

[ Upstream commit 9ded47ad003f09a94b6a710b5c47f4aa5ceb7429 ]

Hold state of deferred I/O in struct fb_deferred_io_state. Allocate an
instance as part of initializing deferred I/O and remove it only after
the final mapping has been closed. If the fb_info and the contained
deferred I/O meanwhile goes away, clear struct fb_deferred_io_state.info
to invalidate the mapping. Any access will then result in a SIGBUS
signal.

Fixes a long-standing problem, where a device hot-unplug happens while
user space still has an active mapping of the graphics memory. The hot-
unplug frees the instance of struct fb_info. Accessing the memory will
operate on undefined state.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 60b59beafba8 ("fbdev: mm: Deferred IO support")
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: stable@vger.kernel.org # v2.6.22+
Signed-off-by: Helge Deller <deller@gmx.de>
[ replaced `kzalloc_obj` with `kzalloc`, and dropped `mutex_destroy(&fbdefio->lock)` ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/video/fbdev/core/fb_defio.c |  179 ++++++++++++++++++++++++++++--------
 include/linux/fb.h                  |    4 
 2 files changed, 145 insertions(+), 38 deletions(-)

--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -23,6 +23,75 @@
 #include <linux/rmap.h>
 #include <linux/pagemap.h>
 
+/*
+ * struct fb_deferred_io_state
+ */
+
+struct fb_deferred_io_state {
+	struct kref ref;
+
+	struct mutex lock; /* mutex that protects the pageref list */
+	/* fields protected by lock */
+	struct fb_info *info;
+};
+
+static struct fb_deferred_io_state *fb_deferred_io_state_alloc(void)
+{
+	struct fb_deferred_io_state *fbdefio_state;
+
+	fbdefio_state = kzalloc(sizeof(*fbdefio_state), GFP_KERNEL);
+	if (!fbdefio_state)
+		return NULL;
+
+	kref_init(&fbdefio_state->ref);
+	mutex_init(&fbdefio_state->lock);
+
+	return fbdefio_state;
+}
+
+static void fb_deferred_io_state_release(struct fb_deferred_io_state *fbdefio_state)
+{
+	mutex_destroy(&fbdefio_state->lock);
+
+	kfree(fbdefio_state);
+}
+
+static void fb_deferred_io_state_get(struct fb_deferred_io_state *fbdefio_state)
+{
+	kref_get(&fbdefio_state->ref);
+}
+
+static void __fb_deferred_io_state_release(struct kref *ref)
+{
+	struct fb_deferred_io_state *fbdefio_state =
+		container_of(ref, struct fb_deferred_io_state, ref);
+
+	fb_deferred_io_state_release(fbdefio_state);
+}
+
+static void fb_deferred_io_state_put(struct fb_deferred_io_state *fbdefio_state)
+{
+	kref_put(&fbdefio_state->ref, __fb_deferred_io_state_release);
+}
+
+/*
+ * struct vm_operations_struct
+ */
+
+static void fb_deferred_io_vm_open(struct vm_area_struct *vma)
+{
+	struct fb_deferred_io_state *fbdefio_state = vma->vm_private_data;
+
+	fb_deferred_io_state_get(fbdefio_state);
+}
+
+static void fb_deferred_io_vm_close(struct vm_area_struct *vma)
+{
+	struct fb_deferred_io_state *fbdefio_state = vma->vm_private_data;
+
+	fb_deferred_io_state_put(fbdefio_state);
+}
+
 static struct page *fb_deferred_io_page(struct fb_info *info, unsigned long offs)
 {
 	void *screen_base = (void __force *) info->screen_base;
@@ -93,17 +162,31 @@ static void fb_deferred_io_pageref_put(s
 /* this is to find and return the vmalloc-ed fb pages */
 static vm_fault_t fb_deferred_io_fault(struct vm_fault *vmf)
 {
+	struct fb_info *info;
 	unsigned long offset;
 	struct page *page;
-	struct fb_info *info = vmf->vma->vm_private_data;
+	vm_fault_t ret;
+	struct fb_deferred_io_state *fbdefio_state = vmf->vma->vm_private_data;
+
+	mutex_lock(&fbdefio_state->lock);
+
+	info = fbdefio_state->info;
+	if (!info) {
+		ret = VM_FAULT_SIGBUS; /* our device is gone */
+		goto err_mutex_unlock;
+	}
 
 	offset = vmf->pgoff << PAGE_SHIFT;
-	if (offset >= info->fix.smem_len)
-		return VM_FAULT_SIGBUS;
+	if (offset >= info->fix.smem_len) {
+		ret = VM_FAULT_SIGBUS;
+		goto err_mutex_unlock;
+	}
 
 	page = fb_deferred_io_page(info, offset);
-	if (!page)
-		return VM_FAULT_SIGBUS;
+	if (!page) {
+		ret = VM_FAULT_SIGBUS;
+		goto err_mutex_unlock;
+	}
 
 	get_page(page);
 
@@ -115,8 +198,15 @@ static vm_fault_t fb_deferred_io_fault(s
 	BUG_ON(!page->mapping);
 	page->index = vmf->pgoff; /* for page_mkclean() */
 
+	mutex_unlock(&fbdefio_state->lock);
+
 	vmf->page = page;
+
 	return 0;
+
+err_mutex_unlock:
+	mutex_unlock(&fbdefio_state->lock);
+	return ret;
 }
 
 int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync)
@@ -143,15 +233,24 @@ EXPORT_SYMBOL_GPL(fb_deferred_io_fsync);
  * Adds a page to the dirty list. Call this from struct
  * vm_operations_struct.page_mkwrite.
  */
-static vm_fault_t fb_deferred_io_track_page(struct fb_info *info, unsigned long offset,
-					    struct page *page)
+static vm_fault_t fb_deferred_io_track_page(struct fb_deferred_io_state *fbdefio_state,
+					    unsigned long offset, struct page *page)
 {
-	struct fb_deferred_io *fbdefio = info->fbdefio;
+	struct fb_info *info;
+	struct fb_deferred_io *fbdefio;
 	struct fb_deferred_io_pageref *pageref;
 	vm_fault_t ret;
 
 	/* protect against the workqueue changing the page list */
-	mutex_lock(&fbdefio->lock);
+	mutex_lock(&fbdefio_state->lock);
+
+	info = fbdefio_state->info;
+	if (!info) {
+		ret = VM_FAULT_SIGBUS; /* our device is gone */
+		goto err_mutex_unlock;
+	}
+
+	fbdefio = info->fbdefio;
 
 	pageref = fb_deferred_io_pageref_get(info, offset, page);
 	if (WARN_ON_ONCE(!pageref)) {
@@ -169,50 +268,38 @@ static vm_fault_t fb_deferred_io_track_p
 	 */
 	lock_page(pageref->page);
 
-	mutex_unlock(&fbdefio->lock);
+	mutex_unlock(&fbdefio_state->lock);
 
 	/* come back after delay to process the deferred IO */
 	schedule_delayed_work(&info->deferred_work, fbdefio->delay);
 	return VM_FAULT_LOCKED;
 
 err_mutex_unlock:
-	mutex_unlock(&fbdefio->lock);
+	mutex_unlock(&fbdefio_state->lock);
 	return ret;
 }
 
-/*
- * fb_deferred_io_page_mkwrite - Mark a page as written for deferred I/O
- * @fb_info: The fbdev info structure
- * @vmf: The VM fault
- *
- * This is a callback we get when userspace first tries to
- * write to the page. We schedule a workqueue. That workqueue
- * will eventually mkclean the touched pages and execute the
- * deferred framebuffer IO. Then if userspace touches a page
- * again, we repeat the same scheme.
- *
- * Returns:
- * VM_FAULT_LOCKED on success, or a VM_FAULT error otherwise.
- */
-static vm_fault_t fb_deferred_io_page_mkwrite(struct fb_info *info, struct vm_fault *vmf)
+static vm_fault_t fb_deferred_io_page_mkwrite(struct fb_deferred_io_state *fbdefio_state,
+					      struct vm_fault *vmf)
 {
 	unsigned long offset = vmf->pgoff << PAGE_SHIFT;
 	struct page *page = vmf->page;
 
 	file_update_time(vmf->vma->vm_file);
 
-	return fb_deferred_io_track_page(info, offset, page);
+	return fb_deferred_io_track_page(fbdefio_state, offset, page);
 }
 
-/* vm_ops->page_mkwrite handler */
 static vm_fault_t fb_deferred_io_mkwrite(struct vm_fault *vmf)
 {
-	struct fb_info *info = vmf->vma->vm_private_data;
+	struct fb_deferred_io_state *fbdefio_state = vmf->vma->vm_private_data;
 
-	return fb_deferred_io_page_mkwrite(info, vmf);
+	return fb_deferred_io_page_mkwrite(fbdefio_state, vmf);
 }
 
 static const struct vm_operations_struct fb_deferred_io_vm_ops = {
+	.open		= fb_deferred_io_vm_open,
+	.close		= fb_deferred_io_vm_close,
 	.fault		= fb_deferred_io_fault,
 	.page_mkwrite	= fb_deferred_io_mkwrite,
 };
@@ -227,7 +314,10 @@ int fb_deferred_io_mmap(struct fb_info *
 	vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP);
 	if (!(info->flags & FBINFO_VIRTFB))
 		vm_flags_set(vma, VM_IO);
-	vma->vm_private_data = info;
+	vma->vm_private_data = info->fbdefio_state;
+
+	fb_deferred_io_state_get(info->fbdefio_state); /* released in vma->vm_ops->close() */
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(fb_deferred_io_mmap);
@@ -238,9 +328,10 @@ static void fb_deferred_io_work(struct w
 	struct fb_info *info = container_of(work, struct fb_info, deferred_work.work);
 	struct fb_deferred_io_pageref *pageref, *next;
 	struct fb_deferred_io *fbdefio = info->fbdefio;
+	struct fb_deferred_io_state *fbdefio_state = info->fbdefio_state;
 
 	/* here we mkclean the pages, then do all deferred IO */
-	mutex_lock(&fbdefio->lock);
+	mutex_lock(&fbdefio_state->lock);
 	list_for_each_entry(pageref, &fbdefio->pagereflist, list) {
 		struct page *cur = pageref->page;
 		lock_page(cur);
@@ -255,12 +346,13 @@ static void fb_deferred_io_work(struct w
 	list_for_each_entry_safe(pageref, next, &fbdefio->pagereflist, list)
 		fb_deferred_io_pageref_put(pageref, info);
 
-	mutex_unlock(&fbdefio->lock);
+	mutex_unlock(&fbdefio_state->lock);
 }
 
 int fb_deferred_io_init(struct fb_info *info)
 {
 	struct fb_deferred_io *fbdefio = info->fbdefio;
+	struct fb_deferred_io_state *fbdefio_state;
 	struct fb_deferred_io_pageref *pagerefs;
 	unsigned long npagerefs, i;
 	int ret;
@@ -270,7 +362,11 @@ int fb_deferred_io_init(struct fb_info *
 	if (WARN_ON(!info->fix.smem_len))
 		return -EINVAL;
 
-	mutex_init(&fbdefio->lock);
+	fbdefio_state = fb_deferred_io_state_alloc();
+	if (!fbdefio_state)
+		return -ENOMEM;
+	fbdefio_state->info = info;
+
 	INIT_DELAYED_WORK(&info->deferred_work, fb_deferred_io_work);
 	INIT_LIST_HEAD(&fbdefio->pagereflist);
 	if (fbdefio->delay == 0) /* set a default of 1 s */
@@ -289,10 +385,12 @@ int fb_deferred_io_init(struct fb_info *
 	info->npagerefs = npagerefs;
 	info->pagerefs = pagerefs;
 
+	info->fbdefio_state = fbdefio_state;
+
 	return 0;
 
 err:
-	mutex_destroy(&fbdefio->lock);
+	fb_deferred_io_state_release(fbdefio_state);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(fb_deferred_io_init);
@@ -333,11 +431,18 @@ EXPORT_SYMBOL_GPL(fb_deferred_io_release
 
 void fb_deferred_io_cleanup(struct fb_info *info)
 {
-	struct fb_deferred_io *fbdefio = info->fbdefio;
+	struct fb_deferred_io_state *fbdefio_state = info->fbdefio_state;
 
 	fb_deferred_io_lastclose(info);
 
+	info->fbdefio_state = NULL;
+
+	mutex_lock(&fbdefio_state->lock);
+	fbdefio_state->info = NULL;
+	mutex_unlock(&fbdefio_state->lock);
+
+	fb_deferred_io_state_put(fbdefio_state);
+
 	kvfree(info->pagerefs);
-	mutex_destroy(&fbdefio->lock);
 }
 EXPORT_SYMBOL_GPL(fb_deferred_io_cleanup);
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -214,11 +214,12 @@ struct fb_deferred_io {
 	unsigned long delay;
 	bool sort_pagereflist; /* sort pagelist by offset */
 	int open_count; /* number of opened files; protected by fb_info lock */
-	struct mutex lock; /* mutex that protects the pageref list */
 	struct list_head pagereflist; /* list of pagerefs for touched pages */
 	/* callback */
 	void (*deferred_io)(struct fb_info *info, struct list_head *pagelist);
 };
+
+struct fb_deferred_io_state;
 #endif
 
 /*
@@ -476,6 +477,7 @@ struct fb_info {
 	unsigned long npagerefs;
 	struct fb_deferred_io_pageref *pagerefs;
 	struct fb_deferred_io *fbdefio;
+	struct fb_deferred_io_state *fbdefio_state;
 #endif
 
 	const struct fb_ops *fbops;



^ permalink raw reply

* Re: [PATCH] staging: sm750: rename CamelCase variable in sm750.c
From: Greg KH @ 2026-05-15 13:13 UTC (permalink / raw)
  To: M.samet Duman
  Cc: Ahmet Sezgin Duran, Rupesh Majhi, sudipm.mukherjee, teddy.wang,
	linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <5A8D2A45-3C03-4D41-96BB-4F2ECC499813@icloud.com>

On Fri, May 15, 2026 at 03:59:18PM +0300, M.samet Duman wrote:
> 
> Not a change that will set the world on fire.

Please only provide useful review comments.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH] staging: sm750: rename CamelCase variable in sm750.c
From: M.samet Duman @ 2026-05-15 12:59 UTC (permalink / raw)
  To: Ahmet Sezgin Duran
  Cc: Rupesh Majhi, gregkh, sudipm.mukherjee, teddy.wang, linux-fbdev,
	linux-staging, linux-kernel
In-Reply-To: <03e9e75a-c63c-4a63-88b8-2287daf6c4ad@sezginduran.net>


Not a change that will set the world on fire.

--
Samet

> 2026. 5. 15. 오후 2:46, Ahmet Sezgin Duran <ahmet@sezginduran.net> 작성:
> 
> On 5/15/26 1:38 PM, Rupesh Majhi wrote:
>> Renamed the following CamelCase variables to snake_case to comply
>> with Linux kernel coding style:
>> - pvReg -> pv_reg
>> - setAllEngOff -> set_all_eng_off
>> Issue found by checkpatch.
>> Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
>> ---
>>  drivers/staging/sm750fb/sm750.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
>> index 996a586a3727..9b30627a19d0 100644
>> --- a/drivers/staging/sm750fb/sm750.c
>> +++ b/drivers/staging/sm750fb/sm750.c
>> @@ -755,7 +755,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
>>       * must be set after crtc member initialized
>>       */
>>      crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
>> -    crtc->cursor.mmio = sm750_dev->pvReg +
>> +    crtc->cursor.mmio = sm750_dev->pv_reg +
>>          0x800f0 + (int)crtc->channel * 0x140;
>>        crtc->cursor.max_h = 64;
>> @@ -860,7 +860,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
>>      sm750_dev->init_parm.mem_clk = 0;
>>      sm750_dev->init_parm.master_clk = 0;
>>      sm750_dev->init_parm.power_mode = 0;
>> -    sm750_dev->init_parm.setAllEngOff = 0;
>> +    sm750_dev->init_parm.set_all_eng_off = 0;
>>      sm750_dev->init_parm.reset_memory = 1;
>>        /* defaultly turn g_hwcursor on for both view */
>> @@ -1059,7 +1059,7 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
>>      sm750fb_framebuffer_release(sm750_dev);
>>      arch_phys_wc_del(sm750_dev->mtrr.vram);
>>  -    iounmap(sm750_dev->pvReg);
>> +    iounmap(sm750_dev->pv_reg);
>>      iounmap(sm750_dev->vmem);
>>      pci_release_region(pdev, 1);
>>      kfree(g_settings);
> 
> Did you compile this patch?
> 
> Regards,
> Ahmet Sezgin Duran
> 

^ permalink raw reply

* Re: [PATCH] staging: sm750: rename CamelCase variable in sm750.c
From: Ahmet Sezgin Duran @ 2026-05-15 11:18 UTC (permalink / raw)
  To: Rupesh Majhi, gregkh
  Cc: sudipm.mukherjee, teddy.wang, linux-fbdev, linux-staging,
	linux-kernel
In-Reply-To: <20260515103811.2808620-1-zoone.rupert@gmail.com>

On 5/15/26 1:38 PM, Rupesh Majhi wrote:
> Renamed the following CamelCase variables to snake_case to comply
> with Linux kernel coding style:
> - pvReg -> pv_reg
> - setAllEngOff -> set_all_eng_off
> 
> Issue found by checkpatch.
> 
> Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
> ---
>   drivers/staging/sm750fb/sm750.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 996a586a3727..9b30627a19d0 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -755,7 +755,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
>   	 * must be set after crtc member initialized
>   	 */
>   	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
> -	crtc->cursor.mmio = sm750_dev->pvReg +
> +	crtc->cursor.mmio = sm750_dev->pv_reg +
>   		0x800f0 + (int)crtc->channel * 0x140;
>   
>   	crtc->cursor.max_h = 64;
> @@ -860,7 +860,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
>   	sm750_dev->init_parm.mem_clk = 0;
>   	sm750_dev->init_parm.master_clk = 0;
>   	sm750_dev->init_parm.power_mode = 0;
> -	sm750_dev->init_parm.setAllEngOff = 0;
> +	sm750_dev->init_parm.set_all_eng_off = 0;
>   	sm750_dev->init_parm.reset_memory = 1;
>   
>   	/* defaultly turn g_hwcursor on for both view */
> @@ -1059,7 +1059,7 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
>   	sm750fb_framebuffer_release(sm750_dev);
>   	arch_phys_wc_del(sm750_dev->mtrr.vram);
>   
> -	iounmap(sm750_dev->pvReg);
> +	iounmap(sm750_dev->pv_reg);
>   	iounmap(sm750_dev->vmem);
>   	pci_release_region(pdev, 1);
>   	kfree(g_settings);

Did you compile this patch?

Regards,
Ahmet Sezgin Duran

^ permalink raw reply

* [PATCH] staging: sm750: rename CamelCase variable in sm750.c
From: Rupesh Majhi @ 2026-05-15 10:38 UTC (permalink / raw)
  To: gregkh
  Cc: sudipm.mukherjee, teddy.wang, linux-fbdev, linux-staging,
	linux-kernel, Rupesh Majhi

Renamed the following CamelCase variables to snake_case to comply
with Linux kernel coding style:
- pvReg -> pv_reg
- setAllEngOff -> set_all_eng_off

Issue found by checkpatch.

Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 996a586a3727..9b30627a19d0 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -755,7 +755,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 	 * must be set after crtc member initialized
 	 */
 	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
-	crtc->cursor.mmio = sm750_dev->pvReg +
+	crtc->cursor.mmio = sm750_dev->pv_reg +
 		0x800f0 + (int)crtc->channel * 0x140;
 
 	crtc->cursor.max_h = 64;
@@ -860,7 +860,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
 	sm750_dev->init_parm.mem_clk = 0;
 	sm750_dev->init_parm.master_clk = 0;
 	sm750_dev->init_parm.power_mode = 0;
-	sm750_dev->init_parm.setAllEngOff = 0;
+	sm750_dev->init_parm.set_all_eng_off = 0;
 	sm750_dev->init_parm.reset_memory = 1;
 
 	/* defaultly turn g_hwcursor on for both view */
@@ -1059,7 +1059,7 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
 	sm750fb_framebuffer_release(sm750_dev);
 	arch_phys_wc_del(sm750_dev->mtrr.vram);
 
-	iounmap(sm750_dev->pvReg);
+	iounmap(sm750_dev->pv_reg);
 	iounmap(sm750_dev->vmem);
 	pci_release_region(pdev, 1);
 	kfree(g_settings);
-- 
2.43.0


^ permalink raw reply related

* Re: [PATCH 01/14] fbdev: hecubafb: fix potential memory leak in hecubafb_probe()
From: Thomas Zimmermann @ 2026-05-15  7:57 UTC (permalink / raw)
  To: Abdun Nihaal, Helge Deller, Javier Martinez Canillas,
	Benjamin Herrenschmidt, Andrew Morton, Sebastian Siewior,
	Florian Tobias Schandinat, Ondrej Zary, Antonino Daplas,
	Paul Mundt, Krzysztof Helt, Tomi Valkeinen, Michal Januszewski,
	Heiko Schocher, Peter Jones
  Cc: linux-fbdev, dri-devel, linux-kernel, stable
In-Reply-To: <20260514-fbdev-v1-1-b3a2474fa720@cse.iitm.ac.in>



Am 14.05.26 um 10:24 schrieb Abdun Nihaal:
> The memory allocated for pagerefs in fb_deferred_io_init() is not freed
> on the error path. Fix it by calling fb_deferred_io_cleanup().
>
> Fixes: 56c134f7f1b5 ("fbdev: Track deferred-I/O pages in pageref struct")
> Cc: stable@vger.kernel.org
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/video/fbdev/hecubafb.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/hecubafb.c b/drivers/video/fbdev/hecubafb.c
> index 3547d58a29cf..dd2af980f3d8 100644
> --- a/drivers/video/fbdev/hecubafb.c
> +++ b/drivers/video/fbdev/hecubafb.c
> @@ -192,7 +192,9 @@ static int hecubafb_probe(struct platform_device *dev)
>   	info->flags = FBINFO_VIRTFB;
>   
>   	info->fbdefio = &hecubafb_defio;
> -	fb_deferred_io_init(info);
> +	retval = fb_deferred_io_init(info);
> +	if (retval)
> +		goto err_fbdefio;
>   
>   	retval = register_framebuffer(info);
>   	if (retval < 0)
> @@ -209,6 +211,8 @@ static int hecubafb_probe(struct platform_device *dev)
>   
>   	return 0;
>   err_fbreg:
> +	fb_deferred_io_cleanup(info);
> +err_fbdefio:
>   	framebuffer_release(info);
>   err_fballoc:
>   	vfree(videomemory);
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply

* Re: [PATCH 02/14] fbdev: broadsheetfb: fix potential memory leak in broadsheetfb_probe()
From: Thomas Zimmermann @ 2026-05-15  7:56 UTC (permalink / raw)
  To: Abdun Nihaal, Helge Deller, Javier Martinez Canillas,
	Benjamin Herrenschmidt, Andrew Morton, Sebastian Siewior,
	Florian Tobias Schandinat, Ondrej Zary, Antonino Daplas,
	Paul Mundt, Krzysztof Helt, Tomi Valkeinen, Michal Januszewski,
	Heiko Schocher, Peter Jones
  Cc: linux-fbdev, dri-devel, linux-kernel, stable
In-Reply-To: <20260514-fbdev-v1-2-b3a2474fa720@cse.iitm.ac.in>



Am 14.05.26 um 10:24 schrieb Abdun Nihaal:
> The memory allocated for pagerefs in fb_deferred_io_init() is not freed
> on the error path. Fix it by calling fb_deferred_io_cleanup().
>
> Fixes: 56c134f7f1b5 ("fbdev: Track deferred-I/O pages in pageref struct")
> Cc: stable@vger.kernel.org
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/video/fbdev/broadsheetfb.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/broadsheetfb.c b/drivers/video/fbdev/broadsheetfb.c
> index c8ba098a8c42..582f1ee4c9b6 100644
> --- a/drivers/video/fbdev/broadsheetfb.c
> +++ b/drivers/video/fbdev/broadsheetfb.c
> @@ -1072,12 +1072,14 @@ static int broadsheetfb_probe(struct platform_device *dev)
>   	info->flags = FBINFO_VIRTFB;
>   
>   	info->fbdefio = &broadsheetfb_defio;
> -	fb_deferred_io_init(info);
> +	retval = fb_deferred_io_init(info);
> +	if (retval)
> +		goto err_vfree;
>   
>   	retval = fb_alloc_cmap(&info->cmap, 16, 0);
>   	if (retval < 0) {
>   		dev_err(&dev->dev, "Failed to allocate colormap\n");
> -		goto err_vfree;
> +		goto err_fbdefio;
>   	}
>   
>   	/* set cmap */
> @@ -1121,6 +1123,8 @@ static int broadsheetfb_probe(struct platform_device *dev)
>   	board->cleanup(par);
>   err_cmap:
>   	fb_dealloc_cmap(&info->cmap);
> +err_fbdefio:
> +	fb_deferred_io_cleanup(info);
>   err_vfree:
>   	vfree(videomemory);
>   err_fb_rel:
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply

* Re: [PATCH 1/2] dt-bindings: leds: backlight: add Silergy SY7758
From: Krzysztof Kozlowski @ 2026-05-15  7:37 UTC (permalink / raw)
  To: Alexandre Hamamdjian
  Cc: Philippe Simons, Lee Jones, Daniel Thompson, Jingoo Han,
	Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Helge Deller, dri-devel, linux-leds, devicetree, linux-kernel,
	linux-fbdev
In-Reply-To: <20260511-sy7758-v1-1-999a33081304@gmail.com>

On Mon, May 11, 2026 at 12:08:02AM +0700, Alexandre Hamamdjian wrote:
> The Silergy SY7758 is an I2C-controlled multi-channel LED backlight
> driver typically used to drive the edge-lit LED strings of LCD panels
> in handheld and embedded devices. Brightness is programmed as a 12-bit
> linear value through two 8-bit registers.
> 
> Document the binding for the new compatible "silergy,sy7758" so it can
> be referenced by board device trees and the matching driver, and add a
> MAINTAINERS entry covering both the binding and the upcoming driver.
> 
> Co-developed-by: Philippe Simons <simons.philippe@gmail.com>
> Signed-off-by: Philippe Simons <simons.philippe@gmail.com>
> Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
> ---
>  .../bindings/leds/backlight/silergy,sy7758.yaml    | 47 ++++++++++++++++++++++

This was already sent two weeks ago:
<20260430-topic-sm8650-ayaneo-pocket-s2-sy7758-v2-1-308140640de9@linaro.org>
and that posting looks closer to complete.

Best regards,
Krzysztof


^ permalink raw reply

* Re: [PATCH 03/14] fbdev: metronomefb: fix potential memory leak in metronomefb_probe()
From: Thomas Zimmermann @ 2026-05-15  7:18 UTC (permalink / raw)
  To: Abdun Nihaal, Helge Deller, Javier Martinez Canillas,
	Benjamin Herrenschmidt, Andrew Morton, Sebastian Siewior,
	Florian Tobias Schandinat, Ondrej Zary, Antonino Daplas,
	Paul Mundt, Krzysztof Helt, Tomi Valkeinen, Michal Januszewski,
	Heiko Schocher, Peter Jones
  Cc: linux-fbdev, dri-devel, linux-kernel, stable
In-Reply-To: <20260514-fbdev-v1-3-b3a2474fa720@cse.iitm.ac.in>



Am 14.05.26 um 10:24 schrieb Abdun Nihaal:
> The memory allocated for pagerefs in fb_deferred_io_init() is not freed
> on the error path. Fix it by calling fb_deferred_io_cleanup().
>
> Fixes: 56c134f7f1b5 ("fbdev: Track deferred-I/O pages in pageref struct")
> Cc: stable@vger.kernel.org
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/video/fbdev/metronomefb.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/metronomefb.c b/drivers/video/fbdev/metronomefb.c
> index 6f0942c6e5f1..83c614963a0a 100644
> --- a/drivers/video/fbdev/metronomefb.c
> +++ b/drivers/video/fbdev/metronomefb.c
> @@ -645,12 +645,14 @@ static int metronomefb_probe(struct platform_device *dev)
>   	info->flags = FBINFO_VIRTFB;
>   
>   	info->fbdefio = &metronomefb_defio;
> -	fb_deferred_io_init(info);
> +	retval = fb_deferred_io_init(info);
> +	if (retval)
> +		goto err_free_irq;
>   
>   	retval = fb_alloc_cmap(&info->cmap, 8, 0);
>   	if (retval < 0) {
>   		dev_err(&dev->dev, "Failed to allocate colormap\n");
> -		goto err_free_irq;
> +		goto err_fbdefio;
>   	}
>   
>   	/* set cmap */
> @@ -673,6 +675,8 @@ static int metronomefb_probe(struct platform_device *dev)
>   
>   err_cmap:
>   	fb_dealloc_cmap(&info->cmap);
> +err_fbdefio:
> +	fb_deferred_io_cleanup(info);
>   err_free_irq:
>   	board->cleanup(par);
>   err_csum_table:
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply

* Re: [PATCH 13/14] fbdev: vesafb: fix memory leak in vesafb_probe()
From: Thomas Zimmermann @ 2026-05-15  7:17 UTC (permalink / raw)
  To: Abdun Nihaal, Helge Deller, Javier Martinez Canillas,
	Benjamin Herrenschmidt, Andrew Morton, Sebastian Siewior,
	Florian Tobias Schandinat, Ondrej Zary, Antonino Daplas,
	Paul Mundt, Krzysztof Helt, Tomi Valkeinen, Michal Januszewski,
	Heiko Schocher, Peter Jones
  Cc: linux-fbdev, dri-devel, linux-kernel, stable
In-Reply-To: <20260514-fbdev-v1-13-b3a2474fa720@cse.iitm.ac.in>



Am 14.05.26 um 10:24 schrieb Abdun Nihaal:
> Since commit 73ce73c30ba9 ("fbdev: Transfer video= option strings to
> caller; clarify ownership") the string returned from fb_get_options()
> is expected to be freed by the caller. But the string is not freed in
> vesafb_probe(). Fix that by freeing the option string after setup.
>
> Fixes: 73ce73c30ba9 ("fbdev: Transfer video= option strings to caller; clarify ownership")
> Cc: stable@vger.kernel.org
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/video/fbdev/vesafb.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c
> index f84f4db244bf..f1902056bd73 100644
> --- a/drivers/video/fbdev/vesafb.c
> +++ b/drivers/video/fbdev/vesafb.c
> @@ -269,6 +269,7 @@ static int vesafb_probe(struct platform_device *dev)
>   	/* ignore error return of fb_get_options */
>   	fb_get_options("vesafb", &option);
>   	vesafb_setup(option);
> +	kfree(option);
>   
>   	if (si->orig_video_isVGA != VIDEO_TYPE_VLFB)
>   		return -ENODEV;
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply

* Re: [PATCH 12/14] fbdev: efifb: fix memory leak in efifb_probe()
From: Thomas Zimmermann @ 2026-05-15  7:16 UTC (permalink / raw)
  To: Abdun Nihaal, Helge Deller, Javier Martinez Canillas,
	Benjamin Herrenschmidt, Andrew Morton, Sebastian Siewior,
	Florian Tobias Schandinat, Ondrej Zary, Antonino Daplas,
	Paul Mundt, Krzysztof Helt, Tomi Valkeinen, Michal Januszewski,
	Heiko Schocher, Peter Jones
  Cc: linux-fbdev, dri-devel, linux-kernel, stable
In-Reply-To: <20260514-fbdev-v1-12-b3a2474fa720@cse.iitm.ac.in>

Hi

Am 14.05.26 um 10:24 schrieb Abdun Nihaal:
> Since commit 73ce73c30ba9 ("fbdev: Transfer video= option strings to
> caller; clarify ownership") the string returned from fb_get_options()
> is expected to be freed by the caller, but the string is not freed in
> efifb_probe(). Fix that by freeing the option string after setup.
>
> Fixes: 73ce73c30ba9 ("fbdev: Transfer video= option strings to caller; clarify ownership")

Right, the commit message even mentions the (pre-existing) leak. There 
might be other drivers with a similar issue.

> Cc: stable@vger.kernel.org
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/video/fbdev/efifb.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
> index 47ebc0107209..ad8dec7807c3 100644
> --- a/drivers/video/fbdev/efifb.c
> +++ b/drivers/video/fbdev/efifb.c
> @@ -377,6 +377,7 @@ static int efifb_probe(struct platform_device *dev)
>   	if (fb_get_options("efifb", &option))
>   		return -ENODEV;
>   	efifb_setup(si, option);
> +	kfree(option);
>   
>   	/* We don't get linelength from UGA Draw Protocol, only from
>   	 * EFI Graphics Protocol.  So if it's not in DMI, and it's not
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply

* Re: [PATCH] fbcon: Use correct type for vc_resize() return value
From: Thomas Zimmermann @ 2026-05-15  7:12 UTC (permalink / raw)
  To: Jiacheng Yu, deller, simona
  Cc: sravankumarlpu, dri-devel, linux-fbdev, linux-kernel,
	liuyongqiang13
In-Reply-To: <20260514091918.1607234-1-yujiacheng3@huawei.com>



Am 14.05.26 um 11:19 schrieb Jiacheng Yu:
> The return value of vc_resize() is int, but fbcon_set_disp() stores it
> in an unsigned long variable. While the !ret check happens to work
> correctly by coincidence (negative values become large positive values),
> the types should match. Use int instead.
>
> Eliminates the following W=3 warning:
>
>    drivers/video/fbdev/core/fbcon.c: In function 'fbcon_set_disp':
>    drivers/video/fbdev/core/fbcon.c:1494:14: warning: implicit conversion from 'int' to 'unsigned long' [-Wconversion]
>
> Fixes: af0db3c1f898 ("fbdev: Fix vmalloc out-of-bounds write in fast_imageblit")
> Signed-off-by: Jiacheng Yu <yujiacheng3@huawei.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

Thanks for the patch.

> ---
>   drivers/video/fbdev/core/fbcon.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index b0e3e765360d..641687a734d5 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -1440,8 +1440,7 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
>   	struct vc_data **default_mode, *vc;
>   	struct vc_data *svc;
>   	struct fbcon_par *par = info->fbcon_par;
> -	int rows, cols;
> -	unsigned long ret = 0;
> +	int rows, cols, ret;
>   
>   	p = &fb_display[unit];
>   

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply

* [PATCH] video: fbdev: sm712: Fix operator precedence in big_swap macro
From: lirongqing @ 2026-05-15  1:02 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Helge Deller, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

The big_swap(p) macro was intended to swap bytes within 16-bit halves
of a 32-bit value. However, because the bitwise shift operators (<<, >>)
have higher precedence than the bitwise AND operator (&), the original
code failed to perform any shifting on the masked bits.

For example, 'p & 0xff00ff00 >> 8' was evaluated as 'p &
(0xff00ff00 >> 8)', effectively neutralizing the intended swap.

Fix this by adding parentheses to ensure the bitwise AND is performed
before the shift, correctly implementing the byte swap logic.

Fixes: 1461d66728648 ("staging: sm7xxfb: merge sm712fb with fbdev")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 drivers/video/fbdev/sm712.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/sm712.h b/drivers/video/fbdev/sm712.h
index c7ebf03..83fe25f 100644
--- a/drivers/video/fbdev/sm712.h
+++ b/drivers/video/fbdev/sm712.h
@@ -101,7 +101,7 @@ struct modeinit {
 #define mmio_addr		0x00800000
 #define seqw17()		smtc_seqw(0x17, 0x30)
 #define big_pixel_depth(p, d)	{if (p == 24) {p = 32; d = 32; } }
-#define big_swap(p)		((p & 0xff00ff00 >> 8) | (p & 0x00ff00ff << 8))
+#define big_swap(p)		(((p & 0xff00ff00) >> 8) | ((p & 0x00ff00ff) << 8))
 #else
 #define pal_rgb(r, g, b, val)	val
 #define big_addr		0
-- 
2.9.4


^ permalink raw reply related

* Re: [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit
From: Greg Kroah-Hartman @ 2026-05-14 12:41 UTC (permalink / raw)
  To: Chhabilal Dangal; +Cc: Sudip Mukherjee, linux-fbdev, linux-staging, devel
In-Reply-To: <20260514120102.71615-1-yogeshdangal66@gmail.com>

On Thu, May 14, 2026 at 05:46:02PM +0545, Chhabilal Dangal wrote:
> lynxfb_ops_fillrect() already checks info->state before accessing
> the hardware 2D engine, but lynxfb_ops_copyarea() and
> lynxfb_ops_imageblit() do not.
> 
> The suspend path calls fb_set_suspend(), which sets the framebuffer
> state to FBINFO_STATE_SUSPENDED. Add matching state checks in the
> remaining accelerated callbacks for consistency with fillrect().
> 
> Assisted-by: Claude Opus 4.6 (Anthropic LLM)
> Compile-tested only.
> 
> Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
> ---
>  drivers/staging/sm750fb/sm750.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 9f3e3d37e..025ac8fe3 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -204,6 +204,9 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
>  	struct sm750_dev *sm750_dev;
>  	unsigned int base, pitch, bpp;
>  
> +	if (info->state != FBINFO_STATE_RUNNING)
> +		return;
> +
>  	par = info->par;
>  	sm750_dev = par->dev;
>  
> @@ -239,6 +242,9 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
>  	struct lynxfb_par *par;
>  	struct sm750_dev *sm750_dev;
>  
> +	if (info->state != FBINFO_STATE_RUNNING)
> +		return;
> +
>  	par = info->par;
>  	sm750_dev = par->dev;
>  	/*
> -- 
> 2.54.0
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/process/submitting-patches.rst for what
  needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply

* Re: [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit
From: Dan Carpenter @ 2026-05-14 12:18 UTC (permalink / raw)
  To: Chhabilal Dangal
  Cc: Greg Kroah-Hartman, Sudip Mukherjee, linux-fbdev, linux-staging,
	devel
In-Reply-To: <20260514120102.71615-1-yogeshdangal66@gmail.com>

On Thu, May 14, 2026 at 05:46:02PM +0545, Chhabilal Dangal wrote:


> The suspend path calls fb_set_suspend(), which sets the framebuffer
> state to FBINFO_STATE_SUSPENDED. Add matching state checks in the
> remaining accelerated callbacks for consistency with fillrect().

This is stating obvious but unrelated things as if it means something.
It feels like information but it's a waste of time.  fillrect() does
not mirror fb_set_suspend().  This whole paragraph is garbage.

> lynxfb_ops_fillrect() already checks info->state before accessing
> the hardware 2D engine, but lynxfb_ops_copyarea() and
> lynxfb_ops_imageblit() do not.
> 

This paragraph is useful because it gives the motivation. But last
time you hadn't checked that the AI was correct.  You're just leaving
it up to us to check.  Why is your time more valuable than our time
that you can't be bothered to check this stuff?

We need to know:
1) Is the AI correct this time?
2) What is the implication of the bug.

Please do this research on your own, don't just enter my questions into
an AI.

3) Wouldn't it be better to do it at a lower level?

Smatch says that out of the callers only fbcon_bmove_rec(), ypan_up()
and ypan_down() don't check.  So check those to see if this is a
real bug.

drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |      fbcon_bmove_rec | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |    fbcon_redraw_blit | (struct fbcon_bitops)->bmove |        PARAM_VALUE |  1 |     info->state | 0
drivers/video/fbdev/core/fbcon.c |              ypan_up | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)
drivers/video/fbdev/core/fbcon.c |            ypan_down | (struct fbcon_bitops)->bmove |           INTERNAL | -1 |                 | void(*)(struct vc_data*, struct fb_info*, int, int, int, int, int, int)

> 
> Assisted-by: Claude Opus 4.6 (Anthropic LLM)
> Compile-tested only.

Put this under the --- cut off line.

> 
> Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
> ---
  ^^^
Here.

No Fixes tag.
Please wait a day between resends.

regards,
dan carpenter


^ permalink raw reply

* [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit
From: Chhabilal Dangal @ 2026-05-14 12:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sudip Mukherjee
  Cc: linux-fbdev, linux-staging, devel, Chhabilal Dangal

lynxfb_ops_fillrect() already checks info->state before accessing
the hardware 2D engine, but lynxfb_ops_copyarea() and
lynxfb_ops_imageblit() do not.

The suspend path calls fb_set_suspend(), which sets the framebuffer
state to FBINFO_STATE_SUSPENDED. Add matching state checks in the
remaining accelerated callbacks for consistency with fillrect().

Assisted-by: Claude Opus 4.6 (Anthropic LLM)
Compile-tested only.

Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e..025ac8fe3 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -204,6 +204,9 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
 	struct sm750_dev *sm750_dev;
 	unsigned int base, pitch, bpp;
 
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
+
 	par = info->par;
 	sm750_dev = par->dev;
 
@@ -239,6 +242,9 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 	struct lynxfb_par *par;
 	struct sm750_dev *sm750_dev;
 
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
+
 	par = info->par;
 	sm750_dev = par->dev;
 	/*
-- 
2.54.0


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox