Re: [patch] Real-Time Preemption, -RT-2.6.9-rc4-mm1-U8

From: Rui Nuno Capela
Date: Thu Oct 21 2004 - 06:26:33 EST


>>
>> for the sake of testing could you disable CONFIG_USB and see whether the
>> instability is truly directly related to the USB crash, as you suspect?
>> Such a kernel crash can often destabilize other parts of the kernel.
>>
>
> Just tested with CONFIG_USB off, and can't test the usb-storage crash, of
> course. However, jackd is still freezing to death. No console, nor syslog
> output can be found. The system just dies sometime after some jack client
> is launched. Will try further.
>
> I'm on the way to test Thomas Gleixner's patch...
>

OK. Thomas patch solves the usb-storage crash, but I added an oneliner
change to it, to make it build. Corrected patch is appended.

Thanks.
--
rncbc aka Rui Nuno Capela
rncbc@xxxxxxxxxdiff -urN 2.6.9-rc4-mm1-RT-U8/drivers/usb/storage/scsiglue.c
2.6.9-rc4-mm1-RT-U8.1/drivers/usb/storage/scsiglue.c
--- 2.6.9-rc4-mm1-RT-U8/drivers/usb/storage/scsiglue.c 2004-10-12
09:41:44.000000000 +0200
+++ 2.6.9-rc4-mm1-RT-U8.1/drivers/usb/storage/scsiglue.c 2004-10-21
11:45:14.000000000 +0200
@@ -187,7 +187,7 @@
us->srb = srb;

/* wake up the process task */
- up(&(us->sema));
+ complete(&(us->done));

return 0;
}
diff -urN 2.6.9-rc4-mm1-RT-U8/drivers/usb/storage/usb.c
2.6.9-rc4-mm1-RT-U8.1/drivers/usb/storage/usb.c
--- 2.6.9-rc4-mm1-RT-U8/drivers/usb/storage/usb.c 2004-10-12
09:41:44.000000000 +0200
+++ 2.6.9-rc4-mm1-RT-U8.1/drivers/usb/storage/usb.c 2004-10-21
11:45:34.000000000 +0200
@@ -299,7 +299,7 @@

for(;;) {
US_DEBUGP("*** thread sleeping.\n");
- if(down_interruptible(&us->sema))
+ if(wait_for_completion_interruptible(&us->done))
break;

US_DEBUGP("*** thread awakened.\n");
@@ -845,7 +845,7 @@
scsi_unlock(us->host);
up(&us->dev_semaphore);

- up(&us->sema);
+ complete(&us->done);
wait_for_completion(&us->notify);
}

@@ -941,7 +941,7 @@
}
memset(us, 0, sizeof(struct us_data));
init_MUTEX(&(us->dev_semaphore));
- init_MUTEX_LOCKED(&(us->sema));
+ init_completion(&(us->done));
init_completion(&(us->notify));
init_waitqueue_head(&us->dev_reset_wait);
init_waitqueue_head(&us->scsi_scan_wait);
diff -urN 2.6.9-rc4-mm1-RT-U8/drivers/usb/storage/usb.h
2.6.9-rc4-mm1-RT-U8.1/drivers/usb/storage/usb.h
--- 2.6.9-rc4-mm1-RT-U8/drivers/usb/storage/usb.h 2004-10-12
09:41:44.000000000 +0200
+++ 2.6.9-rc4-mm1-RT-U8.1/drivers/usb/storage/usb.h 2004-10-21
11:45:13.000000000 +0200
@@ -159,8 +159,8 @@
dma_addr_t iobuf_dma;

/* mutual exclusion and synchronization structures */
- struct semaphore sema; /* to sleep thread on */
- struct completion notify; /* thread begin/end */
+ struct completion done; /* to sleep thread on */
+ struct completion notify; /* thread begin/end */
wait_queue_head_t dev_reset_wait; /* wait during reset */
wait_queue_head_t scsi_scan_wait; /* wait before scanning */
struct completion scsi_scan_done; /* scan thread end */