}
list_splice(&list, &dpm_list);
mutex_unlock(&dpm_list_mtx);
-
+#ifndef CONFIG_AMLOGIC_MODIFY
/* Allow device probing and trigger re-probing of deferred devices */
device_unblock_probing();
+#endif
trace_suspend_resume(TPS("dpm_complete"), state.event, false);
}
trace_suspend_resume(TPS("dpm_prepare"), state.event, true);
might_sleep();
-
+#ifndef CONFIG_AMLOGIC_MODIFY
/*
* Give a chance for the known devices to complete their probes, before
* disable probing of devices. This sync point is important at least
* instead. The normal behavior will be restored in dpm_complete().
*/
device_block_probing();
-
+#endif
mutex_lock(&dpm_list_mtx);
while (!list_empty(&dpm_list)) {
struct device *dev = to_device(dpm_list.next);
#include <linux/wakeup_reason.h>
#include "power.h"
+#ifdef CONFIG_AMLOGIC_MODIFY
+#include "../../drivers/base/base.h"
+#endif
const char *pm_labels[] = { "mem", "standby", "freeze", NULL };
const char *pm_states[PM_SUSPEND_MAX];
goto Finish;
}
+#ifdef CONFIG_AMLOGIC_MODIFY
+ /*
+ * Give a chance for the known devices to complete their probes, before
+ * disable probing of devices. This sync point is important at least
+ * at boot time + hibernation restore.
+ */
+ wait_for_device_probe();
+ /*
+ * It is unsafe if probing of devices will happen during suspend or
+ * hibernation and system behavior will be unpredictable in this case.
+ * So, let's prohibit device's probing here and defer their probes
+ * instead. The normal behavior will be restored in dpm_complete().
+ */
+ device_block_probing();
+#endif
+
trace_suspend_resume(TPS("freeze_processes"), 0, true);
error = suspend_freeze_processes();
trace_suspend_resume(TPS("freeze_processes"), 0, false);
static void suspend_finish(void)
{
suspend_thaw_processes();
+#ifdef CONFIG_AMLOGIC_MODIFY
+ /* Allow device probing and trigger re-probing of deferred devices */
+ device_unblock_probing();
+#endif
pm_notifier_call_chain(PM_POST_SUSPEND);
pm_restore_console();
}