#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/moduleparam.h>
+#include <linux/suspend.h>
#include <asm/atomic.h>
#include "ieee1394_types.h"
/* Sit and wait for a signal to probe the nodes on the bus. This
* happens when we get a bus reset. */
- while (!down_interruptible(&hi->reset_sem) &&
- !down_interruptible(&nodemgr_serialize)) {
+ while (1) {
unsigned int generation = 0;
int i;
+ if (down_interruptible(&hi->reset_sem) ||
+ down_interruptible(&nodemgr_serialize)) {
+ if (current->flags & PF_FREEZE) {
+ refrigerator(0);
+ continue;
+ }
+ printk("NodeMgr: received unexpected signal?!\n" );
+ break;
+ }
+
if (hi->kill_me)
break;
* start the the waiting over again */
while (!down_trylock(&hi->reset_sem))
i = 0;
+
+ /* Check the kill_me again */
+ if (hi->kill_me)
+ goto caught_signal;
}
if (!nodemgr_check_irm_capability(host, reset_cycles)) {
.remove_host = nodemgr_remove_host,
};
-void init_ieee1394_nodemgr(void)
+int init_ieee1394_nodemgr(void)
{
- class_register(&nodemgr_ne_class);
- class_register(&nodemgr_ud_class);
+ int ret;
+
+ ret = class_register(&nodemgr_ne_class);
+ if (ret < 0)
+ return ret;
+
+ ret = class_register(&nodemgr_ud_class);
+ if (ret < 0) {
+ class_unregister(&nodemgr_ne_class);
+ return ret;
+ }
hpsb_register_highlevel(&nodemgr_highlevel);
+
+ return 0;
}
void cleanup_ieee1394_nodemgr(void)