Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH] fbdev: udlfb: validate vendor descriptor items
From: Helge Deller @ 2026-07-18 18:26 UTC (permalink / raw)
  To: Pengpeng Hou, Bernie Thompson; +Cc: linux-fbdev, dri-devel, linux-kernel
In-Reply-To: <20260706093038.80131-1-pengpeng@iscas.ac.cn>

On 7/6/26 11:30, Pengpeng Hou wrote:
> dlfb_parse_vendor_descriptor() walks key-length-value items inside the
> DisplayLink vendor descriptor.
> 
> Require each item to contain its key, length and declared value bytes
> before reading item-specific fields such as max_area.
> 
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
>   drivers/video/fbdev/udlfb.c | 22 ++++++++++++++++------
>   1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
> index fdbb8671a810..e78d6f95c9c5 100644
> --- a/drivers/video/fbdev/udlfb.c
> +++ b/drivers/video/fbdev/udlfb.c
> @@ -1586,19 +1586,29 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dlfb,
>   		desc += 5; /* the fixed header we've already parsed */
>   
>   		while (desc < desc_end) {
> +			char *value;
>   			u8 length;
>   			u16 key;
>   
> -			key = *desc++;
> -			key |= (u16)*desc++ << 8;
> +			if (desc_end - desc < sizeof(key) + sizeof(length))
> +				goto unrecognized;
> +
> +			key = get_unaligned_le16(desc);

Is there a reason why you switch to unconditional little-endian reads?
Is this "vendor descriptor" always little-endian?
If yes, then your patch is probably correct.
If not, I think your patch will most likely break big-endian machines.

Helge

> +			desc += sizeof(key);
>   			length = *desc++;
>   
> +			if (length > desc_end - desc)
> +				goto unrecognized;
> +
> +			value = desc;
>   			switch (key) {
>   			case 0x0200: { /* max_area */
> -				u32 max_area = *desc++;
> -				max_area |= (u32)*desc++ << 8;
> -				max_area |= (u32)*desc++ << 16;
> -				max_area |= (u32)*desc++ << 24;
> +				u32 max_area;
> +
> +				if (length < sizeof(max_area))
> +					goto unrecognized;
> +
> +				max_area = get_unaligned_le32(value);
>   				dev_warn(&intf->dev,
>   					 "DL chip limited to %d pixel modes\n",
>   					 max_area);


^ permalink raw reply

* [PATCH] staging: fbtft: fix checkpatch errors in fbtft-bus.c
From: Shivesh @ 2026-07-18 18:23 UTC (permalink / raw)
  To: andy, gregkh; +Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]

From 7e9684b26176644bc92c2285acc7444f3f7ddb4d Mon Sep 17 00:00:00 2001
From: Shivesh <chanelshivesh@gmail.com>
Date: Sat, 18 Jul 2026 18:08:04 +0000
Subject: [PATCH] staging: fbtft: fix checkpatch errors in fbtft-bus.c

Fix space-related checkpatch errors in macro invocations. When the
modifier argument is empty, remove the trailing comma to avoid
'space required after comma' and 'space prohibited before close
parenthesis' conflicting errors.

Signed-off-by: Shivesh <chanelshivesh@gmail.com>
---
 drivers/staging/fbtft/fbtft-bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 30e436ff19e4..409770891c54 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -62,9 +62,9 @@ out:									      \
 }                                                                             \
 EXPORT_SYMBOL(func);
 
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8)
 define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
-define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, )
+define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16)
 
 void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
 {
-- 
2.53.0


[-- Attachment #2: 0001-staging-fbtft-fix-checkpatch-errors-in-fbtft-bus.c.patch --]
[-- Type: application/octet-stream, Size: 1330 bytes --]

From 7e9684b26176644bc92c2285acc7444f3f7ddb4d Mon Sep 17 00:00:00 2001
From: Shivesh <chanelshivesh@gmail.com>
Date: Sat, 18 Jul 2026 18:08:04 +0000
Subject: [PATCH] staging: fbtft: fix checkpatch errors in fbtft-bus.c

Fix space-related checkpatch errors in macro invocations. When the
modifier argument is empty, remove the trailing comma to avoid
'space required after comma' and 'space prohibited before close
parenthesis' conflicting errors.

Signed-off-by: Shivesh <chanelshivesh@gmail.com>
---
 drivers/staging/fbtft/fbtft-bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 30e436ff19e4..409770891c54 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -62,9 +62,9 @@ out:									      \
 }                                                                             \
 EXPORT_SYMBOL(func);
 
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8)
 define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
