Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adfafefd authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'hibernate'

* hibernate:
  PM: Fix suspend_console and resume_console to use only one semaphore
  PM: Wait for console in resume
  PM: Fix pm_notifiers during user mode hibernation
  swsusp: clean up shrink_all_zones()
  swsusp: dont fiddle with swappiness
  PM: fix build for CONFIG_PM unset
  PM/hibernate: fix "swap breaks after hibernation failures"
  PM/resume: wait for device probing to finish
  Consolidate driver_probe_done() loops into one place
parents 460c1338 403f3075
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -18,9 +18,11 @@
 */
 */


#include <linux/device.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/kthread.h>
#include <linux/wait.h>
#include <linux/wait.h>
#include <linux/async.h>


#include "base.h"
#include "base.h"
#include "power/power.h"
#include "power/power.h"
@@ -167,6 +169,21 @@ int driver_probe_done(void)
	return 0;
	return 0;
}
}


/**
 * wait_for_device_probe
 * Wait for device probing to be completed.
 *
 * Note: this function polls at 100 msec intervals.
 */
int wait_for_device_probe(void)
{
	/* wait for the known devices to complete their probing */
	while (driver_probe_done() != 0)
		msleep(100);
	async_synchronize_full();
	return 0;
}

/**
/**
 * driver_probe_device - attempt to bind device & driver together
 * driver_probe_device - attempt to bind device & driver together
 * @drv: driver to bind a device to
 * @drv: driver to bind a device to
+2 −0
Original line number Original line Diff line number Diff line
@@ -147,6 +147,8 @@ extern void put_driver(struct device_driver *drv);
extern struct device_driver *driver_find(const char *name,
extern struct device_driver *driver_find(const char *name,
					 struct bus_type *bus);
					 struct bus_type *bus);
extern int driver_probe_done(void);
extern int driver_probe_done(void);
extern int wait_for_device_probe(void);



/* sysfs interface for exporting driver attributes */
/* sysfs interface for exporting driver attributes */


+9 −4
Original line number Original line Diff line number Diff line
@@ -370,10 +370,14 @@ void __init prepare_namespace(void)
		ssleep(root_delay);
		ssleep(root_delay);
	}
	}


	/* wait for the known devices to complete their probing */
	/*
	while (driver_probe_done() != 0)
	 * wait for the known devices to complete their probing
		msleep(100);
	 *
	async_synchronize_full();
	 * Note: this is a potential source of long boot delays.
	 * For example, it is not atypical to wait 5 seconds here
	 * for the touchpad of a laptop to initialize.
	 */
	wait_for_device_probe();


	md_run_setup();
	md_run_setup();


@@ -399,6 +403,7 @@ void __init prepare_namespace(void)
		while (driver_probe_done() != 0 ||
		while (driver_probe_done() != 0 ||
			(ROOT_DEV = name_to_dev_t(saved_root_name)) == 0)
			(ROOT_DEV = name_to_dev_t(saved_root_name)) == 0)
			msleep(100);
			msleep(100);
		async_synchronize_full();
	}
	}


	is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
	is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
+3 −2
Original line number Original line Diff line number Diff line
@@ -281,8 +281,9 @@ static void __init autodetect_raid(void)
	 */
	 */
	printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
	printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
	printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
	printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
	while (driver_probe_done() < 0)

		msleep(100);
	wait_for_device_probe();

	fd = sys_open("/dev/md0", 0, 0);
	fd = sys_open("/dev/md0", 0, 0);
	if (fd >= 0) {
	if (fd >= 0) {
		sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
		sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
+6 −0
Original line number Original line Diff line number Diff line
@@ -78,6 +78,12 @@ void pm_restore_console(void)
	}
	}
	set_console(orig_fgconsole);
	set_console(orig_fgconsole);
	release_console_sem();
	release_console_sem();

	if (vt_waitactive(orig_fgconsole)) {
		pr_debug("Resume: Can't switch VCs.");
		return;
	}

	kmsg_redirect = orig_kmsg;
	kmsg_redirect = orig_kmsg;
}
}
#endif
#endif
Loading