Skip to contentSkip to conversation

write barriers for 2.4.x

PATCH Chris Mason 1 participant 2 messages Feb 14, 2002 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

On Thursday, February 14, 2002 03:31:08 PM +0100 Matthias Andree <[email protected]> wrote:

[ barrier support for sym53c8xx_2?]

I can only promise this compiles against 2.4.18-pre9, and looks right to me. l-k and Jens brought into cc in hopes of a little verification.

-chris

drivers/scsi/sym53c8xx_2/sym_glue.c Thu, 14 Feb 2002 10:43:01 -0500 renamed from drivers/scsi/sym53c8xx_2/sym_glue.c Thu, 13 Dec 2001 11:06:51 -0500 +8 -1
@@ -729,7 +729,14 @@
 	 *  Select tagged/untagged.
 	 */
 	lp = sym_lp(np, tp, ccb->lun);
-	order = (lp && lp->s.reqtags) ? M_SIMPLE_TAG : 0;
+	if (lp && lp->s.reqtags) {
+		if (ccb->request.cmd_flags & RQ_WRITE_ORDERED)
+			order = M_ORDERED_TAG;
+		else
+			order = M_SIMPLE_TAG;
+	} else {
+		order = 0 ;
+	}
 
 	/*
 	 *  Queue the SCSI IO.
#2 lore raw
Quoted 5 lines · On Thursday, February 14, 2002 11:01:43 AM -0500 Chris Mason <[email protected]>…

[ barrier support for sym53c8xx_2?]

I can only promise this compiles against 2.4.18-pre9, and looks right to me. l-k and Jens brought into cc in hopes of a little verification.

Whoops, forgot the template change to tell the upper layer the device supports ordered requests.

Here's a better patch, it includes equally untested BusLogic support too.

drivers/scsi/BusLogic.c Thu, 14 Feb 2002 12:38:05 -0500 root (linux/z/b/7_BusLogic.c 1.2 644) renamed from drivers/scsi/BusLogic.c Wed, 05 Dec 2001 09:35:31 -0500 root (linux/z/b/7_BusLogic.c 1.2 644) +7 -1
@@ -3464,7 +3464,13 @@
     }
   if (TargetFlags->TaggedQueuingActive)
     {
-      BusLogic_QueueTag_T QueueTag = BusLogic_SimpleQueueTag;
+      BusLogic_QueueTag_T QueueTag;
+
+      if (Command->request.cmd_flags & RQ_WRITE_ORDERED)
+        QueueTag = BusLogic_OrderedQueueTag;
+      else      
+        QueueTag = BusLogic_SimpleQueueTag;
+
       /*
 	When using Tagged Queuing with Simple Queue Tags, it appears that disk
 	drive controllers do not guarantee that a queued command will not

Index: barrier.1/drivers/scsi/BusLogic.h

drivers/scsi/BusLogic.h Thu, 14 Feb 2002 12:38:40 -0500 root (linux/B/b/29_BusLogic.h 1.1 644) renamed from drivers/scsi/BusLogic.h Tue, 06 Nov 2001 15:47:39 -0500 root (linux/B/b/29_BusLogic.h 1.1 644) +1 -0
@@ -79,6 +79,7 @@
     bios_param:     BusLogic_BIOSDiskParameters,  /* BIOS Disk Parameters   */ \
     unchecked_isa_dma: 1,			  /* Default Initial Value  */ \
     max_sectors:    128,			  /* I/O queue len limit    */ \
+    can_order:      1,      			  /* can order tags         */ \
     use_clustering: ENABLE_CLUSTERING }		  /* Enable Clustering	    */
 
 

Index: barrier.1/drivers/scsi/sym53c8xx_2/sym_glue.c

drivers/scsi/sym53c8xx_2/sym_glue.c Thu, 14 Feb 2002 10:43:01 -0500 root (linux/H/d/36_sym_glue.c 1.2 644) renamed from drivers/scsi/sym53c8xx_2/sym_glue.c Thu, 13 Dec 2001 11:06:51 -0500 root (linux/H/d/36_sym_glue.c 1.2 644) +8 -1
@@ -729,7 +729,14 @@
 	 *  Select tagged/untagged.
 	 */
 	lp = sym_lp(np, tp, ccb->lun);
-	order = (lp && lp->s.reqtags) ? M_SIMPLE_TAG : 0;
+	if (lp && lp->s.reqtags) {
+		if (ccb->request.cmd_flags & RQ_WRITE_ORDERED)
+			order = M_ORDERED_TAG;
+		else
+			order = M_SIMPLE_TAG;
+	} else {
+		order = 0 ;
+	}
 
 	/*
 	 *  Queue the SCSI IO.

Index: barrier.1/drivers/scsi/sym53c8xx_2/sym53c8xx.h

drivers/scsi/sym53c8xx_2/sym53c8xx.h Thu, 14 Feb 2002 12:30:29 -0500 root (linux/I/d/17_sym53c8xx. 1.2 644) renamed from drivers/scsi/sym53c8xx_2/sym53c8xx.h Thu, 13 Dec 2001 11:06:51 -0500 root (linux/I/d/17_sym53c8xx. 1.2 644) +1 -0
@@ -119,6 +119,7 @@
 	this_id:		7,					\
 	sg_tablesize:		0,					\
 	cmd_per_lun:		0,					\
+	can_order:		1,					\
 	use_clustering:		DISABLE_CLUSTERING}
 
 #endif /* defined(HOSTS_C) || defined(MODULE) */