diff -ruN ../test/linux-vanilla/block/as-iosched.c linux-2.6.18/block/as-iosched.c --- ../test/linux-vanilla/block/as-iosched.c 2007-01-10 13:51:33.000000000 +0530 +++ linux-2.6.18/block/as-iosched.c 2007-01-18 13:37:01.000000000 +0530 @@ -1088,6 +1088,19 @@ if (list_empty(&ad->fifo_list[adir])) return 0; + /* + * Check here for the System resume flag to be cleared, if flag is + * still set the resume thread hasnt completed yet, and hence dont + * takeout any new request from the FIFO + */ + extern int system_resuming; + if (system_resuming != 0) + { +#ifdef DEBUG + printk(" system resuming still \n"); +#endif + return 0; + } arq = list_entry_fifo(ad->fifo_list[adir].next); return time_after(jiffies, arq->expires); diff -ruN ../test/linux-vanilla/block/cfq-iosched.c linux-2.6.18/block/cfq-iosched.c --- ../test/linux-vanilla/block/cfq-iosched.c 2007-01-11 07:59:33.000000000 +0530 +++ linux-2.6.18/block/cfq-iosched.c 2007-01-18 13:35:02.000000000 +0530 @@ -1156,6 +1156,19 @@ if (!cfqd->busy_queues) return 0; + /* + * Check here for the System resume flag to be cleared, if flag is s + * still set the resume thread hasnt completed yet, and hence dont + * move any request from the read/write to dispatch queue + */ + extern int system_resuming; + if (system_resuming != 0) + { +#ifdef DEBUG + printk("System resuming still \n"); +#endif + return 0; + } if (unlikely(force)) return cfq_forced_dispatch(cfqd); diff -ruN ../test/linux-vanilla/kernel/power/main.c linux-2.6.18/kernel/power/main.c --- ../test/linux-vanilla/kernel/power/main.c 2007-01-11 08:00:11.000000000 +0530 +++ linux-2.6.18/kernel/power/main.c 2007-01-18 13:31:56.000000000 +0530 @@ -19,6 +19,7 @@ #include "power.h" +int system_resuming; /*This is just an arbitrary number */ #define FREE_PAGE_NUMBER (100) @@ -131,9 +132,29 @@ * console that we've allocated. This is not called for suspend-to-disk. */ -static void suspend_finish(suspend_state_t state) +static int dev_resume_proc(void * data) { + /* Set the global resume flag, this will be checked by the IO_schedular + * before dispatching the IO request + */ + system_resuming =1; device_resume(); + system_resuming = 0; +#ifdef DEBUG + printk(" reseting system_resume \n"); +#endif + return (0); +} +static void suspend_finish(suspend_state_t state) +{ + int thread; + system_resuming = 0; + thread = kernel_thread(dev_resume_proc,NULL,CLONE_KERNEL); + if (thread < 0) + { + printk ("Suspend resume Cannot create Kernel_thread\n"); + device_resume(); + } resume_console(); thaw_processes(); enable_nonboot_cpus();