Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'pm-sleep', 'powercap' and 'pm-tools'

Merge updates related to system sleep handling, one power capping update
and one PM utility update for 6.7-rc1:

- Use __get_safe_page() rather than touching the list in hibernation
snapshot code (Brian Geffon).

- Fix symbol export for _SIMPLE_ variants of _PM_OPS() (Raag Jadav).

- Clean up sync_read handling in snapshot_write_next() (Brian Geffon).

- Fix kerneldoc comments for swsusp_check() and swsusp_close() to
better match code (Christoph Hellwig).

- Downgrade BIOS locked limits pr_warn() in the Intel RAPL power
capping driver to pr_debug() (Ville Syrjälä).

- Change the minimum python version for the intel_pstate_tracer utility
from 2.7 to 3.6 (Doug Smythies).

* pm-sleep:
PM: hibernate: fix the kerneldoc comment for swsusp_check() and swsusp_close()
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS()
PM: hibernate: Use __get_safe_page() rather than touching the list

* powercap:
powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug()

* pm-tools:
tools/power/x86/intel_pstate_tracer: python minimum version

+45 -32
+1 -1
drivers/powercap/intel_rapl_common.c
··· 892 892 return -EINVAL; 893 893 894 894 if (rd->rpl[pl].locked) { 895 - pr_warn("%s:%s:%s locked by BIOS\n", rd->rp->name, rd->name, pl_names[pl]); 895 + pr_debug("%s:%s:%s locked by BIOS\n", rd->rp->name, rd->name, pl_names[pl]); 896 896 return -EACCES; 897 897 } 898 898
+29 -14
include/linux/pm.h
··· 374 374 RUNTIME_PM_OPS(runtime_suspend_fn, runtime_resume_fn, idle_fn) \ 375 375 } 376 376 377 - #ifdef CONFIG_PM 378 - #define _EXPORT_DEV_PM_OPS(name, license, ns) \ 377 + #define _EXPORT_PM_OPS(name, license, ns) \ 379 378 const struct dev_pm_ops name; \ 380 379 __EXPORT_SYMBOL(name, license, ns); \ 381 380 const struct dev_pm_ops name 382 - #define EXPORT_PM_FN_GPL(name) EXPORT_SYMBOL_GPL(name) 383 - #define EXPORT_PM_FN_NS_GPL(name, ns) EXPORT_SYMBOL_NS_GPL(name, ns) 384 - #else 385 - #define _EXPORT_DEV_PM_OPS(name, license, ns) \ 381 + 382 + #define _DISCARD_PM_OPS(name, license, ns) \ 386 383 static __maybe_unused const struct dev_pm_ops __static_##name 384 + 385 + #ifdef CONFIG_PM 386 + #define _EXPORT_DEV_PM_OPS(name, license, ns) _EXPORT_PM_OPS(name, license, ns) 387 + #define EXPORT_PM_FN_GPL(name) EXPORT_SYMBOL_GPL(name) 388 + #define EXPORT_PM_FN_NS_GPL(name, ns) EXPORT_SYMBOL_NS_GPL(name, ns) 389 + #else 390 + #define _EXPORT_DEV_PM_OPS(name, license, ns) _DISCARD_PM_OPS(name, license, ns) 387 391 #define EXPORT_PM_FN_GPL(name) 388 392 #define EXPORT_PM_FN_NS_GPL(name, ns) 389 393 #endif 390 394 391 - #define EXPORT_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "", "") 392 - #define EXPORT_GPL_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "GPL", "") 393 - #define EXPORT_NS_DEV_PM_OPS(name, ns) _EXPORT_DEV_PM_OPS(name, "", #ns) 394 - #define EXPORT_NS_GPL_DEV_PM_OPS(name, ns) _EXPORT_DEV_PM_OPS(name, "GPL", #ns) 395 + #ifdef CONFIG_PM_SLEEP 396 + #define _EXPORT_DEV_SLEEP_PM_OPS(name, license, ns) _EXPORT_PM_OPS(name, license, ns) 397 + #else 398 + #define _EXPORT_DEV_SLEEP_PM_OPS(name, license, ns) _DISCARD_PM_OPS(name, license, ns) 399 + #endif 400 + 401 + #define EXPORT_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "", "") 402 + #define EXPORT_GPL_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "GPL", "") 403 + #define EXPORT_NS_DEV_PM_OPS(name, ns) _EXPORT_DEV_PM_OPS(name, "", #ns) 404 + #define EXPORT_NS_GPL_DEV_PM_OPS(name, ns) _EXPORT_DEV_PM_OPS(name, "GPL", #ns) 405 + 406 + #define EXPORT_DEV_SLEEP_PM_OPS(name) _EXPORT_DEV_SLEEP_PM_OPS(name, "", "") 407 + #define EXPORT_GPL_DEV_SLEEP_PM_OPS(name) _EXPORT_DEV_SLEEP_PM_OPS(name, "GPL", "") 408 + #define EXPORT_NS_DEV_SLEEP_PM_OPS(name, ns) _EXPORT_DEV_SLEEP_PM_OPS(name, "", #ns) 409 + #define EXPORT_NS_GPL_DEV_SLEEP_PM_OPS(name, ns) _EXPORT_DEV_SLEEP_PM_OPS(name, "GPL", #ns) 395 410 396 411 /* 397 412 * Use this if you want to use the same suspend and resume callbacks for suspend ··· 419 404 _DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL) 420 405 421 406 #define EXPORT_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ 422 - EXPORT_DEV_PM_OPS(name) = { \ 407 + EXPORT_DEV_SLEEP_PM_OPS(name) = { \ 423 408 SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ 424 409 } 425 410 #define EXPORT_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ 426 - EXPORT_GPL_DEV_PM_OPS(name) = { \ 411 + EXPORT_GPL_DEV_SLEEP_PM_OPS(name) = { \ 427 412 SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ 428 413 } 429 414 #define EXPORT_NS_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn, ns) \ 430 - EXPORT_NS_DEV_PM_OPS(name, ns) = { \ 415 + EXPORT_NS_DEV_SLEEP_PM_OPS(name, ns) = { \ 431 416 SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ 432 417 } 433 418 #define EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn, ns) \ 434 - EXPORT_NS_GPL_DEV_PM_OPS(name, ns) = { \ 419 + EXPORT_NS_GPL_DEV_SLEEP_PM_OPS(name, ns) = { \ 435 420 SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ 436 421 } 437 422
+7 -9
kernel/power/snapshot.c
··· 2545 2545 pbe->copy_page = tmp; 2546 2546 } else { 2547 2547 /* Copy of the page will be stored in normal memory */ 2548 - kaddr = safe_pages_list; 2549 - safe_pages_list = safe_pages_list->next; 2548 + kaddr = __get_safe_page(ca->gfp_mask); 2549 + if (!kaddr) 2550 + return ERR_PTR(-ENOMEM); 2550 2551 pbe->copy_page = virt_to_page(kaddr); 2551 2552 } 2552 2553 pbe->next = highmem_pblist; ··· 2751 2750 return ERR_PTR(-ENOMEM); 2752 2751 } 2753 2752 pbe->orig_address = page_address(page); 2754 - pbe->address = safe_pages_list; 2755 - safe_pages_list = safe_pages_list->next; 2753 + pbe->address = __get_safe_page(ca->gfp_mask); 2754 + if (!pbe->address) 2755 + return ERR_PTR(-ENOMEM); 2756 2756 pbe->next = restore_pblist; 2757 2757 restore_pblist = pbe; 2758 2758 return pbe->address; ··· 2784 2782 /* Check if we have already loaded the entire image */ 2785 2783 if (handle->cur > 1 && handle->cur > nr_meta_pages + nr_copy_pages + nr_zero_pages) 2786 2784 return 0; 2787 - 2788 - handle->sync_read = 1; 2789 2785 2790 2786 if (!handle->cur) { 2791 2787 if (!buffer) ··· 2827 2827 memory_bm_position_reset(&zero_bm); 2828 2828 restore_pblist = NULL; 2829 2829 handle->buffer = get_buffer(&orig_bm, &ca); 2830 - handle->sync_read = 0; 2831 2830 if (IS_ERR(handle->buffer)) 2832 2831 return PTR_ERR(handle->buffer); 2833 2832 } ··· 2836 2837 handle->buffer = get_buffer(&orig_bm, &ca); 2837 2838 if (IS_ERR(handle->buffer)) 2838 2839 return PTR_ERR(handle->buffer); 2839 - if (handle->buffer != buffer) 2840 - handle->sync_read = 0; 2841 2840 } 2841 + handle->sync_read = (handle->buffer == buffer); 2842 2842 handle->cur++; 2843 2843 2844 2844 /* Zero pages were not included in the image, memset it and move on. */
+2 -2
kernel/power/swap.c
··· 1513 1513 static void *swsusp_holder; 1514 1514 1515 1515 /** 1516 - * swsusp_check - Check for swsusp signature in the resume device 1516 + * swsusp_check - Open the resume device and check for the swsusp signature. 1517 1517 * @exclusive: Open the resume device exclusively. 1518 1518 */ 1519 1519 ··· 1564 1564 } 1565 1565 1566 1566 /** 1567 - * swsusp_close - close swap device. 1567 + * swsusp_close - close resume device. 1568 1568 * @exclusive: Close the resume device which is exclusively opened. 1569 1569 */ 1570 1570
+6 -6
tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0-only 3 3 # -*- coding: utf-8 -*- 4 4 # ··· 11 11 and generates performance plots. 12 12 13 13 Prerequisites: 14 - Python version 2.7.x or higher 14 + Python version 3.6.x or higher 15 15 gnuplot 5.0 or higher 16 - gnuplot-py 1.8 or higher 16 + python3-gnuplot 1.8 or higher 17 17 (Most of the distributions have these required packages. They may be called 18 - gnuplot-py, phython-gnuplot or phython3-gnuplot, gnuplot-nox, ... ) 18 + gnuplot-py, python-gnuplot or python3-gnuplot, gnuplot-nox, ... ) 19 19 20 20 HWP (Hardware P-States are disabled) 21 21 Kernel config for Linux trace is enabled ··· 23 23 see print_help(): for Usage and Output details 24 24 25 25 """ 26 - from __future__ import print_function 26 + 27 27 from datetime import datetime 28 28 import subprocess 29 29 import os ··· 562 562 563 563 # Temporary (or perhaps not) 564 564 cur_version = sys.version_info 565 - print('python version (should be >= 2.7):') 565 + print('python version (should be >= 3.6):') 566 566 print(cur_version) 567 567 568 568 # Left as "cleanup" for potential future re-run ability.