Skip to content

Commit

Permalink
Merge branch 'akpm/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Rothwell committed Dec 6, 2021
2 parents 780ed53 + 4a6df86 commit 569c3d7
Show file tree
Hide file tree
Showing 119 changed files with 1,364 additions and 1,160 deletions.
4 changes: 2 additions & 2 deletions arch/alpha/kernel/srm_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ static int srm_env_proc_show(struct seq_file *m, void *v)

static int srm_env_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, srm_env_proc_show, PDE_DATA(inode));
return single_open(file, srm_env_proc_show, pde_data(inode));
}

static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,
size_t count, loff_t *pos)
{
int res;
unsigned long id = (unsigned long)PDE_DATA(file_inode(file));
unsigned long id = (unsigned long)pde_data(file_inode(file));
char *buf = (char *) __get_free_page(GFP_USER);
unsigned long ret1, ret2;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/atags_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct buffer {
static ssize_t atags_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct buffer *b = PDE_DATA(file_inode(file));
struct buffer *b = pde_data(file_inode(file));
return simple_read_from_buffer(buf, count, ppos, b->data, b->size);
}

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/alignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ static int __init noalign_setup(char *__unused)
__setup("noalign", noalign_setup);

/*
* This needs to be done after sysctl_init, otherwise sys/ will be
* This needs to be done after sysctl_init_bases(), otherwise sys/ will be
* overwritten. Actually, this shouldn't be in sys/ at all since
* it isn't a sysctl, and it doesn't contain sysctl information.
* We now locate it in /proc/cpu/alignment instead.
Expand Down
10 changes: 5 additions & 5 deletions arch/ia64/kernel/salinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ salinfo_event_open(struct inode *inode, struct file *file)
static ssize_t
salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{
struct salinfo_data *data = PDE_DATA(file_inode(file));
struct salinfo_data *data = pde_data(file_inode(file));
char cmd[32];
size_t size;
int i, n, cpu = -1;
Expand Down Expand Up @@ -340,7 +340,7 @@ static const struct proc_ops salinfo_event_proc_ops = {
static int
salinfo_log_open(struct inode *inode, struct file *file)
{
struct salinfo_data *data = PDE_DATA(inode);
struct salinfo_data *data = pde_data(inode);

if (!capable(CAP_SYS_ADMIN))
return -EPERM;
Expand All @@ -365,7 +365,7 @@ salinfo_log_open(struct inode *inode, struct file *file)
static int
salinfo_log_release(struct inode *inode, struct file *file)
{
struct salinfo_data *data = PDE_DATA(inode);
struct salinfo_data *data = pde_data(inode);

if (data->state == STATE_NO_DATA) {
vfree(data->log_buffer);
Expand Down Expand Up @@ -433,7 +433,7 @@ salinfo_log_new_read(int cpu, struct salinfo_data *data)
static ssize_t
salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{
struct salinfo_data *data = PDE_DATA(file_inode(file));
struct salinfo_data *data = pde_data(file_inode(file));
u8 *buf;
u64 bufsize;

Expand Down Expand Up @@ -494,7 +494,7 @@ salinfo_log_clear(struct salinfo_data *data, int cpu)
static ssize_t
salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{
struct salinfo_data *data = PDE_DATA(file_inode(file));
struct salinfo_data *data = pde_data(file_inode(file));
char cmd[32];
size_t size;
u32 offset;
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/proc_powerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes
loff_t *ppos)
{
return simple_read_from_buffer(buf, nbytes, ppos,
PDE_DATA(file_inode(file)), PAGE_SIZE);
pde_data(file_inode(file)), PAGE_SIZE);
}

static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
Expand All @@ -34,7 +34,7 @@ static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
return -EINVAL;

remap_pfn_range(vma, vma->vm_start,
__pa(PDE_DATA(file_inode(file))) >> PAGE_SHIFT,
__pa(pde_data(file_inode(file))) >> PAGE_SHIFT,
PAGE_SIZE, vma->vm_page_prot);
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/mm/alignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static int alignment_proc_open(struct inode *inode, struct file *file)
static ssize_t alignment_proc_write(struct file *file,
const char __user *buffer, size_t count, loff_t *pos)
{
int *data = PDE_DATA(file_inode(file));
int *data = pde_data(file_inode(file));
char mode;

if (count > 0) {
Expand All @@ -161,7 +161,7 @@ static const struct proc_ops alignment_proc_ops = {
};

/*
* This needs to be done after sysctl_init, otherwise sys/ will be
* This needs to be done after sysctl_init_bases(), otherwise sys/ will be
* overwritten. Actually, this shouldn't be in sys/ at all since
* it isn't a sysctl, and it doesn't contain sysctl information.
* We now locate it in /proc/cpu/alignment instead.
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/platforms/iss/simdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static int simdisk_detach(struct simdisk *dev)
static ssize_t proc_read_simdisk(struct file *file, char __user *buf,
size_t size, loff_t *ppos)
{
struct simdisk *dev = PDE_DATA(file_inode(file));
struct simdisk *dev = pde_data(file_inode(file));
const char *s = dev->filename;
if (s) {
ssize_t n = simple_read_from_buffer(buf, size, ppos,
Expand All @@ -225,7 +225,7 @@ static ssize_t proc_write_simdisk(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
char *tmp = memdup_user_nul(buf, count);
struct simdisk *dev = PDE_DATA(file_inode(file));
struct simdisk *dev = pde_data(file_inode(file));
int err;

if (IS_ERR(tmp))
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int
acpi_system_wakeup_device_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_system_wakeup_device_seq_show,
PDE_DATA(inode));
pde_data(inode));
}

static const struct proc_ops acpi_system_wakeup_device_proc_ops = {
Expand Down
7 changes: 6 additions & 1 deletion drivers/base/firmware_loader/fallback.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,16 @@ static struct class firmware_class = {

int register_sysfs_loader(void)
{
return class_register(&firmware_class);
int ret = class_register(&firmware_class);

if (ret != 0)
return ret;
return register_firmware_config_sysctl();
}

void unregister_sysfs_loader(void)
{
unregister_firmware_config_sysctl();
class_unregister(&firmware_class);
}

Expand Down
11 changes: 11 additions & 0 deletions drivers/base/firmware_loader/fallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ void fw_fallback_set_default_timeout(void);

int register_sysfs_loader(void);
void unregister_sysfs_loader(void);
#ifdef CONFIG_SYSCTL
extern int register_firmware_config_sysctl(void);
extern void unregister_firmware_config_sysctl(void);
#else
static inline int register_firmware_config_sysctl(void)
{
return 0;
}
static inline void unregister_firmware_config_sysctl(void) { }
#endif /* CONFIG_SYSCTL */

#else /* CONFIG_FW_LOADER_USER_HELPER */
static inline int firmware_fallback_sysfs(struct firmware *fw, const char *name,
struct device *device,
Expand Down
25 changes: 23 additions & 2 deletions drivers/base/firmware_loader/fallback_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <linux/kconfig.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/security.h>
#include <linux/highmem.h>
#include <linux/umh.h>
Expand All @@ -24,7 +25,7 @@ struct firmware_fallback_config fw_fallback_config = {
EXPORT_SYMBOL_NS_GPL(fw_fallback_config, FIRMWARE_LOADER_PRIVATE);

#ifdef CONFIG_SYSCTL
struct ctl_table firmware_config_table[] = {
static struct ctl_table firmware_config_table[] = {
{
.procname = "force_sysfs_fallback",
.data = &fw_fallback_config.force_sysfs_fallback,
Expand All @@ -45,4 +46,24 @@ struct ctl_table firmware_config_table[] = {
},
{ }
};
#endif

static struct ctl_table_header *firmware_config_sysct_table_header;
int register_firmware_config_sysctl(void)
{
firmware_config_sysct_table_header =
register_sysctl("kernel/firmware_config",
firmware_config_table);
if (!firmware_config_sysct_table_header)
return -ENOMEM;
return 0;
}
EXPORT_SYMBOL_NS_GPL(register_firmware_config_sysctl, FIRMWARE_LOADER_PRIVATE);

void unregister_firmware_config_sysctl(void)
{
unregister_sysctl_table(firmware_config_sysct_table_header);
firmware_config_sysct_table_header = NULL;
}
EXPORT_SYMBOL_NS_GPL(unregister_firmware_config_sysctl, FIRMWARE_LOADER_PRIVATE);

#endif /* CONFIG_SYSCTL */
23 changes: 1 addition & 22 deletions drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -3691,27 +3691,6 @@ static struct ctl_table cdrom_table[] = {
},
{ }
};

static struct ctl_table cdrom_cdrom_table[] = {
{
.procname = "cdrom",
.maxlen = 0,
.mode = 0555,
.child = cdrom_table,
},
{ }
};

/* Make sure that /proc/sys/dev is there */
static struct ctl_table cdrom_root_table[] = {
{
.procname = "dev",
.maxlen = 0,
.mode = 0555,
.child = cdrom_cdrom_table,
},
{ }
};
static struct ctl_table_header *cdrom_sysctl_header;

static void cdrom_sysctl_register(void)
Expand All @@ -3721,7 +3700,7 @@ static void cdrom_sysctl_register(void)
if (!atomic_add_unless(&initialized, 1, 1))
return;

cdrom_sysctl_header = register_sysctl_table(cdrom_root_table);
cdrom_sysctl_header = register_sysctl("dev/cdrom", cdrom_table);

/* set the defaults */
cdrom_sysctl_settings.autoclose = autoclose;
Expand Down
22 changes: 1 addition & 21 deletions drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,26 +746,6 @@ static struct ctl_table hpet_table[] = {
{}
};

static struct ctl_table hpet_root[] = {
{
.procname = "hpet",
.maxlen = 0,
.mode = 0555,
.child = hpet_table,
},
{}
};

static struct ctl_table dev_root[] = {
{
.procname = "dev",
.maxlen = 0,
.mode = 0555,
.child = hpet_root,
},
{}
};

static struct ctl_table_header *sysctl_header;

/*
Expand Down Expand Up @@ -1061,7 +1041,7 @@ static int __init hpet_init(void)
if (result < 0)
return -ENODEV;

sysctl_header = register_sysctl_table(dev_root);
sysctl_header = register_sysctl("dev/hpet", hpet_table);

result = acpi_bus_register_driver(&hpet_acpi_driver);
if (result < 0) {
Expand Down
14 changes: 12 additions & 2 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -2088,8 +2088,7 @@ static int proc_do_entropy(struct ctl_table *table, int write,
}

static int sysctl_poolsize = INPUT_POOL_WORDS * 32;
extern struct ctl_table random_table[];
struct ctl_table random_table[] = {
static struct ctl_table random_table[] = {
{
.procname = "poolsize",
.data = &sysctl_poolsize,
Expand Down Expand Up @@ -2151,6 +2150,17 @@ struct ctl_table random_table[] = {
#endif
{ }
};

/*
* rand_initialize() is called before sysctl_init(),
* so we cannot call register_sysctl_init() in rand_initialize()
*/
static int __init random_sysctls_init(void)
{
register_sysctl_init("kernel/random", random_table);
return 0;
}
device_initcall(random_sysctls_init);
#endif /* CONFIG_SYSCTL */

struct batched_entropy {
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_dp_mst_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -5511,6 +5511,7 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
mutex_init(&mgr->probe_lock);
#if IS_ENABLED(CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS)
mutex_init(&mgr->topology_ref_history_lock);
stack_depot_init();
#endif
INIT_LIST_HEAD(&mgr->tx_msg_downq);
INIT_LIST_HEAD(&mgr->destroy_port_list);
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/drm_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,10 @@ void drm_mm_init(struct drm_mm *mm, u64 start, u64 size)
add_hole(&mm->head_node);

mm->scan_active = 0;

#ifdef CONFIG_DRM_DEBUG_MM
stack_depot_init();
#endif
}
EXPORT_SYMBOL(drm_mm_init);

Expand Down
9 changes: 9 additions & 0 deletions drivers/gpu/drm/drm_modeset_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ static void __drm_stack_depot_print(depot_stack_handle_t stack_depot)

kfree(buf);
}

static void __drm_stack_depot_init(void)
{
stack_depot_init();
}
#else /* CONFIG_DRM_DEBUG_MODESET_LOCK */
static depot_stack_handle_t __drm_stack_depot_save(void)
{
Expand All @@ -115,6 +120,9 @@ static depot_stack_handle_t __drm_stack_depot_save(void)
static void __drm_stack_depot_print(depot_stack_handle_t stack_depot)
{
}
static void __drm_stack_depot_init(void)
{
}
#endif /* CONFIG_DRM_DEBUG_MODESET_LOCK */

/**
Expand Down Expand Up @@ -359,6 +367,7 @@ void drm_modeset_lock_init(struct drm_modeset_lock *lock)
{
ww_mutex_init(&lock->mutex, &crtc_ww_class);
INIT_LIST_HEAD(&lock->head);
__drm_stack_depot_init();
}
EXPORT_SYMBOL(drm_modeset_lock_init);

Expand Down
Loading

0 comments on commit 569c3d7

Please sign in to comment.