aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 00:17:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 00:17:00 -0500
commit92a578b064d0227a3a7fbbdb9e29dbab7f8d400e (patch)
tree1979a62f38e24997a7312c4ce753860cc95b389b /kernel
parentc75059c46293adf1560162c17148ab94624f5ed2 (diff)
parente3d857e1ae787a5e268bc89425aadae09c8e95a4 (diff)
Merge tag 'pm+acpi-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management updates from Rafael Wysocki: "This time we have some more new material than we used to have during the last couple of development cycles. The most important part of it to me is the introduction of a unified interface for accessing device properties provided by platform firmware. It works with Device Trees and ACPI in a uniform way and drivers using it need not worry about where the properties come from as long as the platform firmware (either DT or ACPI) makes them available. It covers both devices and "bare" device node objects without struct device representation as that turns out to be necessary in some cases. This has been in the works for quite a few months (and development cycles) and has been approved by all of the relevant maintainers. On top of that, some drivers are switched over to the new interface (at25, leds-gpio, gpio_keys_polled) and some additional changes are made to the core GPIO subsystem to allow device drivers to manipulate GPIOs in the "canonical" way on platforms that provide GPIO information in their ACPI tables, but don't assign names to GPIO lines (in which case the driver needs to do that on the basis of what it knows about the device in question). That also has been approved by the GPIO core maintainers and the rfkill driver is now going to use it. Second is support for hardware P-states in the intel_pstate driver. It uses CPUID to detect whether or not the feature is supported by the processor in which case it will be enabled by default. However, it can be disabled entirely from the kernel command line if necessary. Next is support for a platform firmware interface based on ACPI operation regions used by the PMIC (Power Management Integrated Circuit) chips on the Intel Baytrail-T and Baytrail-T-CR platforms. That interface is used for manipulating power resources and for thermal management: sensor temperature reporting, trip point setting and so on. Also the ACPI core is now going to support the _DEP configuration information in a limited way. Basically, _DEP it supposed to reflect off-the-hierarchy dependencies between devices which may be very indirect, like when AML for one device accesses locations in an operation region handled by another device's driver (usually, the device depended on this way is a serial bus or GPIO controller). The support added this time is sufficient to make the ACPI battery driver work on Asus T100A, but it is general enough to be able to cover some other use cases in the future. Finally, we have a new cpufreq driver for the Loongson1B processor. In addition to the above, there are fixes and cleanups all over the place as usual and a traditional ACPICA update to a recent upstream release. As far as the fixes go, the ACPI LPSS (Low-power Subsystem) driver for Intel platforms should be able to handle power management of the DMA engine correctly, the cpufreq-dt driver should interact with the thermal subsystem in a better way and the ACPI backlight driver should handle some more corner cases, among other things. On top of the ACPICA update there are fixes for race conditions in the ACPICA's interrupt handling code which might lead to some random and strange looking failures on some systems. In the cleanups department the most visible part is the series of commits targeted at getting rid of the CONFIG_PM_RUNTIME configuration option. That was triggered by a discussion regarding the generic power domains code during which we realized that trying to support certain combinations of PM config options was painful and not really worth it, because nobody would use them in production anyway. For this reason, we decided to make CONFIG_PM_SLEEP select CONFIG_PM_RUNTIME and that lead to the conclusion that the latter became redundant and CONFIG_PM could be used instead of it. The material here makes that replacement in a major part of the tree, but there will be at least one more batch of that in the second part of the merge window. Specifics: - Support for retrieving device properties information from ACPI _DSD device configuration objects and a unified device properties interface for device drivers (and subsystems) on top of that. As stated above, this works with Device Trees and ACPI and allows device drivers to be written in a platform firmware (DT or ACPI) agnostic way. The at25, leds-gpio and gpio_keys_polled drivers are now going to use this new interface and the GPIO subsystem is additionally modified to allow device drivers to assign names to GPIO resources returned by ACPI _CRS objects (in case _DSD is not present or does not provide the expected data). The changes in this set are mostly from Mika Westerberg, Rafael J Wysocki, Aaron Lu, and Darren Hart with some fixes from others (Fabio Estevam, Geert Uytterhoeven). - Support for Hardware Managed Performance States (HWP) as described in Volume 3, section 14.4, of the Intel SDM in the intel_pstate driver. CPUID is used to detect whether or not the feature is supported by the processor. If supported, it will be enabled automatically unless the intel_pstate=no_hwp switch is present in the kernel command line. From Dirk Brandewie. - New Intel Broadwell-H ID for intel_pstate (Dirk Brandewie). - Support for firmware interface based on ACPI operation regions used by the PMIC chips on the Intel Baytrail-T and Baytrail-T-CR platforms for power resource control and thermal management (Aaron Lu). - Limited support for retrieving off-the-hierarchy dependencies between devices from ACPI _DEP device configuration objects and deferred probing support for the ACPI battery driver based on the _DEP information to make that driver work on Asus T100A (Lan Tianyu). - New cpufreq driver for the Loongson1B processor (Kelvin Cheung). - ACPICA update to upstream revision 20141107 which only affects tools (Bob Moore). - Fixes for race conditions in the ACPICA's interrupt handling code and in the ACPI code related to system suspend and resume (Lv Zheng and Rafael J Wysocki). - ACPI core fix for an RCU-related issue in the ioremap() regions management code that slowed down significantly after CPUs had been allowed to enter idle states even if they'd had RCU callbakcs queued and triggered some problems in certain proprietary graphics driver (and elsewhere). The fix replaces synchronize_rcu() in that code with synchronize_rcu_expedited() which makes the issue go away. From Konstantin Khlebnikov. - ACPI LPSS (Low-Power Subsystem) driver fix to handle power management of the DMA engine included into the LPSS correctly. The problem is that the DMA engine doesn't have ACPI PM support of its own and it simply is turned off when the last LPSS device having ACPI PM support goes into D3cold. To work around that, the PM domain used by the ACPI LPSS driver is redesigned so at least one device with ACPI PM support will be on as long as the DMA engine is in use. From Andy Shevchenko. - ACPI backlight driver fix to avoid using it on "Win8-compatible" systems where it doesn't work and where it was used by default by mistake (Aaron Lu). - Assorted minor ACPI core fixes and cleanups from Tomasz Nowicki, Sudeep Holla, Huang Rui, Hanjun Guo, Fabian Frederick, and Ashwin Chaugule (mostly related to the upcoming ARM64 support). - Intel RAPL (Running Average Power Limit) power capping driver fixes and improvements including new processor IDs (Jacob Pan). - Generic power domains modification to power up domains after attaching devices to them to meet the expectations of device drivers and bus types assuming devices to be accessible at probe time (Ulf Hansson). - Preliminary support for controlling device clocks from the generic power domains core code and modifications of the ARM/shmobile platform to use that feature (Ulf Hansson). - Assorted minor fixes and cleanups of the generic power domains core code (Ulf Hansson, Geert Uytterhoeven). - Assorted minor fixes and cleanups of the device clocks control code in the PM core (Geert Uytterhoeven, Grygorii Strashko). - Consolidation of device power management Kconfig options by making CONFIG_PM_SLEEP select CONFIG_PM_RUNTIME and removing the latter which is now redundant (Rafael J Wysocki and Kevin Hilman). That is the first batch of the changes needed for this purpose. - Core device runtime power management support code cleanup related to the execution of callbacks (Andrzej Hajda). - cpuidle ARM support improvements (Lorenzo Pieralisi). - cpuidle cleanup related to the CPUIDLE_FLAG_TIME_VALID flag and a new MAINTAINERS entry for ARM Exynos cpuidle (Daniel Lezcano and Bartlomiej Zolnierkiewicz). - New cpufreq driver callback (->ready) to be executed when the cpufreq core is ready to use a given policy object and cpufreq-dt driver modification to use that callback for cooling device registration (Viresh Kumar). - cpufreq core fixes and cleanups (Viresh Kumar, Vince Hsu, James Geboski, Tomeu Vizoso). - Assorted fixes and cleanups in the cpufreq-pcc, intel_pstate, cpufreq-dt, pxa2xx cpufreq drivers (Lenny Szubowicz, Ethan Zhao, Stefan Wahren, Petr Cvek). - OPP (Operating Performance Points) framework modification to allow OPPs to be removed too and update of a few cpufreq drivers (cpufreq-dt, exynos5440, imx6q, cpufreq) to remove OPPs (added during initialization) on driver removal (Viresh Kumar). - Hibernation core fixes and cleanups (Tina Ruchandani and Markus Elfring). - PM Kconfig fix related to CPU power management (Pankaj Dubey). - cpupower tool fix (Prarit Bhargava)" * tag 'pm+acpi-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (120 commits) i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM tools: cpupower: fix return checks for sysfs_get_idlestate_count() drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM leds: leds-gpio: Fix multiple instances registration without 'label' property iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM hwrandom / exynos / PM: Use CONFIG_PM in #ifdef block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM USB / PM: Drop CONFIG_PM_RUNTIME from the USB core PM: Merge the SET*_RUNTIME_PM_OPS() macros ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/Kconfig7
-rw-r--r--kernel/power/hibernate.c14
-rw-r--r--kernel/power/power.h3
-rw-r--r--kernel/power/snapshot.c9
-rw-r--r--kernel/power/swap.c43
5 files changed, 35 insertions, 41 deletions
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index bbef57f5bdfd..6e7708c2c21f 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -94,6 +94,7 @@ config PM_STD_PARTITION
94config PM_SLEEP 94config PM_SLEEP
95 def_bool y 95 def_bool y
96 depends on SUSPEND || HIBERNATE_CALLBACKS 96 depends on SUSPEND || HIBERNATE_CALLBACKS
97 select PM_RUNTIME
97 98
98config PM_SLEEP_SMP 99config PM_SLEEP_SMP
99 def_bool y 100 def_bool y
@@ -131,7 +132,6 @@ config PM_WAKELOCKS_GC
131 132
132config PM_RUNTIME 133config PM_RUNTIME
133 bool "Run-time PM core functionality" 134 bool "Run-time PM core functionality"
134 depends on !IA64_HP_SIM
135 ---help--- 135 ---help---
136 Enable functionality allowing I/O devices to be put into energy-saving 136 Enable functionality allowing I/O devices to be put into energy-saving
137 (low power) states at run time (or autosuspended) after a specified 137 (low power) states at run time (or autosuspended) after a specified
@@ -298,14 +298,9 @@ config PM_GENERIC_DOMAINS_SLEEP
298 def_bool y 298 def_bool y
299 depends on PM_SLEEP && PM_GENERIC_DOMAINS 299 depends on PM_SLEEP && PM_GENERIC_DOMAINS
300 300
301config PM_GENERIC_DOMAINS_RUNTIME
302 def_bool y
303 depends on PM_RUNTIME && PM_GENERIC_DOMAINS
304
305config PM_GENERIC_DOMAINS_OF 301config PM_GENERIC_DOMAINS_OF
306 def_bool y 302 def_bool y
307 depends on PM_GENERIC_DOMAINS && OF 303 depends on PM_GENERIC_DOMAINS && OF
308 304
309config CPU_PM 305config CPU_PM
310 bool 306 bool
311 depends on SUSPEND || CPU_IDLE
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 1f35a3478f3c..2329daae5255 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -28,6 +28,7 @@
28#include <linux/syscore_ops.h> 28#include <linux/syscore_ops.h>
29#include <linux/ctype.h> 29#include <linux/ctype.h>
30#include <linux/genhd.h> 30#include <linux/genhd.h>
31#include <linux/ktime.h>
31#include <trace/events/power.h> 32#include <trace/events/power.h>
32 33
33#include "power.h" 34#include "power.h"
@@ -232,20 +233,17 @@ static void platform_recover(int platform_mode)
232 * @nr_pages: Number of memory pages processed between @start and @stop. 233 * @nr_pages: Number of memory pages processed between @start and @stop.
233 * @msg: Additional diagnostic message to print. 234 * @msg: Additional diagnostic message to print.
234 */ 235 */
235void swsusp_show_speed(struct timeval *start, struct timeval *stop, 236void swsusp_show_speed(ktime_t start, ktime_t stop,
236 unsigned nr_pages, char *msg) 237 unsigned nr_pages, char *msg)
237{ 238{
239 ktime_t diff;
238 u64 elapsed_centisecs64; 240 u64 elapsed_centisecs64;
239 unsigned int centisecs; 241 unsigned int centisecs;
240 unsigned int k; 242 unsigned int k;
241 unsigned int kps; 243 unsigned int kps;
242 244
243 elapsed_centisecs64 = timeval_to_ns(stop) - timeval_to_ns(start); 245 diff = ktime_sub(stop, start);
244 /* 246 elapsed_centisecs64 = ktime_divns(diff, 10*NSEC_PER_MSEC);
245 * If "(s64)elapsed_centisecs64 < 0", it will print long elapsed time,
246 * it is obvious enough for what went wrong.
247 */
248 do_div(elapsed_centisecs64, NSEC_PER_SEC / 100);
249 centisecs = elapsed_centisecs64; 247 centisecs = elapsed_centisecs64;
250 if (centisecs == 0) 248 if (centisecs == 0)
251 centisecs = 1; /* avoid div-by-zero */ 249 centisecs = 1; /* avoid div-by-zero */
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 2df883a9d3cb..ce9b8328a689 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -174,8 +174,7 @@ extern int hib_wait_on_bio_chain(struct bio **bio_chain);
174 174
175struct timeval; 175struct timeval;
176/* kernel/power/swsusp.c */ 176/* kernel/power/swsusp.c */
177extern void swsusp_show_speed(struct timeval *, struct timeval *, 177extern void swsusp_show_speed(ktime_t, ktime_t, unsigned int, char *);
178 unsigned int, char *);
179 178
180#ifdef CONFIG_SUSPEND 179#ifdef CONFIG_SUSPEND
181/* kernel/power/suspend.c */ 180/* kernel/power/suspend.c */
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 791a61892bb5..0c40c16174b4 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -28,6 +28,7 @@
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/compiler.h> 30#include <linux/compiler.h>
31#include <linux/ktime.h>
31 32
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include <asm/mmu_context.h> 34#include <asm/mmu_context.h>
@@ -1576,11 +1577,11 @@ int hibernate_preallocate_memory(void)
1576 struct zone *zone; 1577 struct zone *zone;
1577 unsigned long saveable, size, max_size, count, highmem, pages = 0; 1578 unsigned long saveable, size, max_size, count, highmem, pages = 0;
1578 unsigned long alloc, save_highmem, pages_highmem, avail_normal; 1579 unsigned long alloc, save_highmem, pages_highmem, avail_normal;
1579 struct timeval start, stop; 1580 ktime_t start, stop;
1580 int error; 1581 int error;
1581 1582
1582 printk(KERN_INFO "PM: Preallocating image memory... "); 1583 printk(KERN_INFO "PM: Preallocating image memory... ");
1583 do_gettimeofday(&start); 1584 start = ktime_get();
1584 1585
1585 error = memory_bm_create(&orig_bm, GFP_IMAGE, PG_ANY); 1586 error = memory_bm_create(&orig_bm, GFP_IMAGE, PG_ANY);
1586 if (error) 1587 if (error)
@@ -1709,9 +1710,9 @@ int hibernate_preallocate_memory(void)
1709 free_unnecessary_pages(); 1710 free_unnecessary_pages();
1710 1711
1711 out: 1712 out:
1712 do_gettimeofday(&stop); 1713 stop = ktime_get();
1713 printk(KERN_CONT "done (allocated %lu pages)\n", pages); 1714 printk(KERN_CONT "done (allocated %lu pages)\n", pages);
1714 swsusp_show_speed(&start, &stop, pages, "Allocated"); 1715 swsusp_show_speed(start, stop, pages, "Allocated");
1715 1716
1716 return 0; 1717 return 0;
1717 1718
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index aaa3261dea5d..570aff817543 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -30,6 +30,7 @@
30#include <linux/atomic.h> 30#include <linux/atomic.h>
31#include <linux/kthread.h> 31#include <linux/kthread.h>
32#include <linux/crc32.h> 32#include <linux/crc32.h>
33#include <linux/ktime.h>
33 34
34#include "power.h" 35#include "power.h"
35 36
@@ -445,8 +446,8 @@ static int save_image(struct swap_map_handle *handle,
445 int nr_pages; 446 int nr_pages;
446 int err2; 447 int err2;
447 struct bio *bio; 448 struct bio *bio;
448 struct timeval start; 449 ktime_t start;
449 struct timeval stop; 450 ktime_t stop;
450 451
451 printk(KERN_INFO "PM: Saving image data pages (%u pages)...\n", 452 printk(KERN_INFO "PM: Saving image data pages (%u pages)...\n",
452 nr_to_write); 453 nr_to_write);
@@ -455,7 +456,7 @@ static int save_image(struct swap_map_handle *handle,
455 m = 1; 456 m = 1;
456 nr_pages = 0; 457 nr_pages = 0;
457 bio = NULL; 458 bio = NULL;
458 do_gettimeofday(&start); 459 start = ktime_get();
459 while (1) { 460 while (1) {
460 ret = snapshot_read_next(snapshot); 461 ret = snapshot_read_next(snapshot);
461 if (ret <= 0) 462 if (ret <= 0)
@@ -469,12 +470,12 @@ static int save_image(struct swap_map_handle *handle,
469 nr_pages++; 470 nr_pages++;
470 } 471 }
471 err2 = hib_wait_on_bio_chain(&bio); 472 err2 = hib_wait_on_bio_chain(&bio);
472 do_gettimeofday(&stop); 473 stop = ktime_get();
473 if (!ret) 474 if (!ret)
474 ret = err2; 475 ret = err2;
475 if (!ret) 476 if (!ret)
476 printk(KERN_INFO "PM: Image saving done.\n"); 477 printk(KERN_INFO "PM: Image saving done.\n");
477 swsusp_show_speed(&start, &stop, nr_to_write, "Wrote"); 478 swsusp_show_speed(start, stop, nr_to_write, "Wrote");
478 return ret; 479 return ret;
479} 480}
480 481
@@ -580,8 +581,8 @@ static int save_image_lzo(struct swap_map_handle *handle,
580 int nr_pages; 581 int nr_pages;
581 int err2; 582 int err2;
582 struct bio *bio; 583 struct bio *bio;
583 struct timeval start; 584 ktime_t start;
584 struct timeval stop; 585 ktime_t stop;
585 size_t off; 586 size_t off;
586 unsigned thr, run_threads, nr_threads; 587 unsigned thr, run_threads, nr_threads;
587 unsigned char *page = NULL; 588 unsigned char *page = NULL;
@@ -674,7 +675,7 @@ static int save_image_lzo(struct swap_map_handle *handle,
674 m = 1; 675 m = 1;
675 nr_pages = 0; 676 nr_pages = 0;
676 bio = NULL; 677 bio = NULL;
677 do_gettimeofday(&start); 678 start = ktime_get();
678 for (;;) { 679 for (;;) {
679 for (thr = 0; thr < nr_threads; thr++) { 680 for (thr = 0; thr < nr_threads; thr++) {
680 for (off = 0; off < LZO_UNC_SIZE; off += PAGE_SIZE) { 681 for (off = 0; off < LZO_UNC_SIZE; off += PAGE_SIZE) {
@@ -759,12 +760,12 @@ static int save_image_lzo(struct swap_map_handle *handle,
759 760
760out_finish: 761out_finish:
761 err2 = hib_wait_on_bio_chain(&bio); 762 err2 = hib_wait_on_bio_chain(&bio);
762 do_gettimeofday(&stop); 763 stop = ktime_get();
763 if (!ret) 764 if (!ret)
764 ret = err2; 765 ret = err2;
765 if (!ret) 766 if (!ret)
766 printk(KERN_INFO "PM: Image saving done.\n"); 767 printk(KERN_INFO "PM: Image saving done.\n");
767 swsusp_show_speed(&start, &stop, nr_to_write, "Wrote"); 768 swsusp_show_speed(start, stop, nr_to_write, "Wrote");
768out_clean: 769out_clean:
769 if (crc) { 770 if (crc) {
770 if (crc->thr) 771 if (crc->thr)
@@ -965,8 +966,8 @@ static int load_image(struct swap_map_handle *handle,
965{ 966{
966 unsigned int m; 967 unsigned int m;
967 int ret = 0; 968 int ret = 0;
968 struct timeval start; 969 ktime_t start;
969 struct timeval stop; 970 ktime_t stop;
970 struct bio *bio; 971 struct bio *bio;
971 int err2; 972 int err2;
972 unsigned nr_pages; 973 unsigned nr_pages;
@@ -978,7 +979,7 @@ static int load_image(struct swap_map_handle *handle,
978 m = 1; 979 m = 1;
979 nr_pages = 0; 980 nr_pages = 0;
980 bio = NULL; 981 bio = NULL;
981 do_gettimeofday(&start); 982 start = ktime_get();
982 for ( ; ; ) { 983 for ( ; ; ) {
983 ret = snapshot_write_next(snapshot); 984 ret = snapshot_write_next(snapshot);
984 if (ret <= 0) 985 if (ret <= 0)
@@ -996,7 +997,7 @@ static int load_image(struct swap_map_handle *handle,
996 nr_pages++; 997 nr_pages++;
997 } 998 }
998 err2 = hib_wait_on_bio_chain(&bio); 999 err2 = hib_wait_on_bio_chain(&bio);
999 do_gettimeofday(&stop); 1000 stop = ktime_get();
1000 if (!ret) 1001 if (!ret)
1001 ret = err2; 1002 ret = err2;
1002 if (!ret) { 1003 if (!ret) {
@@ -1005,7 +1006,7 @@ static int load_image(struct swap_map_handle *handle,
1005 if (!snapshot_image_loaded(snapshot)) 1006 if (!snapshot_image_loaded(snapshot))
1006 ret = -ENODATA; 1007 ret = -ENODATA;
1007 } 1008 }
1008 swsusp_show_speed(&start, &stop, nr_to_read, "Read"); 1009 swsusp_show_speed(start, stop, nr_to_read, "Read");
1009 return ret; 1010 return ret;
1010} 1011}
1011 1012
@@ -1067,8 +1068,8 @@ static int load_image_lzo(struct swap_map_handle *handle,
1067 int ret = 0; 1068 int ret = 0;
1068 int eof = 0; 1069 int eof = 0;
1069 struct bio *bio; 1070 struct bio *bio;
1070 struct timeval start; 1071 ktime_t start;
1071 struct timeval stop; 1072 ktime_t stop;
1072 unsigned nr_pages; 1073 unsigned nr_pages;
1073 size_t off; 1074 size_t off;
1074 unsigned i, thr, run_threads, nr_threads; 1075 unsigned i, thr, run_threads, nr_threads;
@@ -1190,7 +1191,7 @@ static int load_image_lzo(struct swap_map_handle *handle,
1190 m = 1; 1191 m = 1;
1191 nr_pages = 0; 1192 nr_pages = 0;
1192 bio = NULL; 1193 bio = NULL;
1193 do_gettimeofday(&start); 1194 start = ktime_get();
1194 1195
1195 ret = snapshot_write_next(snapshot); 1196 ret = snapshot_write_next(snapshot);
1196 if (ret <= 0) 1197 if (ret <= 0)
@@ -1343,7 +1344,7 @@ out_finish:
1343 wait_event(crc->done, atomic_read(&crc->stop)); 1344 wait_event(crc->done, atomic_read(&crc->stop));
1344 atomic_set(&crc->stop, 0); 1345 atomic_set(&crc->stop, 0);
1345 } 1346 }
1346 do_gettimeofday(&stop); 1347 stop = ktime_get();
1347 if (!ret) { 1348 if (!ret) {
1348 printk(KERN_INFO "PM: Image loading done.\n"); 1349 printk(KERN_INFO "PM: Image loading done.\n");
1349 snapshot_write_finalize(snapshot); 1350 snapshot_write_finalize(snapshot);
@@ -1359,7 +1360,7 @@ out_finish:
1359 } 1360 }
1360 } 1361 }
1361 } 1362 }
1362 swsusp_show_speed(&start, &stop, nr_to_read, "Read"); 1363 swsusp_show_speed(start, stop, nr_to_read, "Read");
1363out_clean: 1364out_clean:
1364 for (i = 0; i < ring_size; i++) 1365 for (i = 0; i < ring_size; i++)
1365 free_page((unsigned long)page[i]); 1366 free_page((unsigned long)page[i]);
@@ -1374,7 +1375,7 @@ out_clean:
1374 kthread_stop(data[thr].thr); 1375 kthread_stop(data[thr].thr);
1375 vfree(data); 1376 vfree(data);
1376 } 1377 }
1377 if (page) vfree(page); 1378 vfree(page);
1378 1379
1379 return ret; 1380 return ret;
1380} 1381}