This patch clears out the device queue when a unit is removed. Greg, please apply.
Matt
# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.679 -> 1.680
# drivers/usb/storage/usb.c 1.76 -> 1.77
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/02/02 [EMAIL PROTECTED] 1.680
# Implement completion of all commands in the queue at disconnect time.
# --------------------------------------------
#
diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
--- a/drivers/usb/storage/usb.c Sun Feb 2 17:45:12 2003
+++ b/drivers/usb/storage/usb.c Sun Feb 2 17:45:12 2003
@@ -962,8 +962,12 @@
/* lock device access -- no need to unlock, as we're going away */
down(&(ss->dev_semaphore));
- /* TODO: complete all pending commands with
- * cmd->result = DID_ERROR << 16 */
+ /* Complete all pending commands with * cmd->result = DID_ERROR << 16.
+ * Since we only queue one command at a time, this is pretty easy. */
+ if (ss->srb) {
+ ss->srb->result = DID_ERROR << 16;
+ ss->srb->scsi_done(ss->srb);
+ }
/* TODO: somehow, wait for the device to
* be 'idle' (tasklet completion) */
--
Matthew Dharm Home: [EMAIL PROTECTED]
Maintainer, Linux USB Mass Storage Driver
Okay, this isn't funny anymore! Let me down! I'll tell Bill on you!!
-- Microsoft Salesman
User Friendly, 4/1/1998
msg11223/pgp00000.pgp
Description: PGP signature
