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 388 continue;/* skip if itself or no cacheinfo */ 389 389 for (sib_index = 0; sib_index < cache_leaves(i); sib_index++) { 390 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 + 391 401 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { 392 402 cpumask_set_cpu(cpu, &sib_leaf->shared_cpu_map); 393 403 cpumask_set_cpu(i, &this_leaf->shared_cpu_map); ··· 410 400 coherency_max_size = this_leaf->coherency_line_size; 411 401 } 412 402 403 + /* shared_cpu_map is now populated for the cpu */ 404 + this_cpu_ci->cpu_map_populated = true; 413 405 return 0; 414 406 } 415 407 416 408 static void cache_shared_cpu_map_remove(unsigned int cpu) 417 409 { 410 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); 418 411 struct cacheinfo *this_leaf, *sib_leaf; 419 412 unsigned int sibling, index, sib_index; 420 413 ··· 432 419 433 420 for (sib_index = 0; sib_index < cache_leaves(sibling); sib_index++) { 434 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 + 435 432 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { 436 433 cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map); 437 434 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); ··· 450 427 } 451 428 } 452 429 } 430 + 431 + /* cpu is no longer populated in the shared map */ 432 + this_cpu_ci->cpu_map_populated = false; 453 433 } 454 434 455 435 static void free_cache_attributes(unsigned int cpu)