Skip to contentSkip to conversation

aic79xx: Update to adaptec version 2.0.14

PATCH In review Hannes Reinecke 3 participants 3 messages Jan 16, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 aic79xx: Update to adaptec version 2.0.14

This patch updates aic79xx to adaptec version 2.0.14.

[PATCH 2/3] aic79xx: Update to adaptec version 2.0.14

This patch updates aic79xx to adaptec version 2.0.14.
---

 drivers/scsi/aic7xxx/aic79xx.h                   |    3 
 drivers/scsi/aic7xxx/aic79xx.reg                 |   29 +
 drivers/scsi/aic7xxx/aic79xx.seq                 |  143 +++-
 drivers/scsi/aic7xxx/aic79xx_core.c              |  272 +++++--
 drivers/scsi/aic7xxx/aic79xx_inline.h            |    7 
 drivers/scsi/aic7xxx/aic79xx_osm.c               |   24 +
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c           |    8 
 drivers/scsi/aic7xxx/aic79xx_pci.c               |   11 
 drivers/scsi/aic7xxx/aic79xx_reg.h_shipped       |   27 +
 drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped |   21 -
 drivers/scsi/aic7xxx/aic79xx_seq.h_shipped       |  881 +++++++++++-----------
 drivers/scsi/aic7xxx/aicasm/aicasm.c             |   23 -
 drivers/scsi/aic7xxx/aicasm/aicasm_gram.y        |   19 
 drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h   |   88 --
 drivers/scsi/aic7xxx/aicasm/aicasm_scan.l        |   27 -
 15 files changed, 890 insertions(+), 693 deletions(-)

91a3a0550201bbd52b624e79efcfbba60d95269b

drivers/scsi/aic7xxx/aic79xx.h +2 -1
@@ -37,7 +37,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#108 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#109 $
  *
  * $FreeBSD$
  */