-define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, )
+define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16)
 
 void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
 {
-- 
2.53.0


^ permalink raw reply related

* Re: [PATCH] fbdev: arkfb: Move a variable assignment behind a condition check in ics5342_init()
From: Helge Deller @ 2026-07-18 18:17 UTC (permalink / raw)
  To: Markus Elfring, linux-fbdev, dri-devel, Kees Cook,
	Uwe Kleine-König
  Cc: LKML, kernel-janitors
In-Reply-To: <36d0eba7-e78d-4a06-95bc-c97d9b91f8f0@web.de>

On 7/13/26 12:18, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 13 Jul 2026 12:12:52 +0200
> 
> The address of a data structure member was determined before
> a corresponding null pointer check in the implementation of
> the function “ics5342_init”.
> 
> Thus avoid the risk for undefined behaviour by moving the assignment
> for the variable “info” behind a condition check.
> 
> This issue was detected by using the Coccinelle software.

There is no "risk" here.
It just adds an offset to a potential NULL value (which isn't then used afterwards).

Helge 
> Fixes: ede481f6dad47d40b7e561cfbc6c04286a9faf1a ("fbdev: arkfb: Cast ics5342_init() allocation type")
> Cc: stable@vger.kernel.org
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>   drivers/video/fbdev/arkfb.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c
> index 195dbf4a5142..9658f407b79a 100644
> --- a/drivers/video/fbdev/arkfb.c
> +++ b/drivers/video/fbdev/arkfb.c
> @@ -432,11 +432,12 @@ static struct dac_ops ics5342_ops = {
>   static struct dac_info * ics5342_init(dac_read_regs_t drr, dac_write_regs_t dwr, void *data)
>   {
>   	struct ics5342_info *ics_info = kzalloc_obj(struct ics5342_info);
> -	struct dac_info *info = &ics_info->dac;
> +	struct dac_info *info;
>   
>   	if (!ics_info)
>   		return NULL;
>   
> +	info = &ics_info->dac;
>   	info->dacops = &ics5342_ops;
>   	info->dac_read_regs = drr;
>   	info->dac_write_regs = dwr;


^ permalink raw reply

* Re: [PATCH v2] staging: sm750fb: fix mono image source stride mismatch in lynxfb_ops_imageblit()
From: Dan Carpenter @ 2026-07-18 11:57 UTC (permalink / raw)
  To: Muhammad Bilal
  Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
	linux-staging, linux-kernel
In-Reply-To: <20260718103103.18082-1-meatuni001@gmail.com>

On Sat, Jul 18, 2026 at 03:31:03PM +0500, Muhammad Bilal wrote:
> sm750_hw_imageblit() advances its monochrome source pointer by
> src_delta per scanline, and computes the correct rounded-up stride
> internally as:
> 
> 	bytes_per_scan = (width + start_bit + 7) / 8;
> 
> Its only caller, lynxfb_ops_imageblit(), instead passed src_delta as
> image->width >> 3. For widths not a multiple of 8 this under-counted
> the stride, so the source pointer fell further behind the real
> per-scanline layout on every line, corrupting the rendered image.
> 
> Rather than just fixing the caller's calculation, remove src_delta
> as a parameter entirely and have sm750_hw_imageblit() advance by the
> bytes_per_scan it already computes for itself. There has only ever
> been one caller, and that caller was passing an out-of-sync
> derivative of the same width/start_bit values sm750_hw_imageblit()
> already has, so keeping stride as a separate parameter served no
> purpose beyond letting the two calculations drift apart, which is
> exactly what happened here.
> 
> Fixes: 81dee67e215b2 ("staging: sm750fb: add sm750 to staging")
> Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
> ---

There is supposed to be a little note here:
---
v2: Added a Fixes tag.

https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

Obviously there is an inconsistency between rounding up and down
but without testing it's less clear which one is correct...

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH] staging: sm750fb: fix mono image source stride mismatch in lynxfb_ops_imageblit()
From: Dan Carpenter @ 2026-07-18 11:54 UTC (permalink / raw)
  To: Muhammad Bilal
  Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
	linux-staging, linux-kernel
In-Reply-To: <CADqcGB=F6Qvk-3zQ=DCPewfpOAQvCta2q-WrfuSPanmoVqyGpg@mail.gmail.com>

On Sat, Jul 18, 2026 at 03:38:52PM +0500, Muhammad Bilal wrote:
> On Sat, Jul 18, 2026, Dan Carpenter wrote:
> > Looks reasonable.  Add a Fixes tag.
> >
> > You have this hardware and are finding these with testing?
> >
> > It would be better to move the source delta calculation into
> > the the sm750_hw_imageblit() since it's just width rounded up
> > (or rounded down if you want to be wrong I suppose).
> 
> Thanks for the review. Sending v2 as a separate message since it
> came out as a fuller rework rather than a small diff on v1:
> 
>  - Added Fixes: 81dee67e215b2 ("staging: sm750fb: add sm750 to
>    staging"), traced via git blame. The bug has been there,
>    unchanged, since the original 2015 staging import.
> 
>  - No, I don't have this hardware. This was found by auditing
>    sm750_hw_imageblit()'s internal stride calculation against what
>    its caller was passing in, and confirmed with a clean "-Werror"
>    build. No runtime testing on real sm750 silicon.

You really need to put this into the commit message.

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH] staging: sm750fb: fix mono image source stride mismatch in lynxfb_ops_imageblit()
From: Muhammad Bilal @ 2026-07-18 10:38 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
	linux-staging, linux-kernel
In-Reply-To: <alsSp5tAe8tunTeG@stanley.mountain>

On Sat, Jul 18, 2026, Dan Carpenter wrote:
> Looks reasonable.  Add a Fixes tag.
>
> You have this hardware and are finding these with testing?
>
> It would be better to move the source delta calculation into
> the the sm750_hw_imageblit() since it's just width rounded up
> (or rounded down if you want to be wrong I suppose).

Thanks for the review. Sending v2 as a separate message since it
came out as a fuller rework rather than a small diff on v1:

 - Added Fixes: 81dee67e215b2 ("staging: sm750fb: add sm750 to
   staging"), traced via git blame. The bug has been there,
   unchanged, since the original 2015 staging import.

 - No, I don't have this hardware. This was found by auditing
   sm750_hw_imageblit()'s internal stride calculation against what
   its caller was passing in, and confirmed with a clean "-Werror"
   build. No runtime testing on real sm750 silicon.

 - Moved the stride calculation into sm750_hw_imageblit() itself, as
   you suggested, and dropped src_delta as a parameter entirely. It
   was the only caller and was independently recomputing (wrong)
   something the function already had every input for - which is
   exactly how this bug happened. Updated the declaration in
   sm750_accel.h and the de_imageblit function pointer typedef in
   sm750.h to match.

regards,
Muhammad Bilal

^ permalink raw reply

* [PATCH v2] staging: sm750fb: fix mono image source stride mismatch in lynxfb_ops_imageblit()
From: Muhammad Bilal @ 2026-07-18 10:31 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang
  Cc: Greg Kroah-Hartman, linux-fbdev, linux-staging, linux-kernel,
	Muhammad Bilal

sm750_hw_imageblit() advances its monochrome source pointer by
src_delta per scanline, and computes the correct rounded-up stride
internally as:

	bytes_per_scan = (width + start_bit + 7) / 8;

Its only caller, lynxfb_ops_imageblit(), instead passed src_delta as
image->width >> 3. For widths not a multiple of 8 this under-counted
the stride, so the source pointer fell further behind the real
per-scanline layout on every line, corrupting the rendered image.

Rather than just fixing the caller's calculation, remove src_delta
as a parameter entirely and have sm750_hw_imageblit() advance by the
bytes_per_scan it already computes for itself. There has only ever
been one caller, and that caller was passing an out-of-sync
derivative of the same width/start_bit values sm750_hw_imageblit()
already has, so keeping stride as a separate parameter served no
purpose beyond letting the two calculations drift apart, which is
exactly what happened here.

Fixes: 81dee67e215b2 ("staging: sm750fb: add sm750 to staging")
Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
---
 drivers/staging/sm750fb/sm750.c       | 2 +-
 drivers/staging/sm750fb/sm750.h       | 2 +-
 drivers/staging/sm750fb/sm750_accel.c | 6 ++----
 drivers/staging/sm750fb/sm750_accel.h | 4 +---
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c..da0b4979a281 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -261,7 +261,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 	spin_lock(&sm750_dev->slock);
 
 	sm750_dev->accel.de_imageblit(&sm750_dev->accel,
-				      image->data, image->width >> 3, 0,
+				      image->data, 0,
 				      base, pitch, bpp,
 				      image->dx, image->dy,
 				      image->width, image->height,
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index d2c522e67f26..83229fe155ec 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -73,7 +73,7 @@ struct lynx_accel {
 			   u32 rop2);
 
 	int (*de_imageblit)(struct lynx_accel *accel, const char *p_srcbuf,
-			    u32 src_delta, u32 start_bit, u32 d_base, u32 d_pitch,
+			    u32 start_bit, u32 d_base, u32 d_pitch,
 			    u32 byte_per_pixel, u32 dx, u32 dy, u32 width,
 			    u32 height, u32 f_color, u32 b_color, u32 rop2);
 
diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c
index 0316ea69d009..bac9a209899c 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -288,8 +288,6 @@ static unsigned int de_get_transparency(struct lynx_accel *accel)
  * sm750_hw_imageblit
  * @accel: Acceleration device data
  * @src_buf: pointer to start of source buffer in system memory
- * @src_delta: Pitch value (in bytes) of the source buffer, +ive means top down
- *	      and -ive mean button up
  * @start_bit: Mono data can start at any bit in a byte, this value should be
  *	      0 to 7
  * @dest_base: Address of destination: offset in frame buffer
@@ -304,7 +302,7 @@ static unsigned int de_get_transparency(struct lynx_accel *accel)
  * @rop2: ROP value
  */
 int sm750_hw_imageblit(struct lynx_accel *accel, const char *src_buf,
-		       u32 src_delta, u32 start_bit, u32 dest_base, u32 dest_pitch,
+		       u32 start_bit, u32 dest_base, u32 dest_pitch,
 		       u32 byte_per_pixel, u32 dx, u32 dy, u32 width,
 		       u32 height, u32 fg_color, u32 bg_color, u32 rop2)
 {
@@ -395,7 +393,7 @@ int sm750_hw_imageblit(struct lynx_accel *accel, const char *src_buf,
 			write_dp_port(accel, *(unsigned int *)remain);
 		}
 
-		src_buf += src_delta;
+		src_buf += bytes_per_scan;
 	}
 
 	return 0;
diff --git a/drivers/staging/sm750fb/sm750_accel.h b/drivers/staging/sm750fb/sm750_accel.h
index d15a40cacb84..4f609d6af0fa 100644
--- a/drivers/staging/sm750fb/sm750_accel.h
+++ b/drivers/staging/sm750fb/sm750_accel.h
@@ -220,8 +220,6 @@ int sm750_hw_copyarea(struct lynx_accel *accel,
 /**
  * sm750_hw_imageblit
  * @pSrcbuf: pointer to start of source buffer in system memory
- * @srcDelta: Pitch value (in bytes) of the source buffer, +ive means top down
- *>-----      and -ive mean button up
  * @startBit: Mono data can start at any bit in a byte, this value should be
  *>-----      0 to 7
  * @dBase: Address of destination: offset in frame buffer
@@ -236,7 +234,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,
  * @rop2: ROP value
  */
 int sm750_hw_imageblit(struct lynx_accel *accel, const char *pSrcbuf,
-		       u32 srcDelta, u32 startBit, u32 dBase, u32 dPitch,
+		       u32 startBit, u32 dBase, u32 dPitch,
 		       u32 bytePerPixel, u32 dx, u32 dy, u32 width,
 		       u32 height, u32 fColor, u32 bColor, u32 rop2);
 
-- 
2.55.0


^ permalink raw reply related

* Re: [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code
From: Greg Kroah-Hartman @ 2026-07-18  6:31 UTC (permalink / raw)
  To: Nils Lehnen
  Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
	linux-kernel
In-Reply-To: <20260718062027.5850-1-nils.lehnen@proton.me>

On Sat, Jul 18, 2026 at 06:20:56AM +0000, Nils Lehnen wrote:
> VALIDATION_CHIP is defined nowhere in the tree, yet fourteen
> preprocessor conditionals in the sm750fb DDK files still test it.
> Patch 1 resolves all of them (dead branches dropped, always-true
> branches kept), as the driver TODO asks under "remove unused code";
> patch 2 cleans up the indentation and blank lines the removal leaves
> behind.
> 
> Verification, both patches: the disassembly of all ten sm750fb object
> files (objdump -d, x86, CONFIG_FB_SM750=m) is bit-identical across the
> series. Compile-tested only; no SM750 hardware available.
> 
> All English text in this series (cover letter, commit messages, code
> comments) was translated from a German draft with the assistance of
> Claude Fable 5.
> 
> v2: resend of v1 -- patch 1/2 of v1 arrived with an empty subject due
> to a local send mishap; no code changes.
> v1: https://lore.kernel.org/r/20260718055132.441-1-nils.lehnen@proton.me

Please wait a day or so between new versions, gives people a chance to
review what you sent and you to make changes based on it.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH 2/2] staging: sm750fb: unindent defines left by conditional removal
From: Nils Lehnen @ 2026-07-18  6:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
	linux-kernel
In-Reply-To: <2026071810-reprogram-decade-7537@gregkh>

On Sat, Jul 18, 2026 at 08:20:36AM +0200, Greg Kroah-Hartman wrote:
> No, this is not correct, the indentation gives you context of what is
> happening.

Right, the indented defines are the values of the field define right
above them, and unindenting throws that context away. I'll drop this
patch.

A v2 of the series crossed with your review -- please disregard its
patch 2/2 as well. A v3 with only the conditional removal follows.

Sorry also for the subject-less 1/2 in this thread; that was a local
send-email mishap on my side.

Thanks for the review,

Nils


^ permalink raw reply

* [PATCH v2 2/2] staging: sm750fb: unindent defines left by conditional removal
From: Nils Lehnen @ 2026-07-18  6:21 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen
In-Reply-To: <20260718062027.5850-1-nils.lehnen@proton.me>

The preceding removal of the VALIDATION_CHIP conditionals left the
surviving define blocks and one comment indented by four spaces, and
two double blank lines where conditional lines went away. Move the
now-unconditional defines to column zero while keeping the aligned
value column untouched, and collapse the blank lines.

No functional change: whitespace and preprocessor layout only; the
disassembly of all ten sm750fb object files stays bit-identical.

All English text in this patch (commit message and code comments) was
translated from a German draft with the assistance of Claude Fable 5.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Nils Lehnen <nils.lehnen@proton.me>
---
 drivers/staging/sm750fb/ddk750_reg.h | 50 +++++++++++++---------------
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h
index 4bcede37584a..2888ffe32fa2 100644
--- a/drivers/staging/sm750fb/ddk750_reg.h
+++ b/drivers/staging/sm750fb/ddk750_reg.h
@@ -294,15 +294,15 @@
 
 #define CURRENT_GATE                                  0x000040
 #define CURRENT_GATE_MCLK_MASK                        (0x3 << 14)
-    #define CURRENT_GATE_MCLK_DIV_3                   (0x0 << 14)
-    #define CURRENT_GATE_MCLK_DIV_4                   (0x1 << 14)
-    #define CURRENT_GATE_MCLK_DIV_6                   (0x2 << 14)
-    #define CURRENT_GATE_MCLK_DIV_8                   (0x3 << 14)
+#define CURRENT_GATE_MCLK_DIV_3                       (0x0 << 14)
+#define CURRENT_GATE_MCLK_DIV_4                       (0x1 << 14)
+#define CURRENT_GATE_MCLK_DIV_6                       (0x2 << 14)
+#define CURRENT_GATE_MCLK_DIV_8                       (0x3 << 14)
 #define CURRENT_GATE_M2XCLK_MASK                      (0x3 << 12)
-    #define CURRENT_GATE_M2XCLK_DIV_1                 (0x0 << 12)
-    #define CURRENT_GATE_M2XCLK_DIV_2                 (0x1 << 12)
-    #define CURRENT_GATE_M2XCLK_DIV_3                 (0x2 << 12)
-    #define CURRENT_GATE_M2XCLK_DIV_4                 (0x3 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_1                     (0x0 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_2                     (0x1 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_3                     (0x2 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_4                     (0x3 << 12)
 #define CURRENT_GATE_VGA                              BIT(10)
 #define CURRENT_GATE_PWM                              BIT(9)
 #define CURRENT_GATE_I2C                              BIT(8)
@@ -383,10 +383,10 @@
 #define PLL_CTRL_BYPASS                               BIT(18)
 #define PLL_CTRL_POWER                                BIT(17)
 #define PLL_CTRL_INPUT                                BIT(16)
-    #define PLL_CTRL_POD_SHIFT                        14
-    #define PLL_CTRL_POD_MASK                         (0x3 << 14)
-    #define PLL_CTRL_OD_SHIFT                         12
-    #define PLL_CTRL_OD_MASK                          (0x3 << 12)
+#define PLL_CTRL_POD_SHIFT                            14
+#define PLL_CTRL_POD_MASK                             (0x3 << 14)
+#define PLL_CTRL_OD_SHIFT                             12
+#define PLL_CTRL_OD_MASK                              (0x3 << 12)
 #define PLL_CTRL_N_SHIFT                              8
 #define PLL_CTRL_N_MASK                               (0xf << 8)
 #define PLL_CTRL_M_SHIFT                              0
@@ -400,7 +400,6 @@
 
 #define SCRATCH_DATA                                  0x00006c
 
-
 #define MXCLK_PLL_CTRL                                0x000070
 
 #define VGA_CONFIGURATION                             0x000088
@@ -408,7 +407,6 @@
 #define VGA_CONFIGURATION_PLL                         BIT(2)
 #define VGA_CONFIGURATION_MODE                        BIT(1)
 
-
 #define GPIO_DATA                                       0x010000
 #define GPIO_DATA_31                                    BIT(31)
 #define GPIO_DATA_30                                    BIT(30)
@@ -996,7 +994,7 @@
 #define CRT_DISPLAY_CTRL_CRTSELECT                    BIT(25)
 #define CRT_DISPLAY_CTRL_RGBBIT                       BIT(24)
 
-    #define CRT_DISPLAY_CTRL_CENTERING                BIT(24)
+#define CRT_DISPLAY_CTRL_CENTERING                    BIT(24)
 #define CRT_DISPLAY_CTRL_LOCK_TIMING                  BIT(23)
 #define CRT_DISPLAY_CTRL_EXPANSION                    BIT(22)
 #define CRT_DISPLAY_CTRL_VERTICAL_MODE                BIT(21)
@@ -1095,26 +1093,26 @@
 
 /* This vertical expansion below start at 0x080240 ~ 0x080264 */
 #define CRT_VERTICAL_EXPANSION                        0x080240
-    #define CRT_VERTICAL_CENTERING_VALUE_MASK         (0xff << 24)
+#define CRT_VERTICAL_CENTERING_VALUE_MASK             (0xff << 24)
 #define CRT_VERTICAL_EXPANSION_COMPARE_VALUE_MASK     (0xff << 16)
 #define CRT_VERTICAL_EXPANSION_LINE_BUFFER_MASK       (0xf << 12)
 #define CRT_VERTICAL_EXPANSION_SCALE_FACTOR_MASK      0xfff
 
 /* This horizontal expansion below start at 0x080268 ~ 0x08027C */
 #define CRT_HORIZONTAL_EXPANSION                      0x080268
-    #define CRT_HORIZONTAL_CENTERING_VALUE_MASK       (0xff << 24)
+#define CRT_HORIZONTAL_CENTERING_VALUE_MASK           (0xff << 24)
 #define CRT_HORIZONTAL_EXPANSION_COMPARE_VALUE_MASK   (0xff << 16)
 #define CRT_HORIZONTAL_EXPANSION_SCALE_FACTOR_MASK    0xfff
 
-    /* Auto Centering */
-    #define CRT_AUTO_CENTERING_TL                     0x080280
-    #define CRT_AUTO_CENTERING_TL_TOP_MASK            (0x7ff << 16)
-    #define CRT_AUTO_CENTERING_TL_LEFT_MASK           0x7ff
+/* Auto Centering */
+#define CRT_AUTO_CENTERING_TL                         0x080280
+#define CRT_AUTO_CENTERING_TL_TOP_MASK                (0x7ff << 16)
+#define CRT_AUTO_CENTERING_TL_LEFT_MASK               0x7ff
 
-    #define CRT_AUTO_CENTERING_BR                     0x080284
-    #define CRT_AUTO_CENTERING_BR_BOTTOM_MASK         (0x7ff << 16)
-    #define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT        16
-    #define CRT_AUTO_CENTERING_BR_RIGHT_MASK          0x7ff
+#define CRT_AUTO_CENTERING_BR                         0x080284
+#define CRT_AUTO_CENTERING_BR_BOTTOM_MASK             (0x7ff << 16)
+#define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT            16
+#define CRT_AUTO_CENTERING_BR_RIGHT_MASK              0x7ff
 
 /* sm750le new register to control panel output */
 #define DISPLAY_CONTROL_750LE			      0x80288
@@ -1294,7 +1292,7 @@
 #define ZV0_CAPTURE_BUF1_ADDRESS_ADDRESS_MASK           0x3ffffff
 
 #define ZV0_CAPTURE_BUF_OFFSET                          0x090014
-    #define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD      (0x3ff << 16)
+#define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD          (0x3ff << 16)
 #define ZV0_CAPTURE_BUF_OFFSET_OFFSET_MASK              0xffff
 
 #define ZV0_CAPTURE_FIFO_CTRL                           0x090018
-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 1/2] staging: sm750fb: remove dead VALIDATION_CHIP conditionals
From: Nils Lehnen @ 2026-07-18  6:21 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen
In-Reply-To: <20260718062027.5850-1-nils.lehnen@proton.me>

VALIDATION_CHIP is defined nowhere in the tree and no Makefile passes
-DVALIDATION_CHIP, so every #ifdef VALIDATION_CHIP block is dead code
and every #ifndef VALIDATION_CHIP condition is always true. Resolve all
fourteen conditionals accordingly (dead branches dropped, live branches
kept), as the driver TODO asks under "remove unused code".

No functional change: the disassembly of all ten sm750fb object files
is bit-identical before and after this patch.

All English text in this patch (commit message and code comments) was
translated from a German draft with the assistance of Claude Fable 5.

Assisted-by: Claude:claude-fable-5 sparse unifdef
Signed-off-by: Nils Lehnen <nils.lehnen@proton.me>
---
 drivers/staging/sm750fb/ddk750_reg.h   | 34 --------------------------
 drivers/staging/sm750fb/ddk750_chip.c  |  4 ---
 drivers/staging/sm750fb/ddk750_power.c |  6 -----
 3 files changed, 44 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h
index fe412ead72e5..4bcede37584a 100644
--- a/drivers/staging/sm750fb/ddk750_reg.h
+++ b/drivers/staging/sm750fb/ddk750_reg.h
@@ -294,29 +294,15 @@
 
 #define CURRENT_GATE                                  0x000040
 #define CURRENT_GATE_MCLK_MASK                        (0x3 << 14)
-#ifdef VALIDATION_CHIP
-    #define CURRENT_GATE_MCLK_112MHZ                  (0x0 << 14)
-    #define CURRENT_GATE_MCLK_84MHZ                   (0x1 << 14)
-    #define CURRENT_GATE_MCLK_56MHZ                   (0x2 << 14)
-    #define CURRENT_GATE_MCLK_42MHZ                   (0x3 << 14)
-#else
     #define CURRENT_GATE_MCLK_DIV_3                   (0x0 << 14)
     #define CURRENT_GATE_MCLK_DIV_4                   (0x1 << 14)
     #define CURRENT_GATE_MCLK_DIV_6                   (0x2 << 14)
     #define CURRENT_GATE_MCLK_DIV_8                   (0x3 << 14)
-#endif
 #define CURRENT_GATE_M2XCLK_MASK                      (0x3 << 12)
-#ifdef VALIDATION_CHIP
-    #define CURRENT_GATE_M2XCLK_336MHZ                (0x0 << 12)
-    #define CURRENT_GATE_M2XCLK_168MHZ                (0x1 << 12)
-    #define CURRENT_GATE_M2XCLK_112MHZ                (0x2 << 12)
-    #define CURRENT_GATE_M2XCLK_84MHZ                 (0x3 << 12)
-#else
     #define CURRENT_GATE_M2XCLK_DIV_1                 (0x0 << 12)
     #define CURRENT_GATE_M2XCLK_DIV_2                 (0x1 << 12)
     #define CURRENT_GATE_M2XCLK_DIV_3                 (0x2 << 12)
     #define CURRENT_GATE_M2XCLK_DIV_4                 (0x3 << 12)
-#endif
 #define CURRENT_GATE_VGA                              BIT(10)
 #define CURRENT_GATE_PWM                              BIT(9)
 #define CURRENT_GATE_I2C                              BIT(8)
@@ -376,9 +362,6 @@
 #define MODE1_GATE_DMA                                BIT(0)
 
 #define POWER_MODE_CTRL                               0x00004C
-#ifdef VALIDATION_CHIP
-    #define POWER_MODE_CTRL_336CLK                    BIT(4)
-#endif
 #define POWER_MODE_CTRL_OSC_INPUT                     BIT(3)
 #define POWER_MODE_CTRL_ACPI                          BIT(2)
 #define POWER_MODE_CTRL_MODE_MASK                     (0x3 << 0)
@@ -400,15 +383,10 @@
 #define PLL_CTRL_BYPASS                               BIT(18)
 #define PLL_CTRL_POWER                                BIT(17)
 #define PLL_CTRL_INPUT                                BIT(16)
-#ifdef VALIDATION_CHIP
-    #define PLL_CTRL_OD_SHIFT                         14
-    #define PLL_CTRL_OD_MASK                          (0x3 << 14)
-#else
     #define PLL_CTRL_POD_SHIFT                        14
     #define PLL_CTRL_POD_MASK                         (0x3 << 14)
     #define PLL_CTRL_OD_SHIFT                         12
     #define PLL_CTRL_OD_MASK                          (0x3 << 12)
-#endif
 #define PLL_CTRL_N_SHIFT                              8
 #define PLL_CTRL_N_MASK                               (0xf << 8)
 #define PLL_CTRL_M_SHIFT                              0
@@ -422,7 +400,6 @@
 
 #define SCRATCH_DATA                                  0x00006c
 
-#ifndef VALIDATION_CHIP
 
 #define MXCLK_PLL_CTRL                                0x000070
 
@@ -431,7 +408,6 @@
 #define VGA_CONFIGURATION_PLL                         BIT(2)
 #define VGA_CONFIGURATION_MODE                        BIT(1)
 
-#endif
 
 #define GPIO_DATA                                       0x010000
 #define GPIO_DATA_31                                    BIT(31)
@@ -1020,9 +996,7 @@
 #define CRT_DISPLAY_CTRL_CRTSELECT                    BIT(25)
 #define CRT_DISPLAY_CTRL_RGBBIT                       BIT(24)
 
-#ifndef VALIDATION_CHIP
     #define CRT_DISPLAY_CTRL_CENTERING                BIT(24)
-#endif
 #define CRT_DISPLAY_CTRL_LOCK_TIMING                  BIT(23)
 #define CRT_DISPLAY_CTRL_EXPANSION                    BIT(22)
 #define CRT_DISPLAY_CTRL_VERTICAL_MODE                BIT(21)
@@ -1121,22 +1095,17 @@
 
 /* This vertical expansion below start at 0x080240 ~ 0x080264 */
 #define CRT_VERTICAL_EXPANSION                        0x080240
-#ifndef VALIDATION_CHIP
     #define CRT_VERTICAL_CENTERING_VALUE_MASK         (0xff << 24)
-#endif
 #define CRT_VERTICAL_EXPANSION_COMPARE_VALUE_MASK     (0xff << 16)
 #define CRT_VERTICAL_EXPANSION_LINE_BUFFER_MASK       (0xf << 12)
 #define CRT_VERTICAL_EXPANSION_SCALE_FACTOR_MASK      0xfff
 
 /* This horizontal expansion below start at 0x080268 ~ 0x08027C */
 #define CRT_HORIZONTAL_EXPANSION                      0x080268
-#ifndef VALIDATION_CHIP
     #define CRT_HORIZONTAL_CENTERING_VALUE_MASK       (0xff << 24)
-#endif
 #define CRT_HORIZONTAL_EXPANSION_COMPARE_VALUE_MASK   (0xff << 16)
 #define CRT_HORIZONTAL_EXPANSION_SCALE_FACTOR_MASK    0xfff
 
-#ifndef VALIDATION_CHIP
     /* Auto Centering */
     #define CRT_AUTO_CENTERING_TL                     0x080280
     #define CRT_AUTO_CENTERING_TL_TOP_MASK            (0x7ff << 16)
@@ -1146,7 +1115,6 @@
     #define CRT_AUTO_CENTERING_BR_BOTTOM_MASK         (0x7ff << 16)
     #define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT        16
     #define CRT_AUTO_CENTERING_BR_RIGHT_MASK          0x7ff
-#endif
 
 /* sm750le new register to control panel output */
 #define DISPLAY_CONTROL_750LE			      0x80288
@@ -1326,9 +1294,7 @@
 #define ZV0_CAPTURE_BUF1_ADDRESS_ADDRESS_MASK           0x3ffffff
 
 #define ZV0_CAPTURE_BUF_OFFSET                          0x090014
-#ifndef VALIDATION_CHIP
     #define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD      (0x3ff << 16)
-#endif
 #define ZV0_CAPTURE_BUF_OFFSET_OFFSET_MASK              0xffff
 
 #define ZV0_CAPTURE_FIFO_CTRL                           0x090018
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 0bb56bbec43f..ab8b68076dec 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -387,9 +387,7 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig,
 
 unsigned int sm750_format_pll_reg(struct pll_value *p_PLL)
 {
-#ifndef VALIDATION_CHIP
 	unsigned int POD = p_PLL->POD;
-#endif
 	unsigned int OD = p_PLL->OD;
 	unsigned int M = p_PLL->M;
 	unsigned int N = p_PLL->N;
@@ -401,9 +399,7 @@ unsigned int sm750_format_pll_reg(struct pll_value *p_PLL)
 	 * applied to any PLL in the calling function.
 	 */
 	return PLL_CTRL_POWER |
-#ifndef VALIDATION_CHIP
 		((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) |
-#endif
 		((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) |
 		((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) |
 		((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK);
diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c
index eaba3bc2e01a..d617f554f58d 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -58,14 +58,8 @@ void sm750_set_power_mode(unsigned int mode)
 	/* Set up other fields in Power Control Register */
 	if (mode == POWER_MODE_CTRL_MODE_SLEEP) {
 		ctrl &= ~POWER_MODE_CTRL_OSC_INPUT;
-#ifdef VALIDATION_CHIP
-		ctrl &= ~POWER_MODE_CTRL_336CLK;
-#endif
 	} else {
 		ctrl |= POWER_MODE_CTRL_OSC_INPUT;
-#ifdef VALIDATION_CHIP
-		ctrl |= POWER_MODE_CTRL_336CLK;
-#endif
 	}
 
 	/* Program new power mode. */
-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code
From: Nils Lehnen @ 2026-07-18  6:20 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen

VALIDATION_CHIP is defined nowhere in the tree, yet fourteen
preprocessor conditionals in the sm750fb DDK files still test it.
Patch 1 resolves all of them (dead branches dropped, always-true
branches kept), as the driver TODO asks under "remove unused code";
patch 2 cleans up the indentation and blank lines the removal leaves
behind.

Verification, both patches: the disassembly of all ten sm750fb object
files (objdump -d, x86, CONFIG_FB_SM750=m) is bit-identical across the
series. Compile-tested only; no SM750 hardware available.

All English text in this series (cover letter, commit messages, code
comments) was translated from a German draft with the assistance of
Claude Fable 5.

v2: resend of v1 -- patch 1/2 of v1 arrived with an empty subject due
to a local send mishap; no code changes.
v1: https://lore.kernel.org/r/20260718055132.441-1-nils.lehnen@proton.me

Nils Lehnen (2):
  staging: sm750fb: remove dead VALIDATION_CHIP conditionals
  staging: sm750fb: unindent defines left by conditional removal

 drivers/staging/sm750fb/ddk750_reg.h   | 84 ++++++++------------------
 drivers/staging/sm750fb/ddk750_chip.c  |  4 --
 drivers/staging/sm750fb/ddk750_power.c |  6 --
 3 files changed, 24 insertions(+), 70 deletions(-)


base-commit: 64276d9bfe4d1fdd5cf2636f1065f7ea55c2defb
-- 
2.43.0



^ permalink raw reply

* Re: [PATCH 2/2] staging: sm750fb: unindent defines left by conditional removal
From: Greg Kroah-Hartman @ 2026-07-18  6:20 UTC (permalink / raw)
  To: Nils Lehnen
  Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
	linux-kernel
In-Reply-To: <20260718055709.466-2-nils.lehnen@proton.me>

On Sat, Jul 18, 2026 at 05:57:58AM +0000, Nils Lehnen wrote:
> The preceding removal of the VALIDATION_CHIP conditionals left the
> surviving define blocks and one comment indented by four spaces, and
> two double blank lines where conditional lines went away. Move the
> now-unconditional defines to column zero while keeping the aligned
> value column untouched, and collapse the blank lines.
> 
> No functional change: whitespace and preprocessor layout only; the
> disassembly of all ten sm750fb object files stays bit-identical.
> 
> All English text in this patch (commit message and code comments) was
> translated from a German draft with the assistance of Claude Fable 5.
> 
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Nils Lehnen <nils.lehnen@proton.me>
> ---
>  drivers/staging/sm750fb/ddk750_reg.h | 50 +++++++++++++---------------
>  1 file changed, 24 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h
> index 4bcede37584a..2888ffe32fa2 100644
> --- a/drivers/staging/sm750fb/ddk750_reg.h
> +++ b/drivers/staging/sm750fb/ddk750_reg.h
> @@ -294,15 +294,15 @@
>  
>  #define CURRENT_GATE                                  0x000040
>  #define CURRENT_GATE_MCLK_MASK                        (0x3 << 14)
> -    #define CURRENT_GATE_MCLK_DIV_3                   (0x0 << 14)
> -    #define CURRENT_GATE_MCLK_DIV_4                   (0x1 << 14)
> -    #define CURRENT_GATE_MCLK_DIV_6                   (0x2 << 14)
> -    #define CURRENT_GATE_MCLK_DIV_8                   (0x3 << 14)
> +#define CURRENT_GATE_MCLK_DIV_3                       (0x0 << 14)
> +#define CURRENT_GATE_MCLK_DIV_4                       (0x1 << 14)
> +#define CURRENT_GATE_MCLK_DIV_6                       (0x2 << 14)
> +#define CURRENT_GATE_MCLK_DIV_8                       (0x3 << 14)
>  #define CURRENT_GATE_M2XCLK_MASK                      (0x3 << 12)

No, this is not correct, the indentation gives you context of what is
happening.

thanks,

greg k-h

^ permalink raw reply

* Re: (No Subject)
From: Greg Kroah-Hartman @ 2026-07-18  6:19 UTC (permalink / raw)
  To: Nils Lehnen
  Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
	linux-kernel
In-Reply-To: <20260718055709.466-1-nils.lehnen@proton.me>

On Sat, Jul 18, 2026 at 05:57:26AM +0000, Nils Lehnen wrote:
> >From b62c709ab6d719d625199dfdb3053589f925eaad Mon Sep 17 00:00:00 2001
> From: Nils Lehnen <nils.lehnen@proton.me>
> Date: Sat, 18 Jul 2026 07:43:49 +0200
> Subject: [PATCH 1/2] staging: sm750fb: remove dead VALIDATION_CHIP
>  conditionals

Something went wrong here :(


^ permalink raw reply

* [PATCH 2/2] staging: sm750fb: unindent defines left by conditional removal
From: Nils Lehnen @ 2026-07-18  5:57 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen
In-Reply-To: <20260718055709.466-1-nils.lehnen@proton.me>

The preceding removal of the VALIDATION_CHIP conditionals left the
surviving define blocks and one comment indented by four spaces, and
two double blank lines where conditional lines went away. Move the
now-unconditional defines to column zero while keeping the aligned
value column untouched, and collapse the blank lines.

No functional change: whitespace and preprocessor layout only; the
disassembly of all ten sm750fb object files stays bit-identical.

All English text in this patch (commit message and code comments) was
translated from a German draft with the assistance of Claude Fable 5.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Nils Lehnen <nils.lehnen@proton.me>
---
 drivers/staging/sm750fb/ddk750_reg.h | 50 +++++++++++++---------------
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h
index 4bcede37584a..2888ffe32fa2 100644
--- a/drivers/staging/sm750fb/ddk750_reg.h
+++ b/drivers/staging/sm750fb/ddk750_reg.h
@@ -294,15 +294,15 @@
 
 #define CURRENT_GATE                                  0x000040
 #define CURRENT_GATE_MCLK_MASK                        (0x3 << 14)
-    #define CURRENT_GATE_MCLK_DIV_3                   (0x0 << 14)
-    #define CURRENT_GATE_MCLK_DIV_4                   (0x1 << 14)
-    #define CURRENT_GATE_MCLK_DIV_6                   (0x2 << 14)
-    #define CURRENT_GATE_MCLK_DIV_8                   (0x3 << 14)
+#define CURRENT_GATE_MCLK_DIV_3                       (0x0 << 14)
+#define CURRENT_GATE_MCLK_DIV_4                       (0x1 << 14)
+#define CURRENT_GATE_MCLK_DIV_6                       (0x2 << 14)
+#define CURRENT_GATE_MCLK_DIV_8                       (0x3 << 14)
 #define CURRENT_GATE_M2XCLK_MASK                      (0x3 << 12)
-    #define CURRENT_GATE_M2XCLK_DIV_1                 (0x0 << 12)
-    #define CURRENT_GATE_M2XCLK_DIV_2                 (0x1 << 12)
-    #define CURRENT_GATE_M2XCLK_DIV_3                 (0x2 << 12)
-    #define CURRENT_GATE_M2XCLK_DIV_4                 (0x3 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_1                     (0x0 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_2                     (0x1 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_3                     (0x2 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_4                     (0x3 << 12)
 #define CURRENT_GATE_VGA                              BIT(10)
 #define CURRENT_GATE_PWM                              BIT(9)
 #define CURRENT_GATE_I2C                              BIT(8)
@@ -383,10 +383,10 @@
 #define PLL_CTRL_BYPASS                               BIT(18)
 #define PLL_CTRL_POWER                                BIT(17)
 #define PLL_CTRL_INPUT                                BIT(16)
-    #define PLL_CTRL_POD_SHIFT                        14
-    #define PLL_CTRL_POD_MASK                         (0x3 << 14)
-    #define PLL_CTRL_OD_SHIFT                         12
-    #define PLL_CTRL_OD_MASK                          (0x3 << 12)
+#define PLL_CTRL_POD_SHIFT                            14
+#define PLL_CTRL_POD_MASK                             (0x3 << 14)
+#define PLL_CTRL_OD_SHIFT                             12
+#define PLL_CTRL_OD_MASK                              (0x3 << 12)
 #define PLL_CTRL_N_SHIFT                              8
 #define PLL_CTRL_N_MASK                               (0xf << 8)
 #define PLL_CTRL_M_SHIFT                              0
@@ -400,7 +400,6 @@
 
 #define SCRATCH_DATA                                  0x00006c
 
-
 #define MXCLK_PLL_CTRL                                0x000070
 
 #define VGA_CONFIGURATION                             0x000088
@@ -408,7 +407,6 @@
 #define VGA_CONFIGURATION_PLL                         BIT(2)
 #define VGA_CONFIGURATION_MODE                        BIT(1)
 
-
 #define GPIO_DATA                                       0x010000
 #define GPIO_DATA_31                                    BIT(31)
 #define GPIO_DATA_30                                    BIT(30)
@@ -996,7 +994,7 @@
 #define CRT_DISPLAY_CTRL_CRTSELECT                    BIT(25)
 #define CRT_DISPLAY_CTRL_RGBBIT                       BIT(24)
 
-    #define CRT_DISPLAY_CTRL_CENTERING                BIT(24)
+#define CRT_DISPLAY_CTRL_CENTERING                    BIT(24)
 #define CRT_DISPLAY_CTRL_LOCK_TIMING                  BIT(23)
 #define CRT_DISPLAY_CTRL_EXPANSION                    BIT(22)
 #define CRT_DISPLAY_CTRL_VERTICAL_MODE                BIT(21)
@@ -1095,26 +1093,26 @@
 
 /* This vertical expansion below start at 0x080240 ~ 0x080264 */
 #define CRT_VERTICAL_EXPANSION                        0x080240
-    #define CRT_VERTICAL_CENTERING_VALUE_MASK         (0xff << 24)
+#define CRT_VERTICAL_CENTERING_VALUE_MASK             (0xff << 24)
 #define CRT_VERTICAL_EXPANSION_COMPARE_VALUE_MASK     (0xff << 16)
 #define CRT_VERTICAL_EXPANSION_LINE_BUFFER_MASK       (0xf << 12)
 #define CRT_VERTICAL_EXPANSION_SCALE_FACTOR_MASK      0xfff
 
 /* This horizontal expansion below start at 0x080268 ~ 0x08027C */
 #define CRT_HORIZONTAL_EXPANSION                      0x080268
-    #define CRT_HORIZONTAL_CENTERING_VALUE_MASK       (0xff << 24)
+#define CRT_HORIZONTAL_CENTERING_VALUE_MASK           (0xff << 24)
 #define CRT_HORIZONTAL_EXPANSION_COMPARE_VALUE_MASK   (0xff << 16)
 #define CRT_HORIZONTAL_EXPANSION_SCALE_FACTOR_MASK    0xfff
 
-    /* Auto Centering */
-    #define CRT_AUTO_CENTERING_TL                     0x080280
-    #define CRT_AUTO_CENTERING_TL_TOP_MASK            (0x7ff << 16)
-    #define CRT_AUTO_CENTERING_TL_LEFT_MASK           0x7ff
+/* Auto Centering */
+#define CRT_AUTO_CENTERING_TL                         0x080280
+#define CRT_AUTO_CENTERING_TL_TOP_MASK                (0x7ff << 16)
+#define CRT_AUTO_CENTERING_TL_LEFT_MASK               0x7ff
 
-    #define CRT_AUTO_CENTERING_BR                     0x080284
-    #define CRT_AUTO_CENTERING_BR_BOTTOM_MASK         (0x7ff << 16)
-    #define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT        16
-    #define CRT_AUTO_CENTERING_BR_RIGHT_MASK          0x7ff
+#define CRT_AUTO_CENTERING_BR                         0x080284
+#define CRT_AUTO_CENTERING_BR_BOTTOM_MASK             (0x7ff << 16)
+#define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT            16
+#define CRT_AUTO_CENTERING_BR_RIGHT_MASK              0x7ff
 
 /* sm750le new register to control panel output */
 #define DISPLAY_CONTROL_750LE			      0x80288
@@ -1294,7 +1292,7 @@
 #define ZV0_CAPTURE_BUF1_ADDRESS_ADDRESS_MASK           0x3ffffff
 
 #define ZV0_CAPTURE_BUF_OFFSET                          0x090014
-    #define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD      (0x3ff << 16)
+#define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD          (0x3ff << 16)
 #define ZV0_CAPTURE_BUF_OFFSET_OFFSET_MASK              0xffff
 
 #define ZV0_CAPTURE_FIFO_CTRL                           0x090018
-- 
2.43.0



^ permalink raw reply related

* (No Subject)
From: Nils Lehnen @ 2026-07-18  5:57 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen
In-Reply-To: <20260718055132.441-1-nils.lehnen@proton.me>

From b62c709ab6d719d625199dfdb3053589f925eaad Mon Sep 17 00:00:00 2001
From: Nils Lehnen <nils.lehnen@proton.me>
Date: Sat, 18 Jul 2026 07:43:49 +0200
Subject: [PATCH 1/2] staging: sm750fb: remove dead VALIDATION_CHIP
 conditionals

VALIDATION_CHIP is defined nowhere in the tree and no Makefile passes
-DVALIDATION_CHIP, so every #ifdef VALIDATION_CHIP block is dead code
and every #ifndef VALIDATION_CHIP condition is always true. Resolve all
fourteen conditionals accordingly (dead branches dropped, live branches
kept), as the driver TODO asks under "remove unused code".

No functional change: the disassembly of all ten sm750fb object files
is bit-identical before and after this patch.

All English text in this patch (commit message and code comments) was
translated from a German draft with the assistance of Claude Fable 5.

Assisted-by: Claude:claude-fable-5 sparse unifdef
Signed-off-by: Nils Lehnen <nils.lehnen@proton.me>
---
 drivers/staging/sm750fb/ddk750_reg.h   | 34 --------------------------
 drivers/staging/sm750fb/ddk750_chip.c  |  4 ---
 drivers/staging/sm750fb/ddk750_power.c |  6 -----
 3 files changed, 44 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h
index fe412ead72e5..4bcede37584a 100644
--- a/drivers/staging/sm750fb/ddk750_reg.h
+++ b/drivers/staging/sm750fb/ddk750_reg.h
@@ -294,29 +294,15 @@
 
 #define CURRENT_GATE                                  0x000040
 #define CURRENT_GATE_MCLK_MASK                        (0x3 << 14)
-#ifdef VALIDATION_CHIP
-    #define CURRENT_GATE_MCLK_112MHZ                  (0x0 << 14)
-    #define CURRENT_GATE_MCLK_84MHZ                   (0x1 << 14)
-    #define CURRENT_GATE_MCLK_56MHZ                   (0x2 << 14)
-    #define CURRENT_GATE_MCLK_42MHZ                   (0x3 << 14)
-#else
     #define CURRENT_GATE_MCLK_DIV_3                   (0x0 << 14)
     #define CURRENT_GATE_MCLK_DIV_4                   (0x1 << 14)
     #define CURRENT_GATE_MCLK_DIV_6                   (0x2 << 14)
     #define CURRENT_GATE_MCLK_DIV_8                   (0x3 << 14)
-#endif
 #define CURRENT_GATE_M2XCLK_MASK                      (0x3 << 12)
-#ifdef VALIDATION_CHIP
-    #define CURRENT_GATE_M2XCLK_336MHZ                (0x0 << 12)
-    #define CURRENT_GATE_M2XCLK_168MHZ                (0x1 << 12)
-    #define CURRENT_GATE_M2XCLK_112MHZ                (0x2 << 12)
-    #define CURRENT_GATE_M2XCLK_84MHZ                 (0x3 << 12)
-#else
     #define CURRENT_GATE_M2XCLK_DIV_1                 (0x0 << 12)
     #define CURRENT_GATE_M2XCLK_DIV_2                 (0x1 << 12)
     #define CURRENT_GATE_M2XCLK_DIV_3                 (0x2 << 12)
     #define CURRENT_GATE_M2XCLK_DIV_4                 (0x3 << 12)
-#endif
 #define CURRENT_GATE_VGA                              BIT(10)
 #define CURRENT_GATE_PWM                              BIT(9)
 #define CURRENT_GATE_I2C                              BIT(8)
@@ -376,9 +362,6 @@
 #define MODE1_GATE_DMA                                BIT(0)
 
 #define POWER_MODE_CTRL                               0x00004C
-#ifdef VALIDATION_CHIP
-    #define POWER_MODE_CTRL_336CLK                    BIT(4)
-#endif
 #define POWER_MODE_CTRL_OSC_INPUT                     BIT(3)
 #define POWER_MODE_CTRL_ACPI                          BIT(2)
 #define POWER_MODE_CTRL_MODE_MASK                     (0x3 << 0)
@@ -400,15 +383,10 @@
 #define PLL_CTRL_BYPASS                               BIT(18)
 #define PLL_CTRL_POWER                                BIT(17)
 #define PLL_CTRL_INPUT                                BIT(16)
-#ifdef VALIDATION_CHIP
-    #define PLL_CTRL_OD_SHIFT                         14
-    #define PLL_CTRL_OD_MASK                          (0x3 << 14)
-#else
     #define PLL_CTRL_POD_SHIFT                        14
     #define PLL_CTRL_POD_MASK                         (0x3 << 14)
     #define PLL_CTRL_OD_SHIFT                         12
     #define PLL_CTRL_OD_MASK                          (0x3 << 12)
-#endif
 #define PLL_CTRL_N_SHIFT                              8
 #define PLL_CTRL_N_MASK                               (0xf << 8)
 #define PLL_CTRL_M_SHIFT                              0
@@ -422,7 +400,6 @@
 
 #define SCRATCH_DATA                                  0x00006c
 
-#ifndef VALIDATION_CHIP
 
 #define MXCLK_PLL_CTRL                                0x000070
 
@@ -431,7 +408,6 @@
 #define VGA_CONFIGURATION_PLL                         BIT(2)
 #define VGA_CONFIGURATION_MODE                        BIT(1)
 
-#endif
 
 #define GPIO_DATA                                       0x010000
 #define GPIO_DATA_31                                    BIT(31)
@@ -1020,9 +996,7 @@
 #define CRT_DISPLAY_CTRL_CRTSELECT                    BIT(25)
 #define CRT_DISPLAY_CTRL_RGBBIT                       BIT(24)
 
-#ifndef VALIDATION_CHIP
     #define CRT_DISPLAY_CTRL_CENTERING                BIT(24)
-#endif
 #define CRT_DISPLAY_CTRL_LOCK_TIMING                  BIT(23)
 #define CRT_DISPLAY_CTRL_EXPANSION                    BIT(22)
 #define CRT_DISPLAY_CTRL_VERTICAL_MODE                BIT(21)
@@ -1121,22 +1095,17 @@
 
 /* This vertical expansion below start at 0x080240 ~ 0x080264 */
 #define CRT_VERTICAL_EXPANSION                        0x080240
-#ifndef VALIDATION_CHIP
     #define CRT_VERTICAL_CENTERING_VALUE_MASK         (0xff << 24)
-#endif
 #define CRT_VERTICAL_EXPANSION_COMPARE_VALUE_MASK     (0xff << 16)
 #define CRT_VERTICAL_EXPANSION_LINE_BUFFER_MASK       (0xf << 12)
 #define CRT_VERTICAL_EXPANSION_SCALE_FACTOR_MASK      0xfff
 
 /* This horizontal expansion below start at 0x080268 ~ 0x08027C */
 #define CRT_HORIZONTAL_EXPANSION                      0x080268
-#ifndef VALIDATION_CHIP
     #define CRT_HORIZONTAL_CENTERING_VALUE_MASK       (0xff << 24)
-#endif
 #define CRT_HORIZONTAL_EXPANSION_COMPARE_VALUE_MASK   (0xff << 16)
 #define CRT_HORIZONTAL_EXPANSION_SCALE_FACTOR_MASK    0xfff
 
-#ifndef VALIDATION_CHIP
     /* Auto Centering */
     #define CRT_AUTO_CENTERING_TL                     0x080280
     #define CRT_AUTO_CENTERING_TL_TOP_MASK            (0x7ff << 16)
@@ -1146,7 +1115,6 @@
     #define CRT_AUTO_CENTERING_BR_BOTTOM_MASK         (0x7ff << 16)
     #define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT        16
     #define CRT_AUTO_CENTERING_BR_RIGHT_MASK          0x7ff
-#endif
 
 /* sm750le new register to control panel output */
 #define DISPLAY_CONTROL_750LE			      0x80288
@@ -1326,9 +1294,7 @@
 #define ZV0_CAPTURE_BUF1_ADDRESS_ADDRESS_MASK           0x3ffffff
 
 #define ZV0_CAPTURE_BUF_OFFSET                          0x090014
-#ifndef VALIDATION_CHIP
     #define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD      (0x3ff << 16)
-#endif
 #define ZV0_CAPTURE_BUF_OFFSET_OFFSET_MASK              0xffff
 
 #define ZV0_CAPTURE_FIFO_CTRL                           0x090018
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 0bb56bbec43f..ab8b68076dec 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -387,9 +387,7 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig,
 
 unsigned int sm750_format_pll_reg(struct pll_value *p_PLL)
 {
-#ifndef VALIDATION_CHIP
 	unsigned int POD = p_PLL->POD;
-#endif
 	unsigned int OD = p_PLL->OD;
 	unsigned int M = p_PLL->M;
 	unsigned int N = p_PLL->N;
@@ -401,9 +399,7 @@ unsigned int sm750_format_pll_reg(struct pll_value *p_PLL)
 	 * applied to any PLL in the calling function.
 	 */
 	return PLL_CTRL_POWER |
-#ifndef VALIDATION_CHIP
 		((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) |
-#endif
 		((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) |
 		((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) |
 		((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK);
diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c
index eaba3bc2e01a..d617f554f58d 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -58,14 +58,8 @@ void sm750_set_power_mode(unsigned int mode)
 	/* Set up other fields in Power Control Register */
 	if (mode == POWER_MODE_CTRL_MODE_SLEEP) {
 		ctrl &= ~POWER_MODE_CTRL_OSC_INPUT;
-#ifdef VALIDATION_CHIP
-		ctrl &= ~POWER_MODE_CTRL_336CLK;
-#endif
 	} else {
 		ctrl |= POWER_MODE_CTRL_OSC_INPUT;
-#ifdef VALIDATION_CHIP
-		ctrl |= POWER_MODE_CTRL_336CLK;
-#endif
 	}
 
 	/* Program new power mode. */
-- 
2.43.0



^ permalink raw reply related

* [PATCH 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code
From: Nils Lehnen @ 2026-07-18  5:51 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen

VALIDATION_CHIP is defined nowhere in the tree, yet fourteen
preprocessor conditionals in the sm750fb DDK files still test it.
Patch 1 resolves all of them (dead branches dropped, always-true
branches kept), as the driver TODO asks under "remove unused code";
patch 2 cleans up the indentation and blank lines the removal leaves
behind.

Verification, both patches: the disassembly of all ten sm750fb object
files (objdump -d, x86, CONFIG_FB_SM750=m) is bit-identical across the
series. Compile-tested only; no SM750 hardware available.

All English text in this series (cover letter, commit messages, code
comments) was translated from a German draft with the assistance of
Claude Fable 5.

Nils Lehnen (2):
  staging: sm750fb: remove dead VALIDATION_CHIP conditionals
  staging: sm750fb: unindent defines left by conditional removal

 drivers/staging/sm750fb/ddk750_reg.h   | 84 ++++++++------------------
 drivers/staging/sm750fb/ddk750_chip.c  |  4 --
 drivers/staging/sm750fb/ddk750_power.c |  6 --
 3 files changed, 24 insertions(+), 70 deletions(-)


base-commit: 64276d9bfe4d1fdd5cf2636f1065f7ea55c2defb
-- 
2.43.0



^ permalink raw reply

* Re: [PATCH] staging: sm750fb: fix mono image source stride mismatch in lynxfb_ops_imageblit()
From: Dan Carpenter @ 2026-07-18  5:44 UTC (permalink / raw)
  To: Muhammad Bilal
  Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
	linux-staging, linux-kernel
In-Reply-To: <20260718045641.468640-1-meatuni001@gmail.com>

On Sat, Jul 18, 2026 at 09:56:41AM +0500, Muhammad Bilal wrote:
> sm750_hw_imageblit() advances its monochrome source pointer by
> src_delta per scanline, and computes the correct rounded-up stride
> internally as:
> 
> 	bytes_per_scan = (width + start_bit + 7) / 8;
> 
> Its only caller, lynxfb_ops_imageblit(), instead passes src_delta as
> image->width >> 3. For widths not a multiple of 8 this under-counts
> the stride, so the source pointer falls further behind the real
> per-scanline layout on every line, corrupting the rendered image.
> 
> Use DIV_ROUND_UP() so the stride passed in matches what
> sm750_hw_imageblit() already assumes.
> 
> Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>

Looks reasonable.  Add a Fixes tag.

You have this hardware and are finding these with testing?

It would be better to move the source delta calculation into
the the sm750_hw_imageblit() since it's just width rounded up
(or rounded down if you want to be wrong I suppose).

regards,
dan carpenter


^ permalink raw reply

* [PATCH] staging: sm750fb: fix mono image source stride mismatch in lynxfb_ops_imageblit()
From: Muhammad Bilal @ 2026-07-18  4:56 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang
  Cc: Greg Kroah-Hartman, linux-fbdev, linux-staging, linux-kernel,
	Muhammad Bilal

sm750_hw_imageblit() advances its monochrome source pointer by
src_delta per scanline, and computes the correct rounded-up stride
internally as:

	bytes_per_scan = (width + start_bit + 7) / 8;

Its only caller, lynxfb_ops_imageblit(), instead passes src_delta as
image->width >> 3. For widths not a multiple of 8 this under-counts
the stride, so the source pointer falls further behind the real
per-scanline layout on every line, corrupting the rendered image.

Use DIV_ROUND_UP() so the stride passed in matches what
sm750_hw_imageblit() already assumes.

Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c..69e803f4f175 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -261,7 +261,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 	spin_lock(&sm750_dev->slock);
 
 	sm750_dev->accel.de_imageblit(&sm750_dev->accel,
-				      image->data, image->width >> 3, 0,
+				      image->data, DIV_ROUND_UP(image->width, 8), 0,
 				      base, pitch, bpp,
 				      image->dx, image->dy,
 				      image->width, image->height,
-- 
2.55.0


^ permalink raw reply related

* Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
From: Ingo Molnar @ 2026-07-17  9:38 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Sean Christopherson, Arnd Bergmann, linux-kernel, linux-pm,
	linux-edac@vger.kernel.org, x86, linux-acpi, kvm, linux-coco,
	linux-pci, virtualization, linux-ide, dri-devel, linux-fbdev,
	linux-crypto, open list:GPIO SUBSYSTEM, linux-hyperv, linux-hwmon,
	linux-perf-users, linux-mtd, platform-driver-x86,
	Rafael J . Wysocki, Daniel Lezcano, Zhang Rui,
	lukasz.luba@arm.com, Jason Baron, Borislav Petkov, Tony Luck,
	Yazen Ghannam, Len Brown, Pavel Machek, Thomas Gleixner,
	Ingo Molnar, Dave Hansen, H. Peter Anvin, Paolo Bonzini,
	Kirill A. Shutemov, Rick Edgecombe, Pu Wen, Bjorn Helgaas,
	Ajay Kaher, Alexey Makhalov, Broadcom internal kernel review list,
	Viresh Kumar, Reinette Chatre, Dave Martin, James Morse,
	Babu Moger, Tony W Wang-oc, Damien Le Moal, Niklas Cassel,
	Dave Airlie, Helge Deller, linux-geode, Olivia Mackall,
	Herbert Xu, Linus Walleij, Bartosz Golaszewski,
	Greg Kroah-Hartman, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
	Dexuan Cui, Long Li, Guenter Roeck, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	James Clark, Josh Poimboeuf, Pawan Gupta, Vitaly Kuznetsov,
	Andy Lutomirski, Boris Ostrovsky, Huang Rui, Mario Limonciello,
	Perry Yuan, K Prateek Nayak, srinivas.pandruvada@linux.intel.com,
	Artem Bityutskiy, Artem Bityutskiy, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, Ashok Raj, Hans de Goede,
	Ilpo Järvinen, Rajneesh Bhardwaj, David E Box, xen-devel
In-Reply-To: <99228803-b8b7-47a3-b77c-6fdf3b785730@suse.com>


* Juergen Gross <jgross@suse.com> wrote:

> On 02.07.26 12:07, Ingo Molnar wrote:
> > 
> > * Sean Christopherson <seanjc@google.com> wrote:
> > 
> > > > Note that the individual patches are IMO significantly easier to review
> > > > through the actual 32-bit => 64-bit variable assignment changes done
> > > > in isolation (which sometimes include minor cleanups), while
> > > > the Coccinelle semantic patch:
> > > > 
> > > >     { a(b,c) => c = a(b) }
> > > > 
> > > > which changes both the function signature and the order of terms as
> > > > well, is just a single add-on treewide patch.
> > > 
> > > Is the plan for subsystem maintainers to pick up the relevant patches,
> > > and then do the treewide change one release cycle later?
> > 
> > I'll try to keep the patches in a single tree (tip:x86/msr)
> > in the hope of not prolonging the pain two cycles - but it's
> > of course fine for maintainers to pick up the patches too
> > (most of them are standalone), we'll sort it all out in the end.
> 
> Ingo, would you be fine with me posting patch updates just as replies to the
> original patch emails? This would speed things up, as I wouldn't need to wait
> for more review input of all the patches before sending out new versions.

Sure, that works for me too. I've picked up a couple of -v2 patches
already.

Thanks,

	Ingo

^ permalink raw reply

* Re: [PATCH] staging: fbtft: fb_ra8875: replace udelay with usleep_range
From: Andy Shevchenko @ 2026-07-16 18:37 UTC (permalink / raw)
  To: mashikiselby
  Cc: Andy Shevchenko, Greg Kroah-Hartman, dri-devel, linux-fbdev,
	linux-staging, linux-kernel
In-Reply-To: <20260716-staging-testing-v1-1-2ebc0c6bb27a@gmail.com>

On Thu, Jul 16, 2026 at 01:08:33PM +0200, Selby Mashiki via B4 Relay wrote:

> udelay() busy-waits for the specified duration, consuming CPU cycles
> unnecessarily. usleep_range() is preferred for delays that can sleep,
> as it allows the scheduler to run other tasks during the wait.
> 
> Replace two instances of udelay(100) with usleep_range(100, 200) to
> use the preferred sleeping delay function.

NAK. Read mailing list archives why.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply

* Re: [PATCH v2 3/8] Add Advantech EIO Hardware Monitor driver
From: Guenter Roeck @ 2026-07-16 11:36 UTC (permalink / raw)
  To: Ramiro Manuel Silva Oliveira, Lee Jones, Linus Walleij,
	Bartosz Golaszewski, Andi Shyti, Daniel Thompson, Jingoo Han,
	Helge Deller, Wim Van Sebroeck, Rafael J. Wysocki, Daniel Lezcano,
	Zhang Rui, Lukasz Luba
  Cc: linux-kernel@vger.kernel.org, mfd@lists.linux.dev,
	linux-gpio@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-i2c@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-fbdev@vger.kernel.org, linux-watchdog@vger.kernel.org,
	linux-pm@vger.kernel.org, Wenkai.Chung, Francisco Aragon-Trivino,
	Hongzhi Wang, Mikhail Tsukerman, Thomas.Kastner
In-Reply-To: <PSAPR02MB4502BBD659D7C4FCDDCABB6294C72@PSAPR02MB4502.apcprd02.prod.outlook.com>

On 7/16/26 01:10, Ramiro Manuel Silva Oliveira wrote:
>> On 7/14/26 08:54, Ramiro Oliveira wrote:
>>> This driver controls the Hardware Monitor block of the Advantech EIO chip.
>>>
>>> There is a separate driver for the thermal device driver since it's a
>>> use case we support currently, but if it's really necessary we can
>>> move it to the same driver.
>>>
>>> Signed-off-by: Ramiro Oliveira <ramiro.oliveira@advantech.com>
>>
>> Normally there would be a hwmon driver instantiating the thermal zone(s)
>> using HWMON_C_REGISTER_TZ. If the driver actively controls thermal zones
>> since it also handles fans, that would be instantiated from the hwmon driver.
>>
>> Since you have both thermal temperature and thermal fan drivers, I am very
>> concerned that there is functionality overlap andor even conflicts. You should
>> drop this driver and configure the thermal temperature driver to instantiate a
>> hwmon device from it if so desired.
> 
> But this hwmon driver doesn't control any setting, it just displays values. Fan
> and Thermal Zone control is handled in the thermal fan and thermal
> temperature drivers.
> 
> Also this hwmon shows values not related to temperature, like voltage,
> current and intrusion.
> 
> Would it be ok if I kept the HW Monitor since it only displays values, and if
> not can I keep it to show the other non-temperature values?
> 

All other similar drivers implement a hwmon driver and instantiate the thermal
subsystem from it. You decided to implement thermal drivers. You should only
have thermal or hwmon drivers, not both.

Having both would essentially implement two drivers with overlapping functionality.
Since you decided that you want separate thermal drivers, and two of them, you
should drop the hwmon driver.

Guenter


^ permalink raw reply

* [PATCH] staging: fbtft: fb_ra8875: replace udelay with usleep_range
From: Selby Mashiki via B4 Relay @ 2026-07-16 11:08 UTC (permalink / raw)
  To: Andy Shevchenko, Greg Kroah-Hartman
  Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel,
	Selby Mashiki

From: Selby Mashiki <mashikiselby@gmail.com>

udelay() busy-waits for the specified duration, consuming CPU cycles
unnecessarily. usleep_range() is preferred for delays that can sleep,
as it allows the scheduler to run other tasks during the wait.

Replace two instances of udelay(100) with usleep_range(100, 200) to
use the preferred sleeping delay function.

Signed-off-by: Selby Mashiki <mashikiselby@gmail.com>
---
 drivers/staging/fbtft/fb_ra8875.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
index 0ab1de664..d2400bb44 100644
--- a/drivers/staging/fbtft/fb_ra8875.c
+++ b/drivers/staging/fbtft/fb_ra8875.c
@@ -210,7 +210,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
 	}
 	len--;
 
-	udelay(100);
+	usleep_range(100, 200);
 
 	if (len) {
 		buf = (u8 *)par->buf;
@@ -231,7 +231,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
 
 	/* restore user spi-speed */
 	par->fbtftops.write = fbtft_write_spi;
-	udelay(100);
+	usleep_range(100, 200);
 }
 
 static int write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)

---
base-commit: 64276d9bfe4d1fdd5cf2636f1065f7ea55c2defb
change-id: 20260716-staging-testing-b1b81d63d0d1

Best regards,
--  
Selby Mashiki <mashikiselby@gmail.com>



^ permalink raw reply related

* RE: [PATCH v2 3/8] Add Advantech EIO Hardware Monitor driver
From: Ramiro Manuel Silva Oliveira @ 2026-07-16  8:10 UTC (permalink / raw)
  To: Guenter Roeck, Lee Jones, Linus Walleij, Bartosz Golaszewski,
	Andi Shyti, Daniel Thompson, Jingoo Han, Helge Deller,
	Wim Van Sebroeck, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba
  Cc: linux-kernel@vger.kernel.org, mfd@lists.linux.dev,
	linux-gpio@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-i2c@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-fbdev@vger.kernel.org, linux-watchdog@vger.kernel.org,
	linux-pm@vger.kernel.org, Wenkai.Chung, Francisco Aragon-Trivino,
	Hongzhi Wang, Mikhail Tsukerman, Thomas.Kastner
In-Reply-To: <b7171173-aa64-4393-b9cf-77d92f2ec932@roeck-us.net>

> On 7/14/26 08:54, Ramiro Oliveira wrote:
> > This driver controls the Hardware Monitor block of the Advantech EIO chip.
> >
> > There is a separate driver for the thermal device driver since it's a
> > use case we support currently, but if it's really necessary we can
> > move it to the same driver.
> >
> > Signed-off-by: Ramiro Oliveira <ramiro.oliveira@advantech.com>
> 
> Normally there would be a hwmon driver instantiating the thermal zone(s)
> using HWMON_C_REGISTER_TZ. If the driver actively controls thermal zones
> since it also handles fans, that would be instantiated from the hwmon driver.
> 
> Since you have both thermal temperature and thermal fan drivers, I am very
> concerned that there is functionality overlap andor even conflicts. You should
> drop this driver and configure the thermal temperature driver to instantiate a
> hwmon device from it if so desired.

But this hwmon driver doesn't control any setting, it just displays values. Fan
and Thermal Zone control is handled in the thermal fan and thermal 
temperature drivers.

Also this hwmon shows values not related to temperature, like voltage,
current and intrusion.

Would it be ok if I kept the HW Monitor since it only displays values, and if
not can I keep it to show the other non-temperature values?

> 
> Thanks,
> Guenter


^ permalink raw reply

* [PATCH] staging: sm750fb: remove unused set_all_eng_off field
From: Hungyu Lin @ 2026-07-16  4:46 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: Dan Carpenter, linux-fbdev, linux-staging, linux-kernel,
	Hungyu Lin

The set_all_eng_off field is only initialized to 0 and is never set by
any caller.

Remove the unused field together with the dead cleanup path guarded by
it.

No functional change intended.

Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
 drivers/staging/sm750fb/ddk750_chip.c | 27 ---------------------------
 drivers/staging/sm750fb/ddk750_chip.h |  7 -------
 drivers/staging/sm750fb/sm750.c       |  1 -
 3 files changed, 35 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 0bb56bbec43f..aa78d0bc1d87 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -263,33 +263,6 @@ int ddk750_init_hw(struct initchip_param *p_init_param)
 		poke32(MISC_CTRL, reg);
 	}
 
-	if (p_init_param->set_all_eng_off == 1) {
-		sm750_enable_2d_engine(0);
-
-		/* Disable Overlay, if a former application left it on */
-		reg = peek32(VIDEO_DISPLAY_CTRL);
-		reg &= ~DISPLAY_CTRL_PLANE;
-		poke32(VIDEO_DISPLAY_CTRL, reg);
-
-		/* Disable video alpha, if a former application left it on */
-		reg = peek32(VIDEO_ALPHA_DISPLAY_CTRL);
-		reg &= ~DISPLAY_CTRL_PLANE;
-		poke32(VIDEO_ALPHA_DISPLAY_CTRL, reg);
-
-		/* Disable alpha plane, if a former application left it on */
-		reg = peek32(ALPHA_DISPLAY_CTRL);
-		reg &= ~DISPLAY_CTRL_PLANE;
-		poke32(ALPHA_DISPLAY_CTRL, reg);
-
-		/* Disable DMA Channel, if a former application left it on */
-		reg = peek32(DMA_ABORT_INTERRUPT);
-		reg |= DMA_ABORT_INTERRUPT_ABORT_1;
-		poke32(DMA_ABORT_INTERRUPT, reg);
-
-		/* Disable DMA Power, if a former application left it on */
-		sm750_enable_dma(0);
-	}
-
 	/* We can add more initialization as needed. */
 
 	return 0;
diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index ee2e9d90f7dd..2a13debc179f 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -76,13 +76,6 @@ struct initchip_param {
 	 */
 	unsigned short master_clock;
 
-	/*
-	 * 0 = leave all engine state untouched.
-	 * 1 = make sure they are off: 2D, Overlay,
-	 * video alpha, alpha, hardware cursors
-	 */
-	unsigned short set_all_eng_off;
-
 	/*
 	 * 0 = Do not reset the memory controller
 	 * 1 = Reset the memory controller
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index a2f244878f85..039e2033f84e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -837,7 +837,6 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
 	sm750_dev->init_parm.mem_clock = 0;
 	sm750_dev->init_parm.master_clock = 0;
 	sm750_dev->init_parm.power_mode = 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 */
-- 
2.43.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