Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH v4 0/2] staging: media: atomisp: Cleanup unused module parameters
@ 2026-07-21 16:35 Prajval Chaudhary
  2026-07-21 16:35 ` [PATCH v4 1/2] staging: media: atomisp: Remove pad_w and pad_h " Prajval Chaudhary
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Prajval Chaudhary @ 2026-07-21 16:35 UTC (permalink / raw)
  To: Andy Shevchenko, Hans de Goede, Mauro Carvalho Chehab
  Cc: Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-kernel,
	linux-staging, Prajval Chaudhary

This series cleans up unused module parameters from the atomisp driver.

Patch 1 removes unused 'pad_w' and 'pad_h' module parameters.
Patch 2 removes unused 'dbg_level' and 'dbg_func' module parameters, 
and updates ia_css_debug_vdtrace() to filter trace logging to WARNING 
level or below to avoid potential kernel log flooding.

Changes in v4:
 - Fix macro constant name in ia_css_debug_vdtrace()
   to IA_CSS_DEBUG_WARNING.
 - Guard vprintk() with level check to prevent log flooding.

Changes in v3:
 - [Add brief note if applicable]

Changes in v2:
 - [Add brief note if applicable]

Prajval Chaudhary (2):
  staging: media: atomisp: Remove pad_w and pad_h module parameters
  staging: media: atomisp: Remove dbg_level and dbg_func module
    parameters

 .../staging/media/atomisp/pci/atomisp_common.h    |  6 ++----
 .../media/atomisp/pci/atomisp_compat_css20.c      | 12 +++---------
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c  | 15 ++-------------
 .../pci/runtime/debug/interface/ia_css_debug.h    |  7 +++----
 .../atomisp/pci/runtime/debug/src/ia_css_debug.c  |  4 ++--
 5 files changed, 12 insertions(+), 32 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v4 1/2] staging: media: atomisp: Remove pad_w and pad_h module parameters
  2026-07-21 16:35 [PATCH v4 0/2] staging: media: atomisp: Cleanup unused module parameters Prajval Chaudhary
@ 2026-07-21 16:35 ` Prajval Chaudhary
  2026-07-21 16:35 ` [PATCH v4 2/2] staging: media: atomisp: Remove dbg_level and dbg_func " Prajval Chaudhary
  2026-07-21 20:56 ` [PATCH v4 0/2] staging: media: atomisp: Cleanup unused " Andy Shevchenko
  2 siblings, 0 replies; 5+ messages in thread
From: Prajval Chaudhary @ 2026-07-21 16:35 UTC (permalink / raw)
  To: Andy Shevchenko, Hans de Goede, Mauro Carvalho Chehab
  Cc: Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-kernel,
	linux-staging, Prajval Chaudhary

Remove the 'pad_w' and 'pad_h' module parameters to prevent userspace
from overriding internal ISP hardware padding boundaries. Convert them
into internal driver constants instead.

Signed-off-by: Prajval Chaudhary <prajvalchaudhari733@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp_common.h | 4 ++--
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c   | 8 ++------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_common.h b/drivers/staging/media/atomisp/pci/atomisp_common.h
index a2462fc306fb..7c6c0124ff72 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_common.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_common.h
@@ -22,8 +22,8 @@
 
 extern int dbg_level;
 extern int dbg_func;
-extern int pad_w;
-extern int pad_h;
+extern const int pad_w;
+extern const int pad_h;
 
 /* Minimum padding requirements for ISP2400 (BYT) */
 #define ISP2400_MIN_PAD_W		12
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 812230397409..d117fea2860c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -64,13 +64,9 @@ MODULE_PARM_DESC(dbg_func,
  * output res, and isp output res. however since we do not have this yet,
  * the chosen solution is the next best thing.
  */
-int pad_w = 16;
-module_param(pad_w, int, 0644);
-MODULE_PARM_DESC(pad_w, "extra data for ISP processing");
+const int pad_w = 16;
 
-int pad_h = 16;
-module_param(pad_h, int, 0644);
-MODULE_PARM_DESC(pad_h, "extra data for ISP processing");
+const int pad_h = 16;
 
 /*
  * FIXME: this is a hack to make easier to support ISP2401 variant.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v4 2/2] staging: media: atomisp: Remove dbg_level and dbg_func module parameters
  2026-07-21 16:35 [PATCH v4 0/2] staging: media: atomisp: Cleanup unused module parameters Prajval Chaudhary
  2026-07-21 16:35 ` [PATCH v4 1/2] staging: media: atomisp: Remove pad_w and pad_h " Prajval Chaudhary
@ 2026-07-21 16:35 ` Prajval Chaudhary
  2026-07-21 20:55   ` Andy Shevchenko
  2026-07-21 20:56 ` [PATCH v4 0/2] staging: media: atomisp: Cleanup unused " Andy Shevchenko
  2 siblings, 1 reply; 5+ messages in thread
From: Prajval Chaudhary @ 2026-07-21 16:35 UTC (permalink / raw)
  To: Andy Shevchenko, Hans de Goede, Mauro Carvalho Chehab
  Cc: Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-kernel,
	linux-staging, Prajval Chaudhary

Remove the 'dbg_level' and 'dbg_func' module parameters to align the
driver's debug facility with standard Linux kernel APIs (printk/vprintk).

The internal logic relying on custom debug parameters has been updated
so that message logging and function tracing no longer depend on exposed
userspace module parameters.

Signed-off-by: Prajval Chaudhary <prajvalchaudhari733@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp_common.h   |  2 --
 .../staging/media/atomisp/pci/atomisp_compat_css20.c | 12 +++---------
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c     |  7 -------
 .../pci/runtime/debug/interface/ia_css_debug.h       |  7 +++----
 .../atomisp/pci/runtime/debug/src/ia_css_debug.c     |  4 ++--
 5 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_common.h b/drivers/staging/media/atomisp/pci/atomisp_common.h
index 7c6c0124ff72..aa230c3708dd 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_common.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_common.h
@@ -20,8 +20,6 @@
 
 #include "ia_css.h"
 
-extern int dbg_level;
-extern int dbg_func;
 extern const int pad_w;
 extern const int pad_h;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index ea49ebe2da5c..647f6e7e2455 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -784,7 +784,7 @@ int atomisp_css_load_firmware(struct atomisp_device *isp)
 	isp->css_env.isp_css_env.hw_access_env.load = atomisp_css2_hw_load;
 	isp->css_env.isp_css_env.hw_access_env.store = atomisp_css2_hw_store;
 
-	__set_css_print_env(isp, dbg_func);
+	__set_css_print_env(isp, 1);
 
 	isp->css_env.isp_css_env.print_env.error_print = atomisp_vprintk;
 
@@ -3372,18 +3372,12 @@ void atomisp_css_set_isp_config_applied_frame(struct atomisp_sub_device *asd,
 
 int atomisp_get_css_dbgfunc(void)
 {
-	return dbg_func;
+	return 1;
 }
 
 int atomisp_set_css_dbgfunc(struct atomisp_device *isp, int opt)
 {
-	int ret;
-
-	ret = __set_css_print_env(isp, opt);
-	if (ret == 0)
-		dbg_func = opt;
-
-	return ret;
+	return __set_css_print_env(isp, opt);
 }
 
 void atomisp_en_dz_capt_pipe(struct atomisp_sub_device *asd, bool enable)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index d117fea2860c..55b3d4d3d6ad 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -45,15 +45,8 @@
 #define CSTATE_EXIT_LATENCY_C1  1
 
 /* cross component debug message flag */
-int dbg_level;
-module_param(dbg_level, int, 0644);
-MODULE_PARM_DESC(dbg_level, "debug message level (default:0)");
 
 /* log function switch */
-int dbg_func = 1;
-module_param(dbg_func, int, 0644);
-MODULE_PARM_DESC(dbg_func,
-		 "log function switch non/printk (default:printk)");
 
 /*
  * Set to 16x16 since this is the amount of lines and pixels the sensor
diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h b/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h
index 2d0e906530af..029adbdca945 100644
--- a/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h
+++ b/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h
@@ -8,7 +8,7 @@
 #define _IA_CSS_DEBUG_H_
 
 /*! \file */
-
+#include <linux/printk.h>
 #include <type_support.h>
 #include <linux/stdarg.h>
 #include <linux/bits.h>
@@ -39,7 +39,6 @@
 #define IA_CSS_DEBUG_INFO    9
 
 /* Global variable which controls the verbosity levels of the debug tracing */
-extern int dbg_level;
 
 /*! @brief Enum defining the different isp parameters to dump.
  *  Values can be combined to dump a combination of sets.
@@ -125,8 +124,8 @@ static inline void __printf(2, 0) ia_css_debug_vdtrace(unsigned int level,
 						       const char *fmt,
 						       va_list args)
 {
-	if (dbg_level >= level)
-		sh_css_vprint(fmt, args);
+	if (level <= IA_CSS_DEBUG_WARNING)
+		vprintk(fmt, args);
 }
 
 __printf(2, 3) void ia_css_debug_dtrace(unsigned int level,
diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
index 5113aa5973f3..86b2cca2f441 100644
--- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
+++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
@@ -135,13 +135,13 @@ void ia_css_debug_dtrace(unsigned int level, const char *fmt, ...)
 
 void ia_css_debug_set_dtrace_level(const unsigned int trace_level)
 {
-	dbg_level = trace_level;
+	/* Trace level is now controlled dynamically via Linux kernel dynamic debug facility */
 	return;
 }
 
 unsigned int ia_css_debug_get_dtrace_level(void)
 {
-	return dbg_level;
+	return 0;
 }
 
 static const char *debug_stream_format2str(const enum atomisp_input_format
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 2/2] staging: media: atomisp: Remove dbg_level and dbg_func module parameters
  2026-07-21 16:35 ` [PATCH v4 2/2] staging: media: atomisp: Remove dbg_level and dbg_func " Prajval Chaudhary
@ 2026-07-21 20:55   ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2026-07-21 20:55 UTC (permalink / raw)
  To: Prajval Chaudhary
  Cc: Andy Shevchenko, Hans de Goede, Mauro Carvalho Chehab,
	Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-kernel,
	linux-staging

On Tue, Jul 21, 2026 at 10:05:32PM +0530, Prajval Chaudhary wrote:
> Remove the 'dbg_level' and 'dbg_func' module parameters to align the
> driver's debug facility with standard Linux kernel APIs (printk/vprintk).
> 
> The internal logic relying on custom debug parameters has been updated
> so that message logging and function tracing no longer depend on exposed
> userspace module parameters.

...

>  /* cross component debug message flag */
> -int dbg_level;
> -module_param(dbg_level, int, 0644);
> -MODULE_PARM_DESC(dbg_level, "debug message level (default:0)");

And what level is the default now? What the difference with the other levels?

>  /* log function switch */
> -int dbg_func = 1;
> -module_param(dbg_func, int, 0644);
> -MODULE_PARM_DESC(dbg_func,
> -		 "log function switch non/printk (default:printk)");

What are the other options?

...

>  /*! \file */
> -

Stray blank line removal.

> +#include <linux/printk.h>

Locate it in the linux/*.h group below. But I agree that at some point this
custom type_support should be moved down.

>  #include <type_support.h>
>  #include <linux/stdarg.h>
>  #include <linux/bits.h>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 0/2] staging: media: atomisp: Cleanup unused module parameters
  2026-07-21 16:35 [PATCH v4 0/2] staging: media: atomisp: Cleanup unused module parameters Prajval Chaudhary
  2026-07-21 16:35 ` [PATCH v4 1/2] staging: media: atomisp: Remove pad_w and pad_h " Prajval Chaudhary
  2026-07-21 16:35 ` [PATCH v4 2/2] staging: media: atomisp: Remove dbg_level and dbg_func " Prajval Chaudhary
@ 2026-07-21 20:56 ` Andy Shevchenko
  2 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2026-07-21 20:56 UTC (permalink / raw)
  To: Prajval Chaudhary
  Cc: Andy Shevchenko, Hans de Goede, Mauro Carvalho Chehab,
	Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-kernel,
	linux-staging

On Tue, Jul 21, 2026 at 10:05:30PM +0530, Prajval Chaudhary wrote:
> This series cleans up unused module parameters from the atomisp driver.
> 
> Patch 1 removes unused 'pad_w' and 'pad_h' module parameters.
> Patch 2 removes unused 'dbg_level' and 'dbg_func' module parameters, 
> and updates ia_css_debug_vdtrace() to filter trace logging to WARNING 
> level or below to avoid potential kernel log flooding.

Have you run (or simulate behaviour of) this driver? Can you show the difference
in the debug output before and after these patches?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-21 20:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-21 16:35 [PATCH v4 0/2] staging: media: atomisp: Cleanup unused module parameters Prajval Chaudhary
2026-07-21 16:35 ` [PATCH v4 1/2] staging: media: atomisp: Remove pad_w and pad_h " Prajval Chaudhary
2026-07-21 16:35 ` [PATCH v4 2/2] staging: media: atomisp: Remove dbg_level and dbg_func " Prajval Chaudhary
2026-07-21 20:55   ` Andy Shevchenko
2026-07-21 20:56 ` [PATCH v4 0/2] staging: media: atomisp: Cleanup unused " Andy Shevchenko

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