-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sergey Ryazanov says: ==================== WWAN debugfs tweaks This is a follow-up series to just applied IOSM (and WWAN) debugfs interface support [1]. The series has two main goals: 1. move the driver-specific debugfs knobs to a subdirectory; 2. make the debugfs interface optional for both IOSM and for the WWAN core. As for the first part, I must say that it was my mistake. I suggested to place debugfs entries under a common per WWAN device directory. But I missed the driver subdirectory in the example, so it become: /sys/kernel/debugfs/wwan/wwan0/trace Since the traces collection is a driver-specific feature, it is better to keep it under the driver-specific subdirectory: /sys/kernel/debugfs/wwan/wwan0/iosm/trace It is desirable to be able to entirely disable the debugfs interface. It can be disabled for several reasons, including security and consumed storage space. See detailed rationale with usage example in the 4th patch. The changes themselves are relatively simple, but require a code rearrangement. So to make changes clear, I chose to split them into preparatory and main changes and properly describe each of them. IOSM part is compile-tested only since I do not have IOSM supported device, so it needs Ack from the driver developers. I would like to thank Johannes Berg and Leon Romanovsky. Their suggestions and comments helped a lot to rework the initial over-engineered solution to something less confusing and much more simple. Thanks! 1. https://lore.kernel.org/netdev/20211120162155.1216081-1-m.chetan.kumar@linux.intel.com 2. https://patchwork.kernel.org/project/netdevbpf/patch/20211204174033.950528-1-arnd@kernel.org/ ==================== Link: https://lore.kernel.org/r/20211207092140.19142-1-ryazanov.s.a@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Showing
12 changed files
with
134 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* | ||
* Copyright (C) 2020-2021 Intel Corporation. | ||
*/ | ||
|
||
#include <linux/debugfs.h> | ||
#include <linux/wwan.h> | ||
|
||
#include "iosm_ipc_imem.h" | ||
#include "iosm_ipc_trace.h" | ||
#include "iosm_ipc_debugfs.h" | ||
|
||
void ipc_debugfs_init(struct iosm_imem *ipc_imem) | ||
{ | ||
struct dentry *debugfs_pdev = wwan_get_debugfs_dir(ipc_imem->dev); | ||
|
||
ipc_imem->debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, | ||
debugfs_pdev); | ||
|
||
ipc_imem->trace = ipc_trace_init(ipc_imem); | ||
if (!ipc_imem->trace) | ||
dev_warn(ipc_imem->dev, "trace channel init failed"); | ||
} | ||
|
||
void ipc_debugfs_deinit(struct iosm_imem *ipc_imem) | ||
{ | ||
ipc_trace_deinit(ipc_imem->trace); | ||
debugfs_remove_recursive(ipc_imem->debugfs_dir); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only | ||
* | ||
* Copyright (C) 2020-2021 Intel Corporation. | ||
*/ | ||
|
||
#ifndef IOSM_IPC_DEBUGFS_H | ||
#define IOSM_IPC_DEBUGFS_H | ||
|
||
#ifdef CONFIG_WWAN_DEBUGFS | ||
void ipc_debugfs_init(struct iosm_imem *ipc_imem); | ||
void ipc_debugfs_deinit(struct iosm_imem *ipc_imem); | ||
#else | ||
static inline void ipc_debugfs_init(struct iosm_imem *ipc_imem) {} | ||
static inline void ipc_debugfs_deinit(struct iosm_imem *ipc_imem) {} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters