Skip to content

Commit 80955ae

Browse files
committed
Merge tag 'driver-core-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH: "Here are the set of driver core and kernfs changes for 6.8-rc1. Nothing major in here this release cycle, just lots of small cleanups and some tweaks on kernfs that in the very end, got reverted and will come back in a safer way next release cycle. Included in here are: - more driver core 'const' cleanups and fixes - fw_devlink=rpm is now the default behavior - kernfs tiny changes to remove some string functions - cpu handling in the driver core is updated to work better on many systems that add topologies and cpus after booting - other minor changes and cleanups All of the cpu handling patches have been acked by the respective maintainers and are coming in here in one series. Everything has been in linux-next for a while with no reported issues" * tag 'driver-core-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (51 commits) Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock" kernfs: convert kernfs_idr_lock to an irq safe raw spinlock class: fix use-after-free in class_register() PM: clk: make pm_clk_add_notifier() take a const pointer EDAC: constantify the struct bus_type usage kernfs: fix reference to renamed function driver core: device.h: fix Excess kernel-doc description warning driver core: class: fix Excess kernel-doc description warning driver core: mark remaining local bus_type variables as const driver core: container: make container_subsys const driver core: bus: constantify subsys_register() calls driver core: bus: make bus_sort_breadthfirst() take a const pointer kernfs: d_obtain_alias(NULL) will do the right thing... driver core: Better advertise dev_err_probe() kernfs: Convert kernfs_path_from_node_locked() from strlcpy() to strscpy() kernfs: Convert kernfs_name_locked() from strlcpy() to strscpy() kernfs: Convert kernfs_walk_ns() from strlcpy() to strscpy() initramfs: Expose retained initrd as sysfs file fs/kernfs/dir: obey S_ISGID kernel/cgroup: use kernfs_create_dir_ns() ...
2 parents 296455a + e3977e0 commit 80955ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+207
-253
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
What: /sys/firmware/initrd
2+
Date: December 2023
3+
Contact: Alexander Graf <[email protected]>
4+
Description:
5+
When the kernel was booted with an initrd and the
6+
"retain_initrd" option is set on the kernel command
7+
line, /sys/firmware/initrd contains the contents of the
8+
initrd that the kernel was booted with.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,7 +2449,7 @@
24492449
between unregistering the boot console and initializing
24502450
the real console.
24512451

2452-
keepinitrd [HW,ARM]
2452+
keepinitrd [HW,ARM] See retain_initrd.
24532453

24542454
kernelcore= [KNL,X86,IA-64,PPC]
24552455
Format: nn[KMGTPE] | nn% | "mirror"
@@ -5604,7 +5604,8 @@
56045604
Useful for devices that are detected asynchronously
56055605
(e.g. USB and MMC devices).
56065606

5607-
retain_initrd [RAM] Keep initrd memory after extraction
5607+
retain_initrd [RAM] Keep initrd memory after extraction. After boot, it will
5608+
be accessible via /sys/firmware/initrd.
56085609

56095610
retbleed= [X86] Control mitigation of RETBleed (Arbitrary
56105611
Speculative Code Execution with Return Instructions)

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ config ARM64
133133
select GENERIC_ARCH_TOPOLOGY
134134
select GENERIC_CLOCKEVENTS_BROADCAST
135135
select GENERIC_CPU_AUTOPROBE
136+
select GENERIC_CPU_DEVICES
136137
select GENERIC_CPU_VULNERABILITIES
137138
select GENERIC_EARLY_IOREMAP
138139
select GENERIC_IDLE_POLL_SETUP

arch/arm64/include/asm/cpu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ struct cpuinfo_32bit {
3838
};
3939

4040
struct cpuinfo_arm64 {
41-
struct cpu cpu;
4241
struct kobject kobj;
4342
u64 reg_ctr;
4443
u64 reg_cntfrq;

arch/arm64/kernel/setup.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -402,19 +402,10 @@ static inline bool cpu_can_disable(unsigned int cpu)
402402
return false;
403403
}
404404

405-
static int __init topology_init(void)
405+
bool arch_cpu_is_hotpluggable(int num)
406406
{
407-
int i;
408-
409-
for_each_possible_cpu(i) {
410-
struct cpu *cpu = &per_cpu(cpu_data.cpu, i);
411-
cpu->hotpluggable = cpu_can_disable(i);
412-
register_cpu(cpu, i);
413-
}
414-
415-
return 0;
407+
return cpu_can_disable(num);
416408
}
417-
subsys_initcall(topology_init);
418409

419410
static void dump_kernel_offset(void)
420411
{

arch/loongarch/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config LOONGARCH
55
select ACPI
66
select ACPI_GENERIC_GSI if ACPI
77
select ACPI_MCFG if ACPI
8+
select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU
89
select ACPI_PPTT if ACPI
910
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
1011
select ARCH_BINFMT_ELF_STATE
@@ -71,6 +72,7 @@ config LOONGARCH
7172
select GENERIC_CLOCKEVENTS
7273
select GENERIC_CMOS_UPDATE
7374
select GENERIC_CPU_AUTOPROBE
75+
select GENERIC_CPU_DEVICES
7476
select GENERIC_ENTRY
7577
select GENERIC_GETTIMEOFDAY
7678
select GENERIC_IOREMAP if !ARCH_IOREMAP

arch/loongarch/kernel/topology.c

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,9 @@
1010

1111
#include <acpi/processor.h>
1212

13-
static DEFINE_PER_CPU(struct cpu, cpu_devices);
14-
1513
#ifdef CONFIG_HOTPLUG_CPU
16-
int arch_register_cpu(int cpu)
14+
bool arch_cpu_is_hotpluggable(int cpu)
1715
{
18-
int ret;
19-
struct cpu *c = &per_cpu(cpu_devices, cpu);
20-
21-
c->hotpluggable = 1;
22-
ret = register_cpu(c, cpu);
23-
if (ret < 0)
24-
pr_warn("register_cpu %d failed (%d)\n", cpu, ret);
25-
26-
return ret;
27-
}
28-
EXPORT_SYMBOL(arch_register_cpu);
29-
30-
void arch_unregister_cpu(int cpu)
31-
{
32-
struct cpu *c = &per_cpu(cpu_devices, cpu);
33-
34-
c->hotpluggable = 0;
35-
unregister_cpu(c);
16+
return !io_master(cpu);
3617
}
37-
EXPORT_SYMBOL(arch_unregister_cpu);
3818
#endif
39-
40-
static int __init topology_init(void)
41-
{
42-
int i, ret;
43-
44-
for_each_present_cpu(i) {
45-
struct cpu *c = &per_cpu(cpu_devices, i);
46-
47-
c->hotpluggable = !io_master(i);
48-
ret = register_cpu(c, i);
49-
if (ret < 0)
50-
pr_warn("topology_init: register_cpu %d failed (%d)\n", i, ret);
51-
}
52-
53-
return 0;
54-
}
55-
56-
subsys_initcall(topology_init);

arch/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ config RISCV
7272
select GENERIC_ARCH_TOPOLOGY
7373
select GENERIC_ATOMIC64 if !64BIT
7474
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
75+
select GENERIC_CPU_DEVICES
7576
select GENERIC_EARLY_IOREMAP
7677
select GENERIC_ENTRY
7778
select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO

arch/riscv/kernel/setup.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ atomic_t hart_lottery __section(".sdata")
5050
#endif
5151
;
5252
unsigned long boot_cpu_hartid;
53-
static DEFINE_PER_CPU(struct cpu, cpu_devices);
5453

5554
/*
5655
* Place kernel memory regions on the resource tree so that
@@ -298,23 +297,10 @@ void __init setup_arch(char **cmdline_p)
298297
riscv_user_isa_enable();
299298
}
300299

301-
static int __init topology_init(void)
300+
bool arch_cpu_is_hotpluggable(int cpu)
302301
{
303-
int i, ret;
304-
305-
for_each_possible_cpu(i) {
306-
struct cpu *cpu = &per_cpu(cpu_devices, i);
307-
308-
cpu->hotpluggable = cpu_has_hotplug(i);
309-
ret = register_cpu(cpu, i);
310-
if (unlikely(ret))
311-
pr_warn("Warning: %s: register_cpu %d failed (%d)\n",
312-
__func__, i, ret);
313-
}
314-
315-
return 0;
302+
return cpu_has_hotplug(cpu);
316303
}
317-
subsys_initcall(topology_init);
318304

319305
void free_initmem(void)
320306
{

arch/x86/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ config X86
5959
#
6060
select ACPI_LEGACY_TABLES_LOOKUP if ACPI
6161
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
62+
select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU
6263
select ARCH_32BIT_OFF_T if X86_32
6364
select ARCH_CLOCKSOURCE_INIT
6465
select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
@@ -148,6 +149,7 @@ config X86
148149
select GENERIC_CLOCKEVENTS_MIN_ADJUST
149150
select GENERIC_CMOS_UPDATE
150151
select GENERIC_CPU_AUTOPROBE
152+
select GENERIC_CPU_DEVICES
151153
select GENERIC_CPU_VULNERABILITIES
152154
select GENERIC_EARLY_IOREMAP
153155
select GENERIC_ENTRY

0 commit comments

Comments
 (0)