Skip to contentSkip to conversation

More domain validation fixes and additions

PATCH New James Bottomley 1 participant 1 message Mar 21, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 More domain validation fixes and additions

Following testing in more extreme situations, the following problems turned up:

- The error handler can offline the device during DV (most particularly true when transport parameters are undetectably mismatched). Fixed by modifying the state model to allow this and then having DV set the device back online for the retry.

- DV needs to be serialised. Fixed by introducing a per device semaphore.

- Cosmetically, it's nice to trigger DV from userland, so added a revalidate sysfs entry.

James

===== drivers/scsi/scsi_lib.c 1.124 vs edited =====

drivers/scsi/scsi_lib.c +2 -0
@@ -1590,6 +1590,7 @@
 	case SDEV_QUIESCE:
 		switch (oldstate) {
 		case SDEV_RUNNING:
+		case SDEV_OFFLINE:
 			break;
 		default:
 			goto illegal;
@@ -1600,6 +1601,7 @@
 		switch (oldstate) {
 		case SDEV_CREATED:
 		case SDEV_RUNNING:
+		case SDEV_QUIESCE:
 			break;
 		default:
 			goto illegal;

===== drivers/scsi/scsi_transport_spi.c 1.5 vs edited =====

drivers/scsi/scsi_transport_spi.c +37 -4

123 lines not on this page · raw message

===== include/scsi/scsi_transport_spi.h 1.5 vs edited =====

include/scsi/scsi_transport_spi.h +2 -0
@@ -35,7 +35,9 @@
 	unsigned int rd_strm:1;	/* Read streaming enabled */
 	unsigned int rti:1;	/* Retain Training Information */
 	unsigned int pcomp_en:1;/* Precompensation enabled */
+	/* Private Fields */
 	unsigned int dv_pending:1; /* Internal flag */
+	struct semaphore dv_sem; /* semaphore to serialise dv */
 };
 
 /* accessor functions */