OSDN Git Service

net: wwan: make debugfs optional
authorSergey Ryazanov <ryazanov.s.a@gmail.com>
Tue, 7 Dec 2021 09:21:40 +0000 (12:21 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 9 Dec 2021 01:58:59 +0000 (17:58 -0800)
commit283e6f5a8166f075eba78da6b867d76cc5d47e77
treeee7c7a9be96d421f0a3d5dd7bf55a63bed20c25a
parentcf90098dbb1f784661354ff8f7ca293e1ff8153b
net: wwan: make debugfs optional

Debugfs interface is optional for the regular modem use. Some distros
and users will want to disable this feature for security or kernel
size reasons. So add a configuration option that allows to completely
disable the debugfs interface of the WWAN devices.

A primary considered use case for this option was embedded firmwares.
For example, in OpenWrt, you can not completely disable debugfs, as a
lot of wireless stuff can only be configured and monitored with the
debugfs knobs. At the same time, reducing the size of a kernel and
modules is an essential task in the world of embedded software.
Disabling the WWAN and IOSM debugfs interfaces allows us to save 50K
(x86-64 build) of space for module storage. Not much, but already
considerable when you only have 16MB of storage.

So it is hard to just disable whole debugfs. Users need some fine
grained set of options to control which debugfs interface is important
and should be available and which is not.

The new configuration symbol is enabled by default and is hidden under
the EXPERT option. So a regular user would not be bothered by another
one configuration question. While an embedded distro maintainer will be
able to a little more reduce the final image size.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Acked-by: M Chetan Kumar <m.chetan.kumar@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wwan/Kconfig
drivers/net/wwan/iosm/Makefile
drivers/net/wwan/iosm/iosm_ipc_debugfs.h
drivers/net/wwan/iosm/iosm_ipc_imem.c
drivers/net/wwan/iosm/iosm_ipc_imem.h
drivers/net/wwan/iosm/iosm_ipc_trace.c
drivers/net/wwan/iosm/iosm_ipc_trace.h
drivers/net/wwan/wwan_core.c
include/linux/wwan.h