Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit
@ 2026-05-14 12:01 Chhabilal Dangal
  2026-05-14 12:18 ` Dan Carpenter
  2026-05-14 12:41 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 3+ messages in thread
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	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit
  2026-05-14 12:01 [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit Chhabilal Dangal
@ 2026-05-14 12:18 ` Dan Carpenter
  2026-05-14 12:41 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
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

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	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit
  2026-05-14 12:01 [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit Chhabilal Dangal
  2026-05-14 12:18 ` Dan Carpenter
@ 2026-05-14 12:41 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2026-05-14 12:41 UTC (permalink / raw)
  To: Chhabilal Dangal; +Cc: Sudip Mukherjee, linux-fbdev, linux-staging, devel

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	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-14 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14 12:01 [PATCH] staging: sm750fb: Add suspend checks to copyarea and imageblit Chhabilal Dangal
2026-05-14 12:18 ` Dan Carpenter
2026-05-14 12:41 ` Greg Kroah-Hartman

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