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

Pull driver core fixes from Greg KH:
"Here are two small driver core cacheinfo fixes for 6.4-rc5 that
resolve a number of reported issues with that file. These changes have
been in linux-next this past week with no reported problems"

* tag 'driver-core-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
drivers: base: cacheinfo: Update cpu_map_populated during CPU Hotplug
drivers: base: cacheinfo: Fix shared_cpu_map changes in event of CPU hotplug

Changed files
+26
drivers
+26
drivers/base/cacheinfo.c
··· 388 continue;/* skip if itself or no cacheinfo */ 389 for (sib_index = 0; sib_index < cache_leaves(i); sib_index++) { 390 sib_leaf = per_cpu_cacheinfo_idx(i, sib_index); 391 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { 392 cpumask_set_cpu(cpu, &sib_leaf->shared_cpu_map); 393 cpumask_set_cpu(i, &this_leaf->shared_cpu_map); ··· 410 coherency_max_size = this_leaf->coherency_line_size; 411 } 412 413 return 0; 414 } 415 416 static void cache_shared_cpu_map_remove(unsigned int cpu) 417 { 418 struct cacheinfo *this_leaf, *sib_leaf; 419 unsigned int sibling, index, sib_index; 420 ··· 432 433 for (sib_index = 0; sib_index < cache_leaves(sibling); sib_index++) { 434 sib_leaf = per_cpu_cacheinfo_idx(sibling, sib_index); 435 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { 436 cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map); 437 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); ··· 450 } 451 } 452 } 453 } 454 455 static void free_cache_attributes(unsigned int cpu)
··· 388 continue;/* skip if itself or no cacheinfo */ 389 for (sib_index = 0; sib_index < cache_leaves(i); sib_index++) { 390 sib_leaf = per_cpu_cacheinfo_idx(i, sib_index); 391 + 392 + /* 393 + * Comparing cache IDs only makes sense if the leaves 394 + * belong to the same cache level of same type. Skip 395 + * the check if level and type do not match. 396 + */ 397 + if (sib_leaf->level != this_leaf->level || 398 + sib_leaf->type != this_leaf->type) 399 + continue; 400 + 401 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { 402 cpumask_set_cpu(cpu, &sib_leaf->shared_cpu_map); 403 cpumask_set_cpu(i, &this_leaf->shared_cpu_map); ··· 400 coherency_max_size = this_leaf->coherency_line_size; 401 } 402 403 + /* shared_cpu_map is now populated for the cpu */ 404 + this_cpu_ci->cpu_map_populated = true; 405 return 0; 406 } 407 408 static void cache_shared_cpu_map_remove(unsigned int cpu) 409 { 410 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); 411 struct cacheinfo *this_leaf, *sib_leaf; 412 unsigned int sibling, index, sib_index; 413 ··· 419 420 for (sib_index = 0; sib_index < cache_leaves(sibling); sib_index++) { 421 sib_leaf = per_cpu_cacheinfo_idx(sibling, sib_index); 422 + 423 + /* 424 + * Comparing cache IDs only makes sense if the leaves 425 + * belong to the same cache level of same type. Skip 426 + * the check if level and type do not match. 427 + */ 428 + if (sib_leaf->level != this_leaf->level || 429 + sib_leaf->type != this_leaf->type) 430 + continue; 431 + 432 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { 433 cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map); 434 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); ··· 427 } 428 } 429 } 430 + 431 + /* cpu is no longer populated in the shared map */ 432 + this_cpu_ci->cpu_map_populated = false; 433 } 434 435 static void free_cache_attributes(unsigned int cpu)