Skip to content

Commit bf22487

Browse files
committed
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
4 parents 78b1f56 + ffc843f + a60ec44 + e68cb15 commit bf22487

File tree

5 files changed

+45
-32
lines changed

5 files changed

+45
-32
lines changed

drivers/powercap/intel_rapl_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ static int rapl_write_pl_data(struct rapl_domain *rd, int pl,
892892
return -EINVAL;
893893

894894
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]);
896896
return -EACCES;
897897
}
898898

include/linux/pm.h

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -374,24 +374,39 @@ const struct dev_pm_ops name = { \
374374
RUNTIME_PM_OPS(runtime_suspend_fn, runtime_resume_fn, idle_fn) \
375375
}
376376

377-
#ifdef CONFIG_PM
378-
#define _EXPORT_DEV_PM_OPS(name, license, ns) \
377+
#define _EXPORT_PM_OPS(name, license, ns) \
379378
const struct dev_pm_ops name; \
380379
__EXPORT_SYMBOL(name, license, ns); \
381380
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) \
386383
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)
387391
#define EXPORT_PM_FN_GPL(name)
388392
#define EXPORT_PM_FN_NS_GPL(name, ns)
389393
#endif
390394

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)
395410

396411
/*
397412
* Use this if you want to use the same suspend and resume callbacks for suspend
@@ -404,19 +419,19 @@ const struct dev_pm_ops name = { \
404419
_DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL)
405420

406421
#define EXPORT_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
407-
EXPORT_DEV_PM_OPS(name) = { \
422+
EXPORT_DEV_SLEEP_PM_OPS(name) = { \
408423
SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
409424
}
410425
#define EXPORT_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
411-
EXPORT_GPL_DEV_PM_OPS(name) = { \
426+
EXPORT_GPL_DEV_SLEEP_PM_OPS(name) = { \
412427
SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
413428
}
414429
#define EXPORT_NS_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn, ns) \
415-
EXPORT_NS_DEV_PM_OPS(name, ns) = { \
430+
EXPORT_NS_DEV_SLEEP_PM_OPS(name, ns) = { \
416431
SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
417432
}
418433
#define EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn, ns) \
419-
EXPORT_NS_GPL_DEV_PM_OPS(name, ns) = { \
434+
EXPORT_NS_GPL_DEV_SLEEP_PM_OPS(name, ns) = { \
420435
SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
421436
}
422437

kernel/power/snapshot.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,8 +2545,9 @@ static void *get_highmem_page_buffer(struct page *page,
25452545
pbe->copy_page = tmp;
25462546
} else {
25472547
/* 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);
25502551
pbe->copy_page = virt_to_page(kaddr);
25512552
}
25522553
pbe->next = highmem_pblist;
@@ -2750,8 +2751,9 @@ static void *get_buffer(struct memory_bitmap *bm, struct chain_allocator *ca)
27502751
return ERR_PTR(-ENOMEM);
27512752
}
27522753
pbe->orig_address = page_address(page);
2753-
pbe->address = safe_pages_list;
2754-
safe_pages_list = safe_pages_list->next;
2754+
pbe->address = __get_safe_page(ca->gfp_mask);
2755+
if (!pbe->address)
2756+
return ERR_PTR(-ENOMEM);
27552757
pbe->next = restore_pblist;
27562758
restore_pblist = pbe;
27572759
return pbe->address;
@@ -2783,8 +2785,6 @@ int snapshot_write_next(struct snapshot_handle *handle)
27832785
if (handle->cur > 1 && handle->cur > nr_meta_pages + nr_copy_pages + nr_zero_pages)
27842786
return 0;
27852787

2786-
handle->sync_read = 1;
2787-
27882788
if (!handle->cur) {
27892789
if (!buffer)
27902790
/* This makes the buffer be freed by swsusp_free() */
@@ -2827,7 +2827,6 @@ int snapshot_write_next(struct snapshot_handle *handle)
28272827
memory_bm_position_reset(&zero_bm);
28282828
restore_pblist = NULL;
28292829
handle->buffer = get_buffer(&orig_bm, &ca);
2830-
handle->sync_read = 0;
28312830
if (IS_ERR(handle->buffer))
28322831
return PTR_ERR(handle->buffer);
28332832
}
@@ -2837,9 +2836,8 @@ int snapshot_write_next(struct snapshot_handle *handle)
28372836
handle->buffer = get_buffer(&orig_bm, &ca);
28382837
if (IS_ERR(handle->buffer))
28392838
return PTR_ERR(handle->buffer);
2840-
if (handle->buffer != buffer)
2841-
handle->sync_read = 0;
28422839
}
2840+
handle->sync_read = (handle->buffer == buffer);
28432841
handle->cur++;
28442842

28452843
/* Zero pages were not included in the image, memset it and move on. */

kernel/power/swap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,7 @@ int swsusp_read(unsigned int *flags_p)
15131513
static void *swsusp_holder;
15141514

15151515
/**
1516-
* swsusp_check - Check for swsusp signature in the resume device
1516+
* swsusp_check - Open the resume device and check for the swsusp signature.
15171517
* @exclusive: Open the resume device exclusively.
15181518
*/
15191519

@@ -1564,7 +1564,7 @@ int swsusp_check(bool exclusive)
15641564
}
15651565

15661566
/**
1567-
* swsusp_close - close swap device.
1567+
* swsusp_close - close resume device.
15681568
* @exclusive: Close the resume device which is exclusively opened.
15691569
*/
15701570

tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# SPDX-License-Identifier: GPL-2.0-only
33
# -*- coding: utf-8 -*-
44
#
@@ -11,19 +11,19 @@
1111
and generates performance plots.
1212
1313
Prerequisites:
14-
Python version 2.7.x or higher
14+
Python version 3.6.x or higher
1515
gnuplot 5.0 or higher
16-
gnuplot-py 1.8 or higher
16+
python3-gnuplot 1.8 or higher
1717
(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, ... )
1919
2020
HWP (Hardware P-States are disabled)
2121
Kernel config for Linux trace is enabled
2222
2323
see print_help(): for Usage and Output details
2424
2525
"""
26-
from __future__ import print_function
26+
2727
from datetime import datetime
2828
import subprocess
2929
import os
@@ -562,7 +562,7 @@ def signal_handler(signal, frame):
562562

563563
# Temporary (or perhaps not)
564564
cur_version = sys.version_info
565-
print('python version (should be >= 2.7):')
565+
print('python version (should be >= 3.6):')
566566
print(cur_version)
567567

568568
# Left as "cleanup" for potential future re-run ability.

0 commit comments

Comments
 (0)