Skip to content

Commit 57ae8a4

Browse files
committed
Merge tag 'driver-core-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH: "Here are some small driver core and kernfs fixes for some reported problems. They include: - kernfs regression that is causing oopses in 5.17 and newer releases - topology sysfs fixes for a few small reported problems. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: kernfs: fix NULL dereferencing in kernfs_remove topology: Fix up build warning in topology_is_visible() arch_topology: Do not set llc_sibling if llc_id is invalid topology: make core_mask include at least cluster_siblings topology/sysfs: Hide PPIN on systems that do not support it.
2 parents e2e5ebe + ad8d869 commit 57ae8a4

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

drivers/base/arch_topology.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,15 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
667667
core_mask = &cpu_topology[cpu].llc_sibling;
668668
}
669669

670+
/*
671+
* For systems with no shared cpu-side LLC but with clusters defined,
672+
* extend core_mask to cluster_siblings. The sched domain builder will
673+
* then remove MC as redundant with CLS if SCHED_CLUSTER is enabled.
674+
*/
675+
if (IS_ENABLED(CONFIG_SCHED_CLUSTER) &&
676+
cpumask_subset(core_mask, &cpu_topology[cpu].cluster_sibling))
677+
core_mask = &cpu_topology[cpu].cluster_sibling;
678+
670679
return core_mask;
671680
}
672681

@@ -684,7 +693,7 @@ void update_siblings_masks(unsigned int cpuid)
684693
for_each_online_cpu(cpu) {
685694
cpu_topo = &cpu_topology[cpu];
686695

687-
if (cpuid_topo->llc_id == cpu_topo->llc_id) {
696+
if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) {
688697
cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling);
689698
cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling);
690699
}

drivers/base/topology.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,19 @@ static struct attribute *default_attrs[] = {
152152
NULL
153153
};
154154

155+
static umode_t topology_is_visible(struct kobject *kobj,
156+
struct attribute *attr, int unused)
157+
{
158+
if (attr == &dev_attr_ppin.attr && !topology_ppin(kobj_to_dev(kobj)->id))
159+
return 0;
160+
161+
return attr->mode;
162+
}
163+
155164
static const struct attribute_group topology_attr_group = {
156165
.attrs = default_attrs,
157166
.bin_attrs = bin_attrs,
167+
.is_visible = topology_is_visible,
158168
.name = "topology"
159169
};
160170

fs/kernfs/dir.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,12 @@ static void __kernfs_remove(struct kernfs_node *kn)
14061406
*/
14071407
void kernfs_remove(struct kernfs_node *kn)
14081408
{
1409-
struct kernfs_root *root = kernfs_root(kn);
1409+
struct kernfs_root *root;
1410+
1411+
if (!kn)
1412+
return;
1413+
1414+
root = kernfs_root(kn);
14101415

14111416
down_write(&root->kernfs_rwsem);
14121417
__kernfs_remove(kn);

0 commit comments

Comments
 (0)