Skip to content

Commit bd03c70

Browse files
committed
Merge back earlier material related to system sleep for 6.18
2 parents 449c9c0 + be82483 commit bd03c70

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

drivers/base/power/main.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,20 @@ static void device_resume_noirq(struct device *dev, pm_message_t state, bool asy
724724
if (dev->power.syscore || dev->power.direct_complete)
725725
goto Out;
726726

727-
if (!dev->power.is_noirq_suspended)
727+
if (!dev->power.is_noirq_suspended) {
728+
/*
729+
* This means that system suspend has been aborted in the noirq
730+
* phase before invoking the noirq suspend callback for the
731+
* device, so if device_suspend_late() has left it in suspend,
732+
* device_resume_early() should leave it in suspend either in
733+
* case the early resume of it depends on the noirq resume that
734+
* has not run.
735+
*/
736+
if (dev_pm_skip_suspend(dev))
737+
dev->power.must_resume = false;
738+
728739
goto Out;
740+
}
729741

730742
if (!dpm_wait_for_superior(dev, async))
731743
goto Out;

kernel/power/process.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ int freeze_processes(void)
132132
if (!pm_freezing)
133133
static_branch_inc(&freezer_active);
134134

135-
pm_wakeup_clear(0);
136135
pm_freezing = true;
137136
error = try_to_freeze_tasks(true);
138137
if (!error)

kernel/power/snapshot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static void *chain_alloc(struct chain_allocator *ca, unsigned int size)
363363
*
364364
* One radix tree is represented by one struct mem_zone_bm_rtree. There are
365365
* two linked lists for the nodes of the tree, one for the inner nodes and
366-
* one for the leave nodes. The linked leave nodes are used for fast linear
366+
* one for the leaf nodes. The linked leaf nodes are used for fast linear
367367
* access of the memory bitmap.
368368
*
369369
* The struct rtree_node represents one node of the radix tree.

kernel/power/suspend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ static int enter_state(suspend_state_t state)
595595
}
596596

597597
pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state]);
598+
pm_wakeup_clear(0);
598599
pm_suspend_clear_flags();
599600
error = suspend_prepare(state);
600601
if (error)

kernel/power/swap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static int save_compressed_image(struct swap_map_handle *handle,
712712
goto out_clean;
713713
}
714714

715-
data = vzalloc(array_size(nr_threads, sizeof(*data)));
715+
data = vcalloc(nr_threads, sizeof(*data));
716716
if (!data) {
717717
pr_err("Failed to allocate %s data\n", hib_comp_algo);
718718
ret = -ENOMEM;
@@ -1225,14 +1225,14 @@ static int load_compressed_image(struct swap_map_handle *handle,
12251225
nr_threads = num_online_cpus() - 1;
12261226
nr_threads = clamp_val(nr_threads, 1, CMP_THREADS);
12271227

1228-
page = vmalloc(array_size(CMP_MAX_RD_PAGES, sizeof(*page)));
1228+
page = vmalloc_array(CMP_MAX_RD_PAGES, sizeof(*page));
12291229
if (!page) {
12301230
pr_err("Failed to allocate %s page\n", hib_comp_algo);
12311231
ret = -ENOMEM;
12321232
goto out_clean;
12331233
}
12341234

1235-
data = vzalloc(array_size(nr_threads, sizeof(*data)));
1235+
data = vcalloc(nr_threads, sizeof(*data));
12361236
if (!data) {
12371237
pr_err("Failed to allocate %s data\n", hib_comp_algo);
12381238
ret = -ENOMEM;

0 commit comments

Comments
 (0)