@@ -222,6 +222,7 @@ typedef enum {
 typedef enum {
 	AHD_FENONE		= 0x00000,
 	AHD_WIDE  		= 0x00001,/* Wide Channel */
+	AHD_AIC79XXB_SLOWCRC    = 0x00002,/* SLOWCRC bit should be set */
 	AHD_MULTI_FUNC		= 0x00100,/* Multi-Function/Channel Device */
 	AHD_TARGETMODE		= 0x01000,/* Has tested target mode support */
 	AHD_MULTIROLE		= 0x02000,/* Space for two roles at a time */
drivers/scsi/aic7xxx/aic79xx.reg +25 -4
@@ -1,7 +1,7 @@
 /*
  * Aic79xx register and scratch ram definitions.
  *
- * Copyright (c) 1994-2001 Justin T. Gibbs.
+ * Copyright (c) 1994-2001, 2004 Justin T. Gibbs.
  * Copyright (c) 2000-2002 Adaptec Inc.
  * All rights reserved.
  *
@@ -39,7 +39,7 @@
  *
  * $FreeBSD$
  */
-VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $"
+VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $"
 
 /*
  * This file is processed by the aic7xxx_asm utility for use in assembling
@@ -3715,8 +3715,9 @@ scratch_ram {
 
 	SEQ_FLAGS2 {
 		size		1
-		field	TARGET_MSG_PENDING	  0x02
-		field	SELECTOUT_QFROZEN	  0x04
+		field	PENDING_MK_MESSAGE	0x01
+		field	TARGET_MSG_PENDING	0x02
+		field	SELECTOUT_QFROZEN	0x04
 	}
 
 	ALLOCFIFO_SCBPTR {
@@ -3777,6 +3778,26 @@ scratch_ram {
 	CMDSIZE_TABLE {
 		size		8
 	}
+	/*
+	 * When an SCB with the MK_MESSAGE flag is
+	 * queued to the controller, it cannot enter
+	 * the waiting for selection list until the
+	 * selections for any previously queued
+	 * commands to that target complete.  During
+	 * the wait, the MK_MESSAGE SCB is queued
+	 * here.
+	 */
+	MK_MESSAGE_SCB {
+		size		2
+	}
+	/*
+	 * Saved SCSIID of MK_MESSAGE_SCB to avoid
+	 * an extra SCBPTR operation when deciding
+	 * if the MK_MESSAGE_SCB can be run.
+	 */
+	MK_MESSAGE_SCSIID {
+		size		1
+	}
 }
 
 /************************* Hardware SCB Definition ****************************/
drivers/scsi/aic7xxx/aic79xx.seq +120 -23

235 lines not on this page · raw message

drivers/scsi/aic7xxx/aic79xx_core.c +200 -72

502 lines not on this page · raw message

drivers/scsi/aic7xxx/aic79xx_inline.h +4 -3
@@ -37,7 +37,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#58 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#59 $
  *
  * $FreeBSD$
  */
@@ -804,9 +804,10 @@ ahd_queue_scb(struct ahd_softc *ahd, str
 		uint64_t host_dataptr;
 
 		host_dataptr = ahd_le64toh(scb->hscb->dataptr);
-		printf("%s: Queueing SCB 0x%x bus addr 0x%x - 0x%x%x/0x%x\n",
+		printf("%s: Queueing SCB %d:0x%x bus addr 0x%x - 0x%x%x/0x%x\n",
 		       ahd_name(ahd),
-		       SCB_GET_TAG(scb), ahd_le32toh(scb->hscb->hscb_busaddr),
+		       SCB_GET_TAG(scb), scb->hscb->scsiid,
+		       ahd_le32toh(scb->hscb->hscb_busaddr),
 		       (u_int)((host_dataptr >> 32) & 0xFFFFFFFF),
 		       (u_int)(host_dataptr & 0xFFFFFFFF),
 		       ahd_le32toh(scb->hscb->datacnt));
drivers/scsi/aic7xxx/aic79xx_osm.c +21 -3
@@ -314,12 +314,27 @@ static uint32_t aic79xx_seltime;
  */
 uint32_t aic79xx_periodic_otag;
 
+/* Some storage boxes are using an LSI chip which has a bug making it
+ * impossible to use aic79xx Rev B chip in 320 speeds.  The following
+ * storage boxes have been reported to be buggy:
+ * EonStor 3U 16-Bay: U16U-G3A3
+ * EonStor 2U 12-Bay: U12U-G3A3
+ * SentinelRAID: 2500F R5 / R6
+ * SentinelRAID: 2500F R1
+ * SentinelRAID: 2500F/1500F
+ * SentinelRAID: 150F
+ * 
+ * To get around this LSI bug, you can set your board to 160 mode
+ * or you can enable the SLOWCRC bit.
+ */
+uint32_t aic79xx_slowcrc;
+
 /*
  * Module information and settable options.
  */
 static char *aic79xx = NULL;
 
-MODULE_AUTHOR("Maintainer: Justin T. Gibbs <[email protected]>");
+MODULE_AUTHOR("Maintainer: Luben Tuikov <[email protected]>");
 MODULE_DESCRIPTION("Adaptec Aic790X U320 SCSI Host Bus Adapter driver");
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_VERSION(AIC79XX_DRIVER_VERSION);
@@ -343,6 +358,7 @@ MODULE_PARM_DESC(aic79xx,
 "	amplitude:<int>		Set the signal amplitude (0-7).\n"
 "	seltime:<int>		Selection Timeout:\n"
 "				(0/256ms,1/128ms,2/64ms,3/32ms)\n"
+"	slowcrc			Turn on the SLOWCRC bit (Rev B only)\n"		 
 "\n"
 "	Sample /etc/modprobe.conf line:\n"
 "		Enable verbose logging\n"
@@ -1003,6 +1019,7 @@ aic79xx_setup(char *s)
 		{ "slewrate", NULL },
 		{ "precomp", NULL },
 		{ "amplitude", NULL },
+		{ "slowcrc", &aic79xx_slowcrc },
 	};
 
 	end = strchr(s, '\0');
@@ -1495,10 +1512,11 @@ ahd_linux_run_command(struct ahd_softc *
 	}
 
 	if ((dev->flags & (AHD_DEV_Q_TAGGED|AHD_DEV_Q_BASIC)) != 0) {
-		int	msg_bytes;
+		int	msg_bytes = 0;
 		uint8_t tag_msgs[2];
 
-		msg_bytes = scsi_populate_tag_msg(cmd, tag_msgs);
+		if (cmd->request)
+			msg_bytes = scsi_populate_tag_msg(cmd, tag_msgs);
 		if (msg_bytes && tag_msgs[0] != MSG_SIMPLE_TASK) {
 			hscb->control |= tag_msgs[0];
 			if (tag_msgs[0] == MSG_ORDERED_TASK)
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +4 -4
@@ -220,10 +220,10 @@ ahd_linux_pci_reserve_io_regions(struct 
 	*base2 = pci_resource_start(ahd->dev_softc, 3);
 	if (*base == 0 || *base2 == 0)
 		return (ENOMEM);
-	if (request_region(*base, 256, "aic79xx") == 0)
+	if (request_region(*base, 256, "aic79xx") == NULL)
 		return (ENOMEM);
-	if (request_region(*base2, 256, "aic79xx") == 0) {
-		release_region(*base2, 256);
+	if (request_region(*base2, 256, "aic79xx") == NULL) {
+		release_region(*base, 256);
 		return (ENOMEM);
 	}
 	return (0);
@@ -254,7 +254,7 @@ ahd_linux_pci_reserve_mem_region(struct 
 		if (request_mem_region(start, 0x1000, "aic79xx") == 0)
 			error = ENOMEM;
 		if (error == 0) {
-			*maddr = ioremap_nocache(base_page, base_offset + 256);
+			*maddr = ioremap_nocache(base_page, base_offset + 512);
 			if (*maddr == NULL) {
 				error = ENOMEM;
 				release_mem_region(start, 0x1000);
drivers/scsi/aic7xxx/aic79xx_pci.c +9 -2
@@ -38,7 +38,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#89 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#92 $
  */
 
 #ifdef __linux__
@@ -950,12 +950,19 @@ ahd_aic790X_setup(struct ahd_softc *ahd)
 		if ((ahd->flags & AHD_HP_BOARD) == 0)
 			AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVA);
 	} else {
+		/* This is revision B and newer. */
+		extern uint32_t aic79xx_slowcrc;
 		u_int devconfig1;
 
 		ahd->features |= AHD_RTI|AHD_NEW_IOCELL_OPTS
-			      |  AHD_NEW_DFCNTRL_OPTS|AHD_FAST_CDB_DELIVERY;
+			      |  AHD_NEW_DFCNTRL_OPTS|AHD_FAST_CDB_DELIVERY
+			      |  AHD_BUSFREEREV_BUG;
 		ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG;
 
+		/* If the user requested the the SLOWCRC bit to be set. */
+		if (aic79xx_slowcrc)
+			ahd->features |= AHD_AIC79XXB_SLOWCRC;
+
 		/*
 		 * Some issues have been resolved in the 7901B.
 		 */
drivers/scsi/aic7xxx/aic79xx_reg.h_shipped +23 -4
@@ -2,8 +2,8 @@
  * DO NOT EDIT - This file is automatically generated
  *		 from the following source files:
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#120 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $
  */
 typedef int (ahd_reg_print_t)(u_int, u_int *, u_int);
 typedef struct ahd_reg_parse_entry {
@@ -2204,6 +2204,20 @@ ahd_reg_print_t ahd_cmdsize_table_print;
 #endif
 
 #if AIC_DEBUG_REGISTERS
+ahd_reg_print_t ahd_mk_message_scb_print;
+#else
+#define ahd_mk_message_scb_print(regvalue, cur_col, wrap) \
+    ahd_print_register(NULL, 0, "MK_MESSAGE_SCB", 0x160, regvalue, cur_col, wrap)
+#endif
+
+#if AIC_DEBUG_REGISTERS
+ahd_reg_print_t ahd_mk_message_scsiid_print;
+#else
+#define ahd_mk_message_scsiid_print(regvalue, cur_col, wrap) \
+    ahd_print_register(NULL, 0, "MK_MESSAGE_SCSIID", 0x162, regvalue, cur_col, wrap)
+#endif
+
+#if AIC_DEBUG_REGISTERS
 ahd_reg_print_t ahd_scb_base_print;
 #else
 #define ahd_scb_base_print(regvalue, cur_col, wrap) \
@@ -3638,6 +3652,7 @@ ahd_reg_print_t ahd_scb_disconnected_lis
 #define	SEQ_FLAGS2      		0x14d
 #define		SELECTOUT_QFROZEN	0x04
 #define		TARGET_MSG_PENDING	0x02
+#define		PENDING_MK_MESSAGE	0x01
 
 #define	ALLOCFIFO_SCBPTR		0x14e
 
@@ -3655,6 +3670,10 @@ ahd_reg_print_t ahd_scb_disconnected_lis
 
 #define	CMDSIZE_TABLE   		0x158
 
+#define	MK_MESSAGE_SCB  		0x160
+
+#define	MK_MESSAGE_SCSIID		0x162
+
 #define	SCB_BASE        		0x180
 
 #define	SCB_RESIDUAL_DATACNT		0x180
@@ -3800,5 +3819,5 @@ ahd_reg_print_t ahd_scb_disconnected_lis
 
 
 /* Exported Labels */
-#define	LABEL_seq_isr 	0x285
-#define	LABEL_timer_isr	0x281
+#define	LABEL_seq_isr 	0x28f
+#define	LABEL_timer_isr	0x28b
drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped +18 -3
@@ -2,8 +2,8 @@
  * DO NOT EDIT - This file is automatically generated
  *		 from the following source files:
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#118 $
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#75 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#120 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $
  */
 
 #include "aic79xx_osm.h"
@@ -3382,6 +3382,7 @@ ahd_initiator_tag_print(u_int regvalue, 
 }
 
 static ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = {
+	{ "PENDING_MK_MESSAGE",	0x01, 0x01 },
 	{ "TARGET_MSG_PENDING",	0x02, 0x02 },
 	{ "SELECTOUT_QFROZEN",	0x04, 0x04 }
 };
@@ -3389,7 +3390,7 @@ static ahd_reg_parse_entry_t SEQ_FLAGS2_
 int
 ahd_seq_flags2_print(u_int regvalue, u_int *cur_col, u_int wrap)
 {
-	return (ahd_print_register(SEQ_FLAGS2_parse_table, 2, "SEQ_FLAGS2",
+	return (ahd_print_register(SEQ_FLAGS2_parse_table, 3, "SEQ_FLAGS2",
 	    0x14d, regvalue, cur_col, wrap));
 }
 
@@ -3450,6 +3451,20 @@ ahd_cmdsize_table_print(u_int regvalue, 
 }
 
 int
+ahd_mk_message_scb_print(u_int regvalue, u_int *cur_col, u_int wrap)
+{
+	return (ahd_print_register(NULL, 0, "MK_MESSAGE_SCB",
+	    0x160, regvalue, cur_col, wrap));
+}
+
+int
+ahd_mk_message_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap)
+{
+	return (ahd_print_register(NULL, 0, "MK_MESSAGE_SCSIID",
+	    0x162, regvalue, cur_col, wrap));
+}
+
+int
 ahd_scb_base_print(u_int regvalue, u_int *cur_col, u_int wrap)
 {
 	return (ahd_print_register(NULL, 0, "SCB_BASE",
drivers/scsi/aic7xxx/aic79xx_seq.h_shipped +447 -434

1,278 lines not on this page · raw message

drivers/scsi/aic7xxx/aicasm/aicasm.c +7 -16
@@ -37,7 +37,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.c#23 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.c#22 $
  *
  * $FreeBSD$
  */
@@ -609,10 +609,10 @@ output_listing(char *ifilename)
 
 		while (line < cur_instr->srcline) {
 			fgets(buf, sizeof(buf), ifile);
-				fprintf(listfile, "             \t%s", buf);
+				fprintf(listfile, "\t\t%s", buf);
 				line++;
 		}
-		fprintf(listfile, "%04x %02x%02x%02x%02x", instrptr,
+		fprintf(listfile, "%03x %02x%02x%02x%02x", instrptr,
 #ifdef __LITTLE_ENDIAN
 			cur_instr->format.bytes[0],
 			cur_instr->format.bytes[1],
@@ -624,23 +624,14 @@ output_listing(char *ifilename)
 			cur_instr->format.bytes[1],
 			cur_instr->format.bytes[0]);
 #endif
-		/*
-		 * Macro expansions can cause several instructions
-		 * to be output for a single source line.  Only
-		 * advance the line once in these cases.
-		 */
-		if (line == cur_instr->srcline) {
-			fgets(buf, sizeof(buf), ifile);
-			fprintf(listfile, "\t%s", buf);
-			line++;
-		} else {
-			fprintf(listfile, "\n");
-		}
+		fgets(buf, sizeof(buf), ifile);
+		fprintf(listfile, "\t%s", buf);
+		line++;
 		instrptr++;
 	}
 	/* Dump the remainder of the file */
 	while(fgets(buf, sizeof(buf), ifile) != NULL)
-		fprintf(listfile, "             %s", buf);
+		fprintf(listfile, "\t\t%s", buf);
 
 	fclose(ifile);
 }
drivers/scsi/aic7xxx/aicasm/aicasm_gram.y +2 -17
@@ -38,7 +38,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#30 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#29 $
  *
  * $FreeBSD$
  */
@@ -157,8 +157,6 @@ static int  is_download_const(expression
 
 %token T_END_CS
 
-%token T_PAD_PAGE
-
 %token T_FIELD
 
 %token T_ENUM
@@ -191,10 +189,6 @@ static int  is_download_const(expression
 
 %token <value> T_OR
 
-/* 16 bit extensions */
-%token <value> T_OR16 T_AND16 T_XOR16 T_ADD16
-%token <value> T_ADC16 T_MVI16 T_TEST16 T_CMP16 T_CMPXCHG
-
 %token T_RET
 
 %token T_NOP
@@ -213,7 +207,7 @@ static int  is_download_const(expression
 
 %type <expression> expression immediate immediate_or_a
 
-%type <value> export ret f1_opcode f2_opcode f4_opcode jmp_jc_jnc_call jz_jnz je_jne
+%type <value> export ret f1_opcode f2_opcode jmp_jc_jnc_call jz_jnz je_jne
 
 %type <value> mode_value mode_list macro_arglist
 
@@ -1310,15 +1304,6 @@ f2_opcode:
 |	T_ROR { $$ = AIC_OP_ROR; }
 ;
 
-f4_opcode:
-	T_OR16	{ $$ = AIC_OP_OR16; }
-|	T_AND16 { $$ = AIC_OP_AND16; }
-|	T_XOR16 { $$ = AIC_OP_XOR16; }
-|	T_ADD16 { $$ = AIC_OP_ADD16; }
-|	T_ADC16 { $$ = AIC_OP_ADC16; }
-|	T_MVI16 { $$ = AIC_OP_MVI16; }
-;
-
 code:
 	f2_opcode destination ',' expression opt_source ret ';'
 	{
drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h +1 -87

131 lines not on this page · raw message

drivers/scsi/aic7xxx/aicasm/aicasm_scan.l +7 -20
@@ -38,7 +38,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#20 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#19 $
  *
  * $FreeBSD$
  */
@@ -132,7 +132,7 @@ if[ \t]*\(		{
 						*string_buf_ptr++ = *yptr++;
 				}
 			}
-else			{ return T_ELSE; }
+
 VERSION			{ return T_VERSION; }
 PREFIX			{ return T_PREFIX; }
 PATCH_ARG_LIST		{ return T_PATCH_ARG_LIST; }
@@ -173,6 +173,10 @@ RW|RO|WO		{
 					yylval.value = WO;
 				 return T_MODE;
 			}
+BEGIN_CRITICAL		{ return T_BEGIN_CS; }
+END_CRITICAL		{ return T_END_CS; }
+SET_SRC_MODE		{ return T_SET_SRC_MODE; }
+SET_DST_MODE		{ return T_SET_DST_MODE; }
 field			{ return T_FIELD; }
 enum			{ return T_ENUM; }
 mask			{ return T_MASK; }
@@ -188,13 +192,6 @@ none			{ return T_NONE; }
 sindex			{ return T_SINDEX; }
 A			{ return T_A; }
 
-	/* Instruction Formatting */
-PAD_PAGE		{ return T_PAD_PAGE; }
-BEGIN_CRITICAL		{ return T_BEGIN_CS; }
-END_CRITICAL		{ return T_END_CS; }
-SET_SRC_MODE		{ return T_SET_SRC_MODE; }
-SET_DST_MODE		{ return T_SET_DST_MODE; }
-
 	/* Opcodes */
 shl			{ return T_SHL; }
 shr			{ return T_SHR; }
@@ -226,17 +223,7 @@ and			{ return T_AND;	}
 or			{ return T_OR;	}
 ret			{ return T_RET; }
 nop			{ return T_NOP; }
-
-	/* ARP2 16bit extensions */
-or16			{ return T_OR16; }
-and16			{ return T_AND16; }
-xor16			{ return T_XOR16; }
-add16			{ return T_ADD16; }
-adc16			{ return T_ADC16; }
-mvi16			{ return T_MVI16; }
-test16			{ return T_TEST16; }
-cmp16			{ return T_CMP16; }
-cmpxchg			{ return T_CMPXCHG; }
+else			{ return T_ELSE; }
 
 	/* Allowed Symbols */
 \<\<			{ return T_EXPR_LSHIFT; }
#1 lore raw

drivers/scsi/aic7xxx/aic79xx_osm.c static uint32_t aic79xx_seltime; · line 337

Quoted 2 lines
drivers/scsi/aic7xxx/aic79xx_osm.c +1 -1
-MODULE_AUTHOR("Maintainer: Justin T. Gibbs <[email protected]>");
+MODULE_AUTHOR("Maintainer: Luben Tuikov <[email protected]>");

Does Luben plan to actually maintain the driver we have now? I suspect that correct person to put here would be either you or James.

Quoted 12 lines

MODULE_DESCRIPTION("Adaptec Aic790X U320 SCSI Host Bus Adapter driver"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_VERSION(AIC79XX_DRIVER_VERSION);

drivers/scsi/aic7xxx/aic79xx_osm.c +1 -0
@@ -343,6 +358,7 @@ MODULE_PARM_DESC(aic79xx,
 "	amplitude:<int>		Set the signal amplitude (0-7).\n"
 "	seltime:<int>		Selection Timeout:\n"
 "				(0/256ms,1/128ms,2/64ms,3/32ms)\n"
+"	slowcrc			Turn on the SLOWCRC bit (Rev B only)\n"		 
 "\n"
 "	Sample /etc/modprobe.conf line:\n"
 "		Enable verbose logging\n"

drivers/scsi/aic7xxx/aic79xx_osm.c aic79xx_setup(char *s) · line 1022

Quoted 4 lines
drivers/scsi/aic7xxx/aic79xx_osm.c +1 -0
@@ -1003,6 +1019,7 @@ aic79xx_setup(char *s)
 		{ "slewrate", NULL },
 		{ "precomp", NULL },
 		{ "amplitude", NULL },
+		{ "slowcrc", &aic79xx_slowcrc },

please use a single module_param for each new paramater. Adding them for old ones aswell would also be very nice, then we could add a depreaction message to the old ones and remove them after a year or two.

drivers/scsi/aic7xxx/aic79xx_osm.c ahd_linux_run_command(struct ahd_softc * · line 1519

Quoted 2 lines
drivers/scsi/aic7xxx/aic79xx_osm.c +2 -0
+		if (cmd->request)
+			msg_bytes = scsi_populate_tag_msg(cmd, tag_msgs);

cmd->request can't be zero.

drivers/scsi/aic7xxx/aic79xx_osm_pci.c ahd_linux_pci_reserve_io_regions(struct · line 226

Quoted 7 lines
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +3 -3
-	if (request_region(*base, 256, "aic79xx") == 0)
+	if (request_region(*base, 256, "aic79xx") == NULL)
 		return (ENOMEM);
-	if (request_region(*base2, 256, "aic79xx") == 0) {
-		release_region(*base2, 256);
+	if (request_region(*base2, 256, "aic79xx") == NULL) {
+		release_region(*base, 256);

What about just if (!request_region(...)) {

drivers/scsi/aic7xxx/aic79xx_osm_pci.c ahd_linux_pci_reserve_mem_region(struct · line 257

Quoted 5 lines
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +1 -1
 		if (request_mem_region(start, 0x1000, "aic79xx") == 0)
 			error = ENOMEM;
 		if (error == 0) {
-			*maddr = ioremap_nocache(base_page, base_offset + 256);
+			*maddr = ioremap_nocache(base_page, base_offset + 512);

so how could this work before?

#2 lore raw
Quoted 4 lines · Christoph Hellwig

drivers/scsi/aic7xxx/aic79xx_osm_pci.c ahd_linux_pci_reserve_mem_region(struct · line 257

Quoted 2 lines
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +1 -1
-			*maddr = ioremap_nocache(base_page, base_offset + 256);
+			*maddr = ioremap_nocache(base_page, base_offset + 512);

so how could this work before?

In the absence of chip documentation, maybe the registers are mapped several times over, once at +0, once at +256, once at +512, each time with slightly different semantics? We definitely have chips with register files in IO space, Mem space and Config space, so choosing to map the registers several times in the same address space probably just doesn't seem terribly crazy to hardware people ;-)

Are Adaptec planning on releasing chip documentation?