From nobody Fri Jun 12 20:22:00 2026 Received: from forward100d.mail.yandex.net (forward100d.mail.yandex.net [178.154.239.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CEC735F185; Tue, 12 May 2026 18:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.154.239.211 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778609415; cv=none; b=XSKIawLtqD6nGG4DwBPo7DjehxhowABaAwWTxOT6bcajlyQlYPzxmDg8/7mpCl2wcxVrGQTVN+513LmAA+Llled1mSDRKQtLyvFKPiQBJKUIqD/dS7ZxGMloSaB6as3SDNzhKOfOEN3zUNARlYXhyLH2y4wAw1oY4IEBUOhBv5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778609415; c=relaxed/simple; bh=dbmNzqj00M9E8ozGSSWahBG7eq8Usw3Vq6JChJl7zlI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qBabUMfnXbptmnsMg5SbEB1huszcX1WygTBiE2Wprsgcal5xWW6w8m3OFNQI2vBPaYzfkW2PjKOYe4QXPzfj0rtWI7aeGRc+Izz7nYTVFjysiZqotCJKvWFmhWSTnhcXxKdS4JikhpzaG07dnjliOdWeep9cxcNeJWYjx3vesEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=noirlang.tr; spf=pass smtp.mailfrom=noirlang.tr; dkim=pass (1024-bit key) header.d=noirlang.tr header.i=@noirlang.tr header.b=ql3IVP4u; arc=none smtp.client-ip=178.154.239.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=noirlang.tr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=noirlang.tr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=noirlang.tr header.i=@noirlang.tr header.b="ql3IVP4u" Received: from mail-nwsmtp-smtp-production-main-57.klg.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-57.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:494f:0:640:ed81:0]) by forward100d.mail.yandex.net (Yandex) with ESMTPS id CF493C0087; Tue, 12 May 2026 21:10:07 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-57.klg.yp-c.yandex.net (smtp) with ESMTPSA id x9PigJ7S2iE0-GGgGwotl; Tue, 12 May 2026 21:10:06 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noirlang.tr; s=mail; t=1778609406; bh=jb5bILg+ZhK9MUy4+9WQFLrMzitOSBnZe+kyjXuO+oM=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=ql3IVP4uVbU8Zj91+eN7GAgAV4D28CPnnu5umZsWfsykUBcF9aXErWmJDik2JDwNZ Q4SGufOWF3/HJ/x99JPtvytKfQwiaFEFy0v/xfk/r6uwOv8RsTcUqdJ7e51XfM64Tb G6XF3zFoHKcWw9+6yFqFaPuwQoEShp2qgmBzmb1A= Authentication-Results: mail-nwsmtp-smtp-production-main-57.klg.yp-c.yandex.net; dkim=pass header.i=@noirlang.tr From: Melih Emik To: Andy Shevchenko Cc: Hans de Goede , Mauro Carvalho Chehab , Greg Kroah-Hartman , Sakari Ailus , Andy Shevchenko , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Melih Emik Subject: [PATCH v2] atomisp: replace dbg_func parameter with dynamic debug Date: Tue, 12 May 2026 21:09:58 +0300 Message-ID: <20260512180958.18098-1-melihemik@noirlang.tr> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The dbg_func module parameter in atomisp_v4l2.c toggles the CSS debug_print callback through a writable module parameter. Removing only the parameter drops the runtime switch that users had through sysfs. Keep the debug path available at runtime by routing CSS debug output through dynamic debug instead. The callback remains installed, but its output is controlled by the dynamic debug callsite. CSS error output continues to use vprintk(). Remove the obsolete parameter, its global state and the unused get/set helpers. Signed-off-by: Melih Emik Reviewed-by: Andy Shevchenko --- .../media/atomisp/pci/atomisp_common.h | 1 - .../media/atomisp/pci/atomisp_compat_css20.c | 47 ++++++------------- .../media/atomisp/pci/atomisp_compat_css20.h | 3 -- .../staging/media/atomisp/pci/atomisp_v4l2.c | 6 --- 4 files changed, 15 insertions(+), 42 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_common.h b/drivers/s= taging/media/atomisp/pci/atomisp_common.h index a2462fc306fb..145b35ad13cb 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_common.h +++ b/drivers/staging/media/atomisp/pci/atomisp_common.h @@ -21,7 +21,6 @@ #include "ia_css.h" =20 extern int dbg_level; -extern int dbg_func; extern int pad_w; extern int pad_h; =20 diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/dri= vers/staging/media/atomisp/pci/atomisp_compat_css20.c index be5f37f4a6fd..fb18c204266b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -25,6 +25,7 @@ #include "sh_css_hrt.h" #include "ia_css_isys.h" =20 +#include #include #include =20 @@ -152,6 +153,19 @@ static int __printf(1, 0) atomisp_vprintk(const char = *fmt, va_list args) return 0; } =20 +static int __printf(1, 0) atomisp_vpr_debug(const char *fmt, va_list args) +{ +#if defined(CONFIG_DYNAMIC_DEBUG) + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, "CSS debug"); + + if (DYNAMIC_DEBUG_BRANCH(descriptor)) + vprintk(fmt, args); +#elif defined(DEBUG) + vprintk(fmt, args); +#endif + return 0; +} + void atomisp_load_uint32(hrt_address addr, uint32_t *data) { *data =3D atomisp_css2_hw_load_32(addr); @@ -745,20 +759,6 @@ int atomisp_css_init(struct atomisp_device *isp) return 0; } =20 -static inline int __set_css_print_env(struct atomisp_device *isp, int opt) -{ - int ret =3D 0; - - if (opt =3D=3D 0) - isp->css_env.isp_css_env.print_env.debug_print =3D NULL; - else if (opt =3D=3D 1) - isp->css_env.isp_css_env.print_env.debug_print =3D atomisp_vprintk; - else - ret =3D -EINVAL; - - return ret; -} - int atomisp_css_load_firmware(struct atomisp_device *isp) { int err; @@ -783,8 +783,7 @@ int atomisp_css_load_firmware(struct atomisp_device *is= p) isp->css_env.isp_css_env.hw_access_env.load =3D atomisp_css2_hw_load; isp->css_env.isp_css_env.hw_access_env.store =3D atomisp_css2_hw_store; =20 - __set_css_print_env(isp, dbg_func); - + isp->css_env.isp_css_env.print_env.debug_print =3D atomisp_vpr_debug; isp->css_env.isp_css_env.print_env.error_print =3D atomisp_vprintk; =20 /* load isp fw into ISP memory */ @@ -3360,22 +3359,6 @@ void atomisp_css_set_isp_config_applied_frame(struct= atomisp_sub_device *asd, asd->params.config.output_frame =3D output_frame; } =20 -int atomisp_get_css_dbgfunc(void) -{ - return dbg_func; -} - -int atomisp_set_css_dbgfunc(struct atomisp_device *isp, int opt) -{ - int ret; - - ret =3D __set_css_print_env(isp, opt); - if (ret =3D=3D 0) - dbg_func =3D opt; - - return ret; -} - void atomisp_en_dz_capt_pipe(struct atomisp_sub_device *asd, bool enable) { ia_css_en_dz_capt_pipe( diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.h b/dri= vers/staging/media/atomisp/pci/atomisp_compat_css20.h index 75781807544a..e1c0b7e77974 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.h +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.h @@ -150,9 +150,6 @@ void atomisp_css_set_isp_config_id(struct atomisp_sub_d= evice *asd, void atomisp_css_set_isp_config_applied_frame(struct atomisp_sub_device *a= sd, struct ia_css_frame *output_frame); =20 -int atomisp_get_css_dbgfunc(void); - -int atomisp_set_css_dbgfunc(struct atomisp_device *isp, int opt); struct ia_css_dvs_grid_info *atomisp_css_get_dvs_grid_info( struct ia_css_grid_info *grid_info); #endif diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/sta= ging/media/atomisp/pci/atomisp_v4l2.c index 900a67552d6a..d4374b7fc1ba 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -48,12 +48,6 @@ int dbg_level; module_param(dbg_level, int, 0644); MODULE_PARM_DESC(dbg_level, "debug message level (default:0)"); =20 -/* log function switch */ -int dbg_func =3D 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 * exports extra. If these are kept at the 10x8 that they were on, in yuv --=20 2.54.0