Commit 4288e6b4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'driver-core-4.15-rc6' of...

Merge tag 'driver-core-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are two driver core fixes for 4.15-rc6, resolving some reported
  issues.

  The first is a cacheinfo fix for DT based systems to resolve a
  reported issue that has been around for a while, and the other is to
  resolve a regression in the kobject uevent code that showed up in
  4.15-rc1.

  Both have been in linux-next for a while with no reported issues"

* tag 'driver-core-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  kobject: fix suppressing modalias in uevents delivered over netlink
  drivers: base: cacheinfo: fix cache type for non-architected system cache
parents 29a9b000 9b3fa47d
...@@ -186,6 +186,11 @@ static void cache_associativity(struct cacheinfo *this_leaf) ...@@ -186,6 +186,11 @@ static void cache_associativity(struct cacheinfo *this_leaf)
this_leaf->ways_of_associativity = (size / nr_sets) / line_size; this_leaf->ways_of_associativity = (size / nr_sets) / line_size;
} }
static bool cache_node_is_unified(struct cacheinfo *this_leaf)
{
return of_property_read_bool(this_leaf->of_node, "cache-unified");
}
static void cache_of_override_properties(unsigned int cpu) static void cache_of_override_properties(unsigned int cpu)
{ {
int index; int index;
...@@ -194,6 +199,14 @@ static void cache_of_override_properties(unsigned int cpu) ...@@ -194,6 +199,14 @@ static void cache_of_override_properties(unsigned int cpu)
for (index = 0; index < cache_leaves(cpu); index++) { for (index = 0; index < cache_leaves(cpu); index++) {
this_leaf = this_cpu_ci->info_list + index; this_leaf = this_cpu_ci->info_list + index;
/*
* init_cache_level must setup the cache level correctly
* overriding the architecturally specified levels, so
* if type is NONE at this stage, it should be unified
*/
if (this_leaf->type == CACHE_TYPE_NOCACHE &&
cache_node_is_unified(this_leaf))
this_leaf->type = CACHE_TYPE_UNIFIED;
cache_size(this_leaf); cache_size(this_leaf);
cache_get_line_size(this_leaf); cache_get_line_size(this_leaf);
cache_nr_sets(this_leaf); cache_nr_sets(this_leaf);
......
...@@ -346,7 +346,8 @@ static int kobject_uevent_net_broadcast(struct kobject *kobj, ...@@ -346,7 +346,8 @@ static int kobject_uevent_net_broadcast(struct kobject *kobj,
static void zap_modalias_env(struct kobj_uevent_env *env) static void zap_modalias_env(struct kobj_uevent_env *env)
{ {
static const char modalias_prefix[] = "MODALIAS="; static const char modalias_prefix[] = "MODALIAS=";
int i; size_t len;
int i, j;
for (i = 0; i < env->envp_idx;) { for (i = 0; i < env->envp_idx;) {
if (strncmp(env->envp[i], modalias_prefix, if (strncmp(env->envp[i], modalias_prefix,
...@@ -355,11 +356,18 @@ static void zap_modalias_env(struct kobj_uevent_env *env) ...@@ -355,11 +356,18 @@ static void zap_modalias_env(struct kobj_uevent_env *env)
continue; continue;
} }
if (i != env->envp_idx - 1) len = strlen(env->envp[i]) + 1;
memmove(&env->envp[i], &env->envp[i + 1],
sizeof(env->envp[i]) * env->envp_idx - 1); if (i != env->envp_idx - 1) {
memmove(env->envp[i], env->envp[i + 1],
env->buflen - len);
for (j = i; j < env->envp_idx - 1; j++)
env->envp[j] = env->envp[j + 1] - len;
}
env->envp_idx--; env->envp_idx--;
env->buflen -= len;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment