Driver core changes for 6.1-rc1
Here is the big set of driver core and debug printk changes for 6.1-rc1.
Included in here is:
- dynamic debug updates for the core and the drm subsystem. The
drm changes have all been acked by the relevant maintainers.
- kernfs fixes for syzbot reported problems
- kernfs refactors and updates for cgroup requirements
- magic number cleanups and removals from the kernel tree (they
were not being used and they really did not actually do
anything.)
- other tiny cleanups
All of these have been in linux-next for a while with no reported
issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCY0BYUA8cZ3JlZ0Brcm9h
aC5jb20ACgkQMUfUDdst+ylozwCdFRlcghaf7XBUyNgRZRwMC+oQI8EAn1G/nEDE
6aFd2er41uK0IGQnSmYO
=OK0k
-----END PGP SIGNATURE-----
Merge tag 'driver-core-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH:
"Here is the big set of driver core and debug printk changes for
6.1-rc1. Included in here is:
- dynamic debug updates for the core and the drm subsystem. The drm
changes have all been acked by the relevant maintainers
- kernfs fixes for syzbot reported problems
- kernfs refactors and updates for cgroup requirements
- magic number cleanups and removals from the kernel tree (they were
not being used and they really did not actually do anything)
- other tiny cleanups
All of these have been in linux-next for a while with no reported
issues"
* tag 'driver-core-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (74 commits)
docs: filesystems: sysfs: Make text and code for ->show() consistent
Documentation: NBD_REQUEST_MAGIC isn't a magic number
a.out: restore CMAGIC
device property: Add const qualifier to device_get_match_data() parameter
drm_print: add _ddebug descriptor to drm_*dbg prototypes
drm_print: prefer bare printk KERN_DEBUG on generic fn
drm_print: optimize drm_debug_enabled for jump-label
drm-print: add drm_dbg_driver to improve namespace symmetry
drm-print.h: include dyndbg header
drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro
drm_print: interpose drm_*dbg with forwarding macros
drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.
drm_print: condense enum drm_debug_category
debugfs: use DEFINE_SHOW_ATTRIBUTE to define debugfs_regset32_fops
driver core: use IS_ERR_OR_NULL() helper in device_create_groups_vargs()
Documentation: ENI155_MAGIC isn't a magic number
Documentation: NBD_REPLY_MAGIC isn't a magic number
nbd: remove define-only NBD_MAGIC, previously magic number
Documentation: FW_HEADER_MAGIC isn't a magic number
Documentation: EEPROM_MAGIC_VALUE isn't a magic number
...
This commit is contained in:
commit
e8bc52cb8d
46 changed files with 1320 additions and 696 deletions
|
|
@ -114,6 +114,7 @@ int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
|
|||
int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
|
||||
int cgroup_rm_cftypes(struct cftype *cfts);
|
||||
void cgroup_file_notify(struct cgroup_file *cfile);
|
||||
void cgroup_file_show(struct cgroup_file *cfile, bool show);
|
||||
|
||||
int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen);
|
||||
int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
#include <linux/jump_label.h>
|
||||
#endif
|
||||
|
||||
#include <linux/build_bug.h>
|
||||
|
||||
/*
|
||||
* An instance of this structure is created in a special
|
||||
* ELF section at every dynamic debug callsite. At runtime,
|
||||
|
|
@ -21,6 +23,9 @@ struct _ddebug {
|
|||
const char *filename;
|
||||
const char *format;
|
||||
unsigned int lineno:18;
|
||||
#define CLS_BITS 6
|
||||
unsigned int class_id:CLS_BITS;
|
||||
#define _DPRINTK_CLASS_DFLT ((1 << CLS_BITS) - 1)
|
||||
/*
|
||||
* The flags field controls the behaviour at the callsite.
|
||||
* The bits here are changed dynamically when the user
|
||||
|
|
@ -51,15 +56,82 @@ struct _ddebug {
|
|||
#endif
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
enum class_map_type {
|
||||
DD_CLASS_TYPE_DISJOINT_BITS,
|
||||
/**
|
||||
* DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, one per bit.
|
||||
* expecting hex input. Built for drm.debug, basis for other types.
|
||||
*/
|
||||
DD_CLASS_TYPE_LEVEL_NUM,
|
||||
/**
|
||||
* DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0-N.
|
||||
* N turns on just bits N-1 .. 0, so N=0 turns all bits off.
|
||||
*/
|
||||
DD_CLASS_TYPE_DISJOINT_NAMES,
|
||||
/**
|
||||
* DD_CLASS_TYPE_DISJOINT_NAMES: input is a CSV of [+-]CLASS_NAMES,
|
||||
* classes are independent, like _DISJOINT_BITS.
|
||||
*/
|
||||
DD_CLASS_TYPE_LEVEL_NAMES,
|
||||
/**
|
||||
* DD_CLASS_TYPE_LEVEL_NAMES: input is a CSV of [+-]CLASS_NAMES,
|
||||
* intended for names like: INFO,DEBUG,TRACE, with a module prefix
|
||||
* avoid EMERG,ALERT,CRIT,ERR,WARNING: they're not debug
|
||||
*/
|
||||
};
|
||||
|
||||
struct ddebug_class_map {
|
||||
struct list_head link;
|
||||
struct module *mod;
|
||||
const char *mod_name; /* needed for builtins */
|
||||
const char **class_names;
|
||||
const int length;
|
||||
const int base; /* index of 1st .class_id, allows split/shared space */
|
||||
enum class_map_type map_type;
|
||||
};
|
||||
|
||||
/**
|
||||
* DECLARE_DYNDBG_CLASSMAP - declare classnames known by a module
|
||||
* @_var: a struct ddebug_class_map, passed to module_param_cb
|
||||
* @_type: enum class_map_type, chooses bits/verbose, numeric/symbolic
|
||||
* @_base: offset of 1st class-name. splits .class_id space
|
||||
* @classes: class-names used to control class'd prdbgs
|
||||
*/
|
||||
#define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \
|
||||
static const char *_var##_classnames[] = { __VA_ARGS__ }; \
|
||||
static struct ddebug_class_map __aligned(8) __used \
|
||||
__section("__dyndbg_classes") _var = { \
|
||||
.mod = THIS_MODULE, \
|
||||
.mod_name = KBUILD_MODNAME, \
|
||||
.base = _base, \
|
||||
.map_type = _maptype, \
|
||||
.length = NUM_TYPE_ARGS(char*, __VA_ARGS__), \
|
||||
.class_names = _var##_classnames, \
|
||||
}
|
||||
#define NUM_TYPE_ARGS(eltype, ...) \
|
||||
(sizeof((eltype[]){__VA_ARGS__}) / sizeof(eltype))
|
||||
|
||||
/* encapsulate linker provided built-in (or module) dyndbg data */
|
||||
struct _ddebug_info {
|
||||
struct _ddebug *descs;
|
||||
struct ddebug_class_map *classes;
|
||||
unsigned int num_descs;
|
||||
unsigned int num_classes;
|
||||
};
|
||||
|
||||
struct ddebug_class_param {
|
||||
union {
|
||||
unsigned long *bits;
|
||||
unsigned int *lvl;
|
||||
};
|
||||
char flags[8];
|
||||
const struct ddebug_class_map *map;
|
||||
};
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG_CORE)
|
||||
|
||||
/* exported for module authors to exercise >control */
|
||||
int dynamic_debug_exec_queries(const char *query, const char *modname);
|
||||
int ddebug_add_module(struct _ddebug_info *dyndbg, const char *modname);
|
||||
|
||||
int ddebug_add_module(struct _ddebug *tab, unsigned int n,
|
||||
const char *modname);
|
||||
extern int ddebug_remove_module(const char *mod_name);
|
||||
extern __printf(2, 3)
|
||||
void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);
|
||||
|
|
@ -87,7 +159,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
|
|||
const struct ib_device *ibdev,
|
||||
const char *fmt, ...);
|
||||
|
||||
#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
|
||||
#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt) \
|
||||
static struct _ddebug __aligned(8) \
|
||||
__section("__dyndbg") name = { \
|
||||
.modname = KBUILD_MODNAME, \
|
||||
|
|
@ -96,8 +168,14 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
|
|||
.format = (fmt), \
|
||||
.lineno = __LINE__, \
|
||||
.flags = _DPRINTK_FLAGS_DEFAULT, \
|
||||
.class_id = cls, \
|
||||
_DPRINTK_KEY_INIT \
|
||||
}
|
||||
}; \
|
||||
BUILD_BUG_ON_MSG(cls > _DPRINTK_CLASS_DFLT, \
|
||||
"classid value overflow")
|
||||
|
||||
#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
|
||||
DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, _DPRINTK_CLASS_DFLT, fmt)
|
||||
|
||||
#ifdef CONFIG_JUMP_LABEL
|
||||
|
||||
|
|
@ -128,17 +206,34 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
|
|||
|
||||
#endif /* CONFIG_JUMP_LABEL */
|
||||
|
||||
#define __dynamic_func_call(id, fmt, func, ...) do { \
|
||||
DEFINE_DYNAMIC_DEBUG_METADATA(id, fmt); \
|
||||
if (DYNAMIC_DEBUG_BRANCH(id)) \
|
||||
func(&id, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define __dynamic_func_call_no_desc(id, fmt, func, ...) do { \
|
||||
DEFINE_DYNAMIC_DEBUG_METADATA(id, fmt); \
|
||||
/*
|
||||
* Factory macros: ($prefix)dynamic_func_call($suffix)
|
||||
*
|
||||
* Lower layer (with __ prefix) gets the callsite metadata, and wraps
|
||||
* the func inside a debug-branch/static-key construct. Upper layer
|
||||
* (with _ prefix) does the UNIQUE_ID once, so that lower can ref the
|
||||
* name/label multiple times, and tie the elements together.
|
||||
* Multiple flavors:
|
||||
* (|_cls): adds in _DPRINT_CLASS_DFLT as needed
|
||||
* (|_no_desc): former gets callsite descriptor as 1st arg (for prdbgs)
|
||||
*/
|
||||
#define __dynamic_func_call_cls(id, cls, fmt, func, ...) do { \
|
||||
DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \
|
||||
if (DYNAMIC_DEBUG_BRANCH(id)) \
|
||||
func(__VA_ARGS__); \
|
||||
func(&id, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#define __dynamic_func_call(id, fmt, func, ...) \
|
||||
__dynamic_func_call_cls(id, _DPRINTK_CLASS_DFLT, fmt, \
|
||||
func, ##__VA_ARGS__)
|
||||
|
||||
#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) do { \
|
||||
DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \
|
||||
if (DYNAMIC_DEBUG_BRANCH(id)) \
|
||||
func(__VA_ARGS__); \
|
||||
} while (0)
|
||||
#define __dynamic_func_call_no_desc(id, fmt, func, ...) \
|
||||
__dynamic_func_call_cls_no_desc(id, _DPRINTK_CLASS_DFLT, \
|
||||
fmt, func, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* "Factory macro" for generating a call to func, guarded by a
|
||||
|
|
@ -148,22 +243,33 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
|
|||
* the varargs. Note that fmt is repeated in invocations of this
|
||||
* macro.
|
||||
*/
|
||||
#define _dynamic_func_call_cls(cls, fmt, func, ...) \
|
||||
__dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
|
||||
#define _dynamic_func_call(fmt, func, ...) \
|
||||
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
|
||||
_dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* A variant that does the same, except that the descriptor is not
|
||||
* passed as the first argument to the function; it is only called
|
||||
* with precisely the macro's varargs.
|
||||
*/
|
||||
#define _dynamic_func_call_no_desc(fmt, func, ...) \
|
||||
__dynamic_func_call_no_desc(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
|
||||
#define _dynamic_func_call_cls_no_desc(cls, fmt, func, ...) \
|
||||
__dynamic_func_call_cls_no_desc(__UNIQUE_ID(ddebug), cls, fmt, \
|
||||
func, ##__VA_ARGS__)
|
||||
#define _dynamic_func_call_no_desc(fmt, func, ...) \
|
||||
_dynamic_func_call_cls_no_desc(_DPRINTK_CLASS_DFLT, fmt, \
|
||||
func, ##__VA_ARGS__)
|
||||
|
||||
#define dynamic_pr_debug_cls(cls, fmt, ...) \
|
||||
_dynamic_func_call_cls(cls, fmt, __dynamic_pr_debug, \
|
||||
pr_fmt(fmt), ##__VA_ARGS__)
|
||||
|
||||
#define dynamic_pr_debug(fmt, ...) \
|
||||
_dynamic_func_call(fmt, __dynamic_pr_debug, \
|
||||
_dynamic_func_call(fmt, __dynamic_pr_debug, \
|
||||
pr_fmt(fmt), ##__VA_ARGS__)
|
||||
|
||||
#define dynamic_dev_dbg(dev, fmt, ...) \
|
||||
_dynamic_func_call(fmt,__dynamic_dev_dbg, \
|
||||
_dynamic_func_call(fmt, __dynamic_dev_dbg, \
|
||||
dev, fmt, ##__VA_ARGS__)
|
||||
|
||||
#define dynamic_netdev_dbg(dev, fmt, ...) \
|
||||
|
|
@ -181,14 +287,24 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
|
|||
KERN_DEBUG, prefix_str, prefix_type, \
|
||||
rowsize, groupsize, buf, len, ascii)
|
||||
|
||||
struct kernel_param;
|
||||
int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp);
|
||||
int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp);
|
||||
|
||||
/* for test only, generally expect drm.debug style macro wrappers */
|
||||
#define __pr_debug_cls(cls, fmt, ...) do { \
|
||||
BUILD_BUG_ON_MSG(!__builtin_constant_p(cls), \
|
||||
"expecting constant class int/enum"); \
|
||||
dynamic_pr_debug_cls(cls, fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#else /* !CONFIG_DYNAMIC_DEBUG_CORE */
|
||||
|
||||
#include <linux/string.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/printk.h>
|
||||
|
||||
static inline int ddebug_add_module(struct _ddebug *tab, unsigned int n,
|
||||
const char *modname)
|
||||
static inline int ddebug_add_module(struct _ddebug_info *dinfo, const char *modname)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -201,7 +317,7 @@ static inline int ddebug_remove_module(const char *mod)
|
|||
static inline int ddebug_dyndbg_module_param_cb(char *param, char *val,
|
||||
const char *modname)
|
||||
{
|
||||
if (strstr(param, "dyndbg")) {
|
||||
if (!strcmp(param, "dyndbg")) {
|
||||
/* avoid pr_warn(), which wants pr_fmt() fully defined */
|
||||
printk(KERN_WARNING "dyndbg param is supported only in "
|
||||
"CONFIG_DYNAMIC_DEBUG builds\n");
|
||||
|
|
@ -221,12 +337,14 @@ static inline int ddebug_dyndbg_module_param_cb(char *param, char *val,
|
|||
rowsize, groupsize, buf, len, ascii); \
|
||||
} while (0)
|
||||
|
||||
static inline int dynamic_debug_exec_queries(const char *query, const char *modname)
|
||||
{
|
||||
pr_warn("kernel not built with CONFIG_DYNAMIC_DEBUG_CORE\n");
|
||||
return 0;
|
||||
}
|
||||
struct kernel_param;
|
||||
static inline int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp)
|
||||
{ return 0; }
|
||||
static inline int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp)
|
||||
{ return 0; }
|
||||
|
||||
#endif /* !CONFIG_DYNAMIC_DEBUG_CORE */
|
||||
|
||||
extern const struct kernel_param_ops param_ops_dyndbg_classes;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -59,8 +59,6 @@ void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
|
|||
resource_size_t size);
|
||||
void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset,
|
||||
resource_size_t size);
|
||||
void __iomem *devm_ioremap_np(struct device *dev, resource_size_t offset,
|
||||
resource_size_t size);
|
||||
void devm_iounmap(struct device *dev, void __iomem *addr);
|
||||
int check_signature(const volatile void __iomem *io_addr,
|
||||
const unsigned char *signature, int length);
|
||||
|
|
|
|||
|
|
@ -108,10 +108,12 @@ enum kernfs_node_flag {
|
|||
KERNFS_HAS_SEQ_SHOW = 0x0040,
|
||||
KERNFS_HAS_MMAP = 0x0080,
|
||||
KERNFS_LOCKDEP = 0x0100,
|
||||
KERNFS_HIDDEN = 0x0200,
|
||||
KERNFS_SUICIDAL = 0x0400,
|
||||
KERNFS_SUICIDED = 0x0800,
|
||||
KERNFS_EMPTY_DIR = 0x1000,
|
||||
KERNFS_HAS_RELEASE = 0x2000,
|
||||
KERNFS_REMOVING = 0x4000,
|
||||
};
|
||||
|
||||
/* @flags for kernfs_create_root() */
|
||||
|
|
@ -429,6 +431,7 @@ struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
|
|||
const char *name,
|
||||
struct kernfs_node *target);
|
||||
void kernfs_activate(struct kernfs_node *kn);
|
||||
void kernfs_show(struct kernfs_node *kn, bool show);
|
||||
void kernfs_remove(struct kernfs_node *kn);
|
||||
void kernfs_break_active_protection(struct kernfs_node *kn);
|
||||
void kernfs_unbreak_active_protection(struct kernfs_node *kn);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ enum dev_dma_attr {
|
|||
DEV_DMA_COHERENT,
|
||||
};
|
||||
|
||||
struct fwnode_handle *dev_fwnode(struct device *dev);
|
||||
struct fwnode_handle *dev_fwnode(const struct device *dev);
|
||||
|
||||
bool device_property_present(struct device *dev, const char *propname);
|
||||
int device_property_read_u8_array(struct device *dev, const char *propname,
|
||||
|
|
@ -387,7 +387,7 @@ bool device_dma_supported(struct device *dev);
|
|||
|
||||
enum dev_dma_attr device_get_dma_attr(struct device *dev);
|
||||
|
||||
const void *device_get_match_data(struct device *dev);
|
||||
const void *device_get_match_data(const struct device *dev);
|
||||
|
||||
int device_get_phy_mode(struct device *dev);
|
||||
int fwnode_get_phy_mode(struct fwnode_handle *fwnode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue