staging: sm750fb: Add suspend checks to copyarea and imageblit
PATCH 1/1 staging: sm750fb: Add suspend checks to copyarea and imageblit
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().
Compile-tested only.
--- drivers/staging/sm750fb/sm750.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/staging/sm750fb/sm750.c +6 -0
@@ -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;/*
Signature · 1 line
2.54.0
Quoted 3 lines · Chhabilal Dangal
The suspend path calls
fb_set_suspend(), which sets the framebuffer state toFBINFO_STATE_SUSPENDED. Add matching state checks in the remaining accelerated callbacks for consistency withfillrect().
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.
Quoted 4 lines
lynxfb_ops_fillrect()already checksinfo->statebefore accessing the hardware 2D engine, butlynxfb_ops_copyarea()andlynxfb_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)
Quoted 3 lines
Assisted-by Claude Opus 4.6 (Anthropic LLM)Compile-tested only.
Put this under the --- cut off line.
Quoted 3 lines
Signed-off-by Chhabilal Dangal <[email protected]>---
^^^
Here.
No Fixes tag.
Please wait a day between resends.
regards,
dan carpenter
Greg Kroah-Hartman
maintainerQuoted 44 lines · Chhabilal Dangal
lynxfb_ops_fillrect()already checksinfo->statebefore accessing the hardware 2D engine, butlynxfb_ops_copyarea()andlynxfb_ops_imageblit()do not.The suspend path calls
fb_set_suspend(), which sets the framebuffer state toFBINFO_STATE_SUSPENDED. Add matching state checks in the remaining accelerated callbacks for consistency withfillrect().Assisted-by Claude Opus 4.6 (Anthropic LLM)Compile-tested only.
Signed-off-by Chhabilal Dangal <[email protected]>--- drivers/staging/sm750fb/sm750.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/staging/sm750fb/sm750.c +6
-0@@ -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;/* Signature · 1 line
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