X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fpci%2Fhotplug%2Fcpci_hotplug_core.c;h=ed243605dc7b36bd687fb72b0d96de3aa8f1c2f4;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=5b33e965fcaeb61cc8db28d1683d4eabf64b2d78;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 5b33e965f..ed243605d 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "pci_hotplug.h" #include "cpci_hotplug.h" @@ -513,11 +514,10 @@ event_thread(void *data) break; while(controller->ops->query_enum()) { rc = check_slots(); - if(rc > 0) { + if (rc > 0) /* Give userspace a chance to handle extraction */ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ / 2); - } else if(rc < 0) { + msleep(500); + else if (rc < 0) { dbg("%s - error checking slots", __FUNCTION__); thread_finished = 1; break; @@ -568,11 +568,10 @@ poll_thread(void *data) while(controller->ops->query_enum()) { rc = check_slots(); - if(rc > 0) { + if(rc > 0) /* Give userspace a chance to handle extraction */ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ / 2); - } else if(rc < 0) { + msleep(500); + else if (rc < 0) { dbg("%s - error checking slots", __FUNCTION__); thread_finished = 1; break; @@ -595,8 +594,7 @@ poll_thread(void *data) } } - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ / 10); + msleep(100); } dbg("poll thread signals exit"); up(&thread_exit); @@ -614,9 +612,9 @@ cpci_start_thread(void) thread_finished = 0; if(controller->irq) { - pid = kernel_thread(event_thread, 0, 0); + pid = kernel_thread(event_thread, NULL, 0); } else { - pid = kernel_thread(poll_thread, 0, 0); + pid = kernel_thread(poll_thread, NULL, 0); } if(pid < 0) { err("Can't start up our thread");