public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Aic7xxx and Aic79xx driver updates.
       [not found] ` <175810000.1041300864@aslan.btc.adaptec.com>
@ 2003-01-08  3:46   ` Justin T. Gibbs
  2003-01-08  3:49     ` Justin T. Gibbs
  0 siblings, 1 reply; 12+ messages in thread
From: Justin T. Gibbs @ 2003-01-08  3:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

I've uploaded a new "bk send" file relative to the 2.5.X repository.
I've also attached the output from "Documentation/.../bksend".  The
"bk send" version can be found here:

http://people.FreeBSD.org/~gibbs/linux/SRC/aic79xx-linux-2.5-bksend.gz

This should correct the false positives some have seen with the 
mmapped I/O test on some of the older controllers that the aic7xxx
driver supports.

--
Justin

[-- Attachment #2: bksend.out --]
[-- Type: application/octet-stream, Size: 39794 bytes --]

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


ChangeSet@1.893.1.4, 2003-01-07 19:58:41-07:00, gibbs@overdrive.btc.adaptec.com
  aic7xxx and aic79xx driver updates:
  
  	o Correct memory mapped I/O test for legacy controllers
  	  that do not have the "auto-access-pause" feature.
  	o Prevent NMIs from triggering should the MMAP I/O test fail.
  	o Fix aic7770 (EISA/VLB) controller regression.
  	o Kill a few compiler warnings.

ChangeSet@1.893.1.3, 2003-01-07 19:40:37-07:00, gibbs@overdrive.btc.adaptec.com
  aic7xxx and aic79xx drivers Correct several DV issues:
  
   o Do not fallback to a wide speed if the device does not support
     wide transfers.
  
   o Don't bother allocating target instances for wide IDs on narrow
     controllers.
  
   o Add a few additional diagnostics to aid in tracking down DV bugs.

ChangeSet@1.893.1.2, 2003-01-07 19:32:07-07:00, gibbs@overdrive.btc.adaptec.com
  aic7xxx/aicasm:
     Remove the numerical_value portion of the grammer which is no
     longer referenced.  This eliminates a yacc warning.

ChangeSet@1.897, 2003-01-07 18:31:40-08:00, anton@samba.org
  [PATCH] small module patch
  
  Add a missing inline, shows up when modules are turned off.

ChangeSet@1.893.1.1, 2003-01-07 19:29:46-07:00, gibbs@overdrive.btc.adaptec.com
  Update the aic7xxx Makefile so that the register information tables
  are not rebuilt on every build.
  
  Use better Kbuild rule style for building firmware.
  
  Submitted by: Sam Ravnborg <sam@ravnborg.org>

ChangeSet@1.896, 2003-01-07 16:41:22-08:00, greg@kroah.com
  PCI hotplug: clean up the try_module_get() logic a bit.

ChangeSet@1.895, 2003-01-07 16:29:23-08:00, greg@kroah.com
  PCI: properly unregister a PCI device if it is removed.
  
  This is only used by pci hotplug and cardbus systems.

ChangeSet@1.894, 2003-01-07 16:24:14-08:00, greg@kroah.com
  IBM PCI Hotplug: fix compile time error due to find_bus() function name.


 Makefile                    |   49 ++++++++++++++---------------
 aic79xx_core.c              |   16 +++++----
 aic79xx_osm.c               |   25 +++++++++++++-
 aic79xx_osm.h               |   13 ++++---
 aic79xx_osm_pci.c           |    5 ++
 aic79xx_pci.c               |   25 ++++++++++----
 aic7xxx.h                   |    3 -
 aic7xxx.reg                 |    4 +-
 aic7xxx.seq                 |    4 +-
 aic7xxx_core.c              |   74 ++++++++------------------------------------
 aic7xxx_osm.c               |   29 ++++++++++++++---
 aic7xxx_osm.h               |   15 ++++----
 aic7xxx_osm_pci.c           |    6 +--
 aic7xxx_pci.c               |   34 +++++++++++++-------
 aic7xxx_reg.h_shipped       |    5 +-
 aic7xxx_reg_print.c_shipped |    4 +-
 aic7xxx_seq.h_shipped       |    4 +-
 aicasm/aicasm_gram.y        |   15 +-------
 18 files changed, 173 insertions(+), 157 deletions(-)


diff -Nru a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
--- a/drivers/scsi/aic7xxx/Makefile	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/Makefile	Tue Jan  7 20:41:22 2003
@@ -1,7 +1,7 @@
 #
 # Makefile for the Linux aic7xxx SCSI driver.
 #
-# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Makefile#3 $
+# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Makefile#5 $
 #
 
 # Let kbuild descend into aicasm when cleaning
@@ -44,40 +44,39 @@
 
 $(obj)/aic7xxx_core.o: $(obj)/aic7xxx_seq.h
 $(obj)/aic79xx_core.o: $(obj)/aic79xx_seq.h
+$(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
+$(obj)/aic7xxx_reg_print.c: $(src)/aic7xxx_reg_print.c_shipped
 
 $(addprefix $(obj)/,$(aic7xxx-y)): $(obj)/aic7xxx_reg.h
 $(addprefix $(obj)/,$(aic79xx-y)): $(obj)/aic79xx_reg.h
 
+aic7xxx-gen-$(CONFIG_AIC7XXX_BUILD_FIRMWARE)	:= $(obj)/aic7xxx_seq.h \
+						   $(obj)/aic7xxx_reg.h
+aic7xxx-gen-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT)	+= $(obj)/aic7xxx_reg_print.c
+
+aicasm-7xxx-opts-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) := \
+	-p $(obj)/aic7xxx_reg_print.c -i aic7xxx_osm.h
+
 ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
-aic7xxx_gen = $(obj)/aic7xxx_seq.h $(obj)/aic7xxx_reg.h
-ifeq ($(CONFIG_AIC7XXX_REG_PRETTY_PRINT),y)
-aic7xxx_gen += $(obj)/aic7xxx_reg_print.c
-aic7xxx_asm_cmd = $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \
-		 -p $(obj)/aic7xxx_reg_print.c -i aic7xxx_osm.h	   \
-		 -o $(obj)/aic7xxx_seq.h $(src)/aic7xxx.seq
-else
-aic7xxx_asm_cmd = $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \
-		 -o $(obj)/aic7xxx_seq.h $(src)/aic7xxx.seq
+$(aic7xxx-gen-y): $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
+	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \
+			      $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
+			      $(src)/aic7xxx.seq
 endif
 
-$(aic7xxx_gen): $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
-	$(aic7xxx_asm_cmd)
-endif
+aic79xx-gen-$(CONFIG_AIC79XX_BUILD_FIRMWARE)	:= $(obj)/aic79xx_seq.h \
+						   $(obj)/aic79xx_reg.h
+aic79xx-gen-$(CONFIG_AIC79XX_REG_PRETTY_PRINT)	+= $(obj)/aic79xx_reg_print.c
+
+aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \
+	-p $(obj)/aic79xx_reg_print.c -i aic79xx_osm.h
 
 ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
-aic79xx_gen = $(obj)/aic79xx_seq.h $(obj)/aic79xx_reg.h
-ifeq ($(CONFIG_AIC79XX_REG_PRETTY_PRINT),y)
-aic79xx_gen += $(obj)/aic79xx_reg_print.c
-aic79xx_asm_cmd = $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \
-		 -p $(obj)/aic79xx_reg_print.c -i aic79xx_osm.h	   \
-		 -o $(obj)/aic79xx_seq.h $(src)/aic79xx.seq
-else
-aic79xx_asm_cmd = $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \
-		 -o $(obj)/aic79xx_seq.h $(src)/aic79xx.seq
+$(aic79xx-gen-y): $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
+	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \
+			      $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
+			      $(src)/aic79xx.seq
 endif
-$(aic79xx_gen): $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
-	$(aic79xx_asm_cmd)
-endif 
 
 $(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl]
 	$(MAKE) -C $(src)/aicasm
diff -Nru a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
--- a/drivers/scsi/aic7xxx/aic79xx_core.c	Tue Jan  7 20:41:21 2003
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c	Tue Jan  7 20:41:21 2003
@@ -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.c#148 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#150 $
  *
  * $FreeBSD$
  */
@@ -2321,13 +2321,13 @@
 
 	/* Skip all PACED only entries if IU is not available */
 	if ((*ppr_options & MSG_EXT_PPR_IU_REQ) == 0
-	 && maxsync < AHD_SYNCRATE_DT)
-		maxsync = AHD_SYNCRATE_DT;
+	 && *period < AHD_SYNCRATE_DT)
+		*period = AHD_SYNCRATE_DT;
 
 	/* Skip all DT only entries if DT is not available */
 	if ((*ppr_options & MSG_EXT_PPR_DT_REQ) == 0
-	 && maxsync < AHD_SYNCRATE_ULTRA2)
-		maxsync = AHD_SYNCRATE_ULTRA2;
+	 && *period < AHD_SYNCRATE_ULTRA2)
+		*period = AHD_SYNCRATE_ULTRA2;
 }
 
 /*
@@ -5680,7 +5680,8 @@
 			       /*lowaddr*/BUS_SPACE_MAXADDR,
 			       /*highaddr*/BUS_SPACE_MAXADDR,
 			       /*filter*/NULL, /*filterarg*/NULL,
-			       /*maxsize*/MAXBSIZE, /*nsegments*/AHD_NSEG,
+			       /*maxsize*/(AHD_NSEG - 1) * PAGE_SIZE,
+			       /*nsegments*/AHD_NSEG,
 			       /*maxsegsz*/AHD_MAXTRANSFER_SIZE,
 			       /*flags*/BUS_DMA_ALLOCNOW,
 			       &ahd->buffer_dmat) != 0) {
@@ -7856,7 +7857,8 @@
 #ifdef AHD_DEBUG
 	if ((ahd_debug & AHD_SHOW_MISC) != 0) {
 		ahd_print_path(ahd, scb);
-		printf("Handled Residual of %d bytes\n", resid);
+		printf("Handled %sResidual of %d bytes\n",
+		       (scb->flags & SCB_SENSE) ? "Sense " : "", resid);
 	}
 #endif
 }
diff -Nru a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c	Tue Jan  7 20:41:21 2003
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c	Tue Jan  7 20:41:21 2003
@@ -1,7 +1,7 @@
 /*
  * Adaptec AIC79xx device driver for Linux.
  *
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#103 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#104 $
  *
  * --------------------------------------------------------------------------
  * Copyright (c) 1994-2000 Justin T. Gibbs.
@@ -2058,7 +2058,7 @@
 	 * negotiation will occur for the first command, and DV
 	 * will comence should that first command be successful.
 	 */
-	for (target = 0; target < AHD_NUM_TARGETS; target++)
+	for (target = 0; target < host->max_id; target++)
 		ahd_linux_alloc_target(ahd, 0, target);
 	ahd_intr_enable(ahd, TRUE);
 	ahd_linux_start_dv(ahd);
@@ -2883,6 +2883,23 @@
 				break;
 			}
 
+#ifdef AHD_DEBUG
+			if (ahd_debug & AHD_SHOW_DV) {
+				int i;
+
+				ahd_print_devinfo(ahd, devinfo);
+				printf("Inquiry buffer mismatch:");
+				for (i = 0; i < AHD_LINUX_DV_INQ_LEN; i++) {
+					if ((i & 0xF) == 0)
+						printf("\n        ");
+					printf("0x%x:0x0%x ",
+					       ((uint8_t *)targ->inq_data)[i], 
+					       targ->dv_buffer[i]);
+				}
+				printf("\n");
+			}
+#endif
+
 			if (ahd_linux_dv_fallback(ahd, devinfo) != 0) {
 				AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_EXIT);
 				break;
@@ -3525,6 +3542,8 @@
 		targ->dv_next_narrow_period = MAX(period, AHD_SYNCRATE_ULTRA2);
 	if (targ->dv_next_wide_period == 0)
 		targ->dv_next_wide_period = period;
+	if (targ->dv_max_width == 0)
+		targ->dv_max_width = width;
 	if (targ->dv_max_ppr_options == 0)
 		targ->dv_max_ppr_options = ppr_options;
 	if (targ->dv_last_ppr_options == 0)
@@ -3619,7 +3638,7 @@
 				period++;
 			}
 		} else if ((ahd->features & AHD_WIDE) != 0
-			&& tinfo->user.width != 0
+			&& targ->dv_max_width != 0
 			&& wide_speed >= fallback_speed
 			&& (targ->dv_next_wide_period <= AHD_ASYNC_XFER_PERIOD
 			 || period >= AHD_ASYNC_XFER_PERIOD)) {
diff -Nru a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h	Tue Jan  7 20:41:22 2003
@@ -36,7 +36,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#99 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#102 $
  *
  */
 #ifndef _AIC79XX_LINUX_H_
@@ -288,7 +288,7 @@
 #include <linux/smp.h>
 #endif
 
-#define AIC79XX_DRIVER_VERSION "1.3.0.ALPHA6"
+#define AIC79XX_DRIVER_VERSION "1.3.0.BETA2"
 
 /**************************** Front End Queues ********************************/
 /*
@@ -458,10 +458,11 @@
 	/*
 	 * The next "fallback" period to use for narrow/wide transfers.
 	 */
-	u_int			  dv_next_narrow_period;
-	u_int			  dv_next_wide_period;
-	u_int			  dv_max_ppr_options;
-	u_int			  dv_last_ppr_options;
+	uint8_t			  dv_next_narrow_period;
+	uint8_t			  dv_next_wide_period;
+	uint8_t			  dv_max_width;
+	uint8_t			  dv_max_ppr_options;
+	uint8_t			  dv_last_ppr_options;
 	u_int			  dv_echo_size;
 	ahd_dv_state		  dv_state;
 	u_int			  dv_state_retry;
diff -Nru a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
--- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c	Tue Jan  7 20:41:22 2003
@@ -36,7 +36,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#19 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#20 $
  */
 
 #include "aic79xx_osm.h"
@@ -170,6 +170,9 @@
 			ahd->platform_data->hw_dma_mask =
 			    (bus_addr_t)(0x7FFFFFFFFFULL & (bus_addr_t)~0);
 		}
+	} else {
+		ahd_pci_set_dma_mask(pdev, 0xFFFFFFFF);
+		ahd->platform_data->hw_dma_mask = 0xFFFFFFFF;
 	}
 #endif
 	ahd->dev_softc = pci;
diff -Nru a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c
--- a/drivers/scsi/aic7xxx/aic79xx_pci.c	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic79xx_pci.c	Tue Jan  7 20:41:22 2003
@@ -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#60 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#61 $
  *
  * $FreeBSD$
  */
@@ -379,15 +379,20 @@
 ahd_pci_test_register_access(struct ahd_softc *ahd)
 {
 	ahd_mode_state	saved_modes;
+	uint32_t	cmd;
 	int		error;
-	uint8_t		seqctl;
+	uint8_t		hcntrl;
 
 	saved_modes = ahd_save_modes(ahd);
 	error = EIO;
 
-	/* Enable PCI error interrupt status */
-	seqctl = ahd_inb(ahd, SEQCTL0);
-	ahd_outb(ahd, SEQCTL0, seqctl & ~FAILDIS);
+	/*
+	 * Enable PCI error interrupt status, but suppress NMIs
+	 * generated by SERR raised due to target aborts.
+	 */
+	cmd = ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/2);
+	ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND,
+			     cmd & ~PCIM_CMD_SERRESPEN, /*bytes*/2);
 
 	/*
 	 * First a simple test to see if any
@@ -397,7 +402,8 @@
 	 * be zero so it is a good register to
 	 * use for this test.
 	 */
-	if (ahd_inb(ahd, HCNTRL) == 0xFF)
+	hcntrl = ahd_inb(ahd, HCNTRL);
+	if (hcntrl == 0xFF)
 		goto fail;
 
 	/*
@@ -407,6 +413,10 @@
 	 * either, so look for data corruption and/or flaged
 	 * PCI errors.
 	 */
+	ahd_outb(ahd, HCNTRL, hcntrl|PAUSE);
+	while (ahd_is_paused(ahd) == 0)
+		;
+	ahd_outb(ahd, SEQCTL0, PERRORDIS);
 	ahd_outl(ahd, SRAM_BASE, 0x5aa555aa);
 	if (ahd_inl(ahd, SRAM_BASE) != 0x5aa555aa)
 		goto fail;
@@ -440,7 +450,8 @@
 	}
 
 	ahd_restore_modes(ahd, saved_modes);
-	ahd_outb(ahd, SEQCTL0, seqctl);
+	ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS);
+	ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
 	return (error);
 }
 
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h
--- a/drivers/scsi/aic7xxx/aic7xxx.h	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx.h	Tue Jan  7 20:41:22 2003
@@ -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/aic7xxx.h#66 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#67 $
  *
  * $FreeBSD$
  */
@@ -1053,7 +1053,6 @@
 	u_int			  pci_cachesize;
 
 	u_int			  stack_size;
-	uint16_t		 *saved_stack;
 
 	/* Per-Unit descriptive information */
 	const char		 *description;
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx.reg b/drivers/scsi/aic7xxx/aic7xxx.reg
--- a/drivers/scsi/aic7xxx/aic7xxx.reg	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx.reg	Tue Jan  7 20:41:22 2003
@@ -39,7 +39,7 @@
  *
  * $FreeBSD$
  */
-VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#36 $"
+VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#37 $"
 
 /*
  * This file is processed by the aic7xxx_asm utility for use in assembling
@@ -672,6 +672,8 @@
 	address			0x06f
 	access_mode RO
 }
+
+const	STACK_SIZE	4
 
 /*
  * Board Control (p. 3-43)
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx.seq b/drivers/scsi/aic7xxx/aic7xxx.seq
--- a/drivers/scsi/aic7xxx/aic7xxx.seq	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx.seq	Tue Jan  7 20:41:22 2003
@@ -40,7 +40,7 @@
  * $FreeBSD$
  */
 
-VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#52 $"
+VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#53 $"
 PATCH_ARG_LIST = "struct ahc_softc *ahc"
 PREFIX = "ahc_"
 
@@ -70,7 +70,7 @@
 	 * Turn off the selection hardware.  We need to reset the
 	 * selection request in order to perform a new selection.
 	 */
-	and	SCSISEQ, TEMODE|ENSELI|ENRSELI|ENAUTOATNP, SCSISEQ;
+	and	SCSISEQ, TEMODE|ENSELI|ENRSELI|ENAUTOATNP;
 	and	SIMODE1, ~ENBUSFREE;
 poll_for_work:
 	call	clear_target_state;
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c	Tue Jan  7 20:41:22 2003
@@ -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/aic7xxx.c#105 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#108 $
  *
  * $FreeBSD$
  */
@@ -230,7 +230,6 @@
 					u_int start_instr, u_int *skip_addr);
 static void		ahc_download_instr(struct ahc_softc *ahc,
 					   u_int instrptr, uint8_t *dconsts);
-static int		ahc_probe_stack_size(struct ahc_softc *ahc);
 #ifdef AHC_TARGET_MODE
 static void		ahc_queue_lstate_event(struct ahc_softc *ahc,
 					       struct ahc_tmode_lstate *lstate,
@@ -1166,6 +1165,13 @@
 			       ahc_name(ahc), scbptr, scb_index);
 			ahc_dump_card_state(ahc);
 		} else {
+#ifdef AHC_DEBUG
+			if ((ahc_debug & AHC_SHOW_SELTO) != 0) {
+				ahc_print_path(ahc, scb);
+				printf("Saw Selection Timeout for SCB 0x%x\n",
+				       scb_index);
+			}
+#endif
 			/*
 			 * Force a renegotiation with this target just in
 			 * case the cable was pulled and will later be
@@ -1178,13 +1184,6 @@
 			ahc_force_renegotiation(ahc);
 			ahc_set_transaction_status(scb, CAM_SEL_TIMEOUT);
 			ahc_freeze_devq(ahc, scb);
-#ifdef AHC_DEBUG
-			if ((ahc_debug & AHC_SHOW_SELTO) != 0) {
-				ahc_print_path(ahc, scb);
-				printf("Saw Selection Timeout for SCB 0x%x\n",
-				       scb_index);
-			}
-#endif
 		}
 		ahc_outb(ahc, CLRINT, CLRSCSIINT);
 		ahc_restart(ahc);
@@ -4005,8 +4004,6 @@
 		free(ahc->name, M_DEVBUF);
 	if (ahc->seep_config != NULL)
 		free(ahc->seep_config, M_DEVBUF);
-	if (ahc->saved_stack != NULL)
-		free(ahc->saved_stack, M_DEVBUF);
 #ifndef __FreeBSD__
 	free(ahc, M_DEVBUF);
 #endif
@@ -4542,12 +4539,6 @@
 	size_t	 driver_data_size;
 	uint32_t physaddr;
 
-	ahc->stack_size = ahc_probe_stack_size(ahc);
-	ahc->saved_stack = malloc(ahc->stack_size * sizeof(uint16_t),
-				  M_DEVBUF, M_NOWAIT);
-	if (ahc->saved_stack == NULL)
-		return (ENOMEM);
-
 #ifdef AHC_DEBUG_SEQUENCER
 	ahc->flags |= AHC_SEQUENCER_DEBUG;
 #endif
@@ -4602,7 +4593,8 @@
 			       /*lowaddr*/BUS_SPACE_MAXADDR,
 			       /*highaddr*/BUS_SPACE_MAXADDR,
 			       /*filter*/NULL, /*filterarg*/NULL,
-			       /*maxsize*/MAXBSIZE, /*nsegments*/AHC_NSEG,
+			       /*maxsize*/(AHC_NSEG - 1) * PAGE_SIZE,
+			       /*nsegments*/AHC_NSEG,
 			       /*maxsegsz*/AHC_MAXTRANSFER_SIZE,
 			       /*flags*/BUS_DMA_ALLOCNOW,
 			       &ahc->buffer_dmat) != 0) {
@@ -6275,7 +6267,8 @@
 #ifdef AHC_DEBUG
 	if ((ahc_debug & AHC_SHOW_MISC) != 0) {
 		ahc_print_path(ahc, scb);
-		printf("Handled Residual of %d bytes\n", resid);
+		printf("Handled %sResidual of %d bytes\n",
+		       (scb->flags & SCB_SENSE) ? "Sense " : "", resid);
 	}
 #endif
 }
@@ -6655,41 +6648,6 @@
 	}
 }
 
-static int
-ahc_probe_stack_size(struct ahc_softc *ahc)
-{
-	int last_probe;
-
-	last_probe = 0;
-	while (1) {
-		int i;
-
-		/*
-		 * We avoid using 0 as a pattern to avoid
-		 * confusion if the stack implementation
-		 * "back-fills" with zeros when "poping'
-		 * entries.
-		 */
-		for (i = 1; i <= last_probe+1; i++) {
-		       ahc_outb(ahc, STACK, i & 0xFF);
-		       ahc_outb(ahc, STACK, (i >> 8) & 0xFF);
-		}
-
-		/* Verify */
-		for (i = last_probe+1; i > 0; i--) {
-			u_int stack_entry;
-
-			stack_entry = ahc_inb(ahc, STACK)
-				    |(ahc_inb(ahc, STACK) << 8);
-			if (stack_entry != i)
-				goto sized;
-		}
-		last_probe++;
-	}
-sized:
-	return (last_probe);
-}
-
 int
 ahc_print_register(ahc_reg_parse_entry_t *table, u_int num_entries,
 		   const char *name, u_int address, u_int value,
@@ -6768,6 +6726,7 @@
 	cur_col = 0;
 	if ((ahc->features & AHC_DT) != 0)
 		ahc_scsisigi_print(ahc_inb(ahc, SCSISIGI), &cur_col, 50);
+	ahc_error_print(ahc_inb(ahc, ERROR), &cur_col, 50);
 	ahc_scsiphase_print(ahc_inb(ahc, SCSIPHASE), &cur_col, 50);
 	ahc_scsibusl_print(ahc_inb(ahc, SCSIBUSL), &cur_col, 50);
 	ahc_lastphase_print(ahc_inb(ahc, LASTPHASE), &cur_col, 50);
@@ -6787,11 +6746,8 @@
 	if (cur_col != 0)
 		printf("\n");
 	printf("STACK:");
-	for (i = 0; i < ahc->stack_size; i++) {
-		ahc->saved_stack[i] =
-		    ahc_inb(ahc, STACK)|(ahc_inb(ahc, STACK) << 8);
-	       printf(" 0x%x", ahc->saved_stack[i]);
-	}
+	for (i = 0; i < STACK_SIZE; i++)
+	       printf(" 0x%x", ahc_inb(ahc, STACK)|(ahc_inb(ahc, STACK) << 8));
 	printf("\nSCB count = %d\n", ahc->scb_data->numscbs);
 	printf("Kernel NEXTQSCB = %d\n", ahc->next_queued_scb->hscb->tag);
 	printf("Card NEXTQSCB = %d\n", ahc_inb(ahc, NEXT_QUEUED_SCB));
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c	Tue Jan  7 20:41:21 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c	Tue Jan  7 20:41:21 2003
@@ -1,7 +1,7 @@
 /*
  * Adaptec AIC7xxx device driver for Linux.
  *
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#166 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#169 $
  *
  * Copyright (c) 1994 John Aycock
  *   The University of Calgary Department of Computer Science.
@@ -576,6 +576,7 @@
 static void ahc_linux_setup_tag_info(char *p, char *end, char *s);
 static void ahc_linux_setup_tag_info_global(char *p);
 static void ahc_linux_setup_dv(char *p, char *end, char *s);
+static int  aic7xxx_setup(char *s);
 static int  ahc_linux_next_unit(void);
 static void ahc_runq_tasklet(unsigned long data);
 static int  ahc_linux_halt(struct notifier_block *nb, u_long event, void *buf);
@@ -1297,6 +1298,7 @@
 	 */
 	.max_sectors		= 8192,
 #endif
+#if defined CONFIG_HIGHIO || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
 /* Assume RedHat Distribution with its different HIGHIO conventions. */
 	.can_dma_32		= 1,
@@ -1304,6 +1306,7 @@
 #else
 	.highmem_io		= 1,
 #endif
+#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 	.name			= "aic7xxx",
 	.slave_alloc		= ahc_linux_slave_alloc,
@@ -1764,7 +1767,7 @@
  * to a parameter with a ':' between the parameter and the value.
  * ie. aic7xxx=stpwlev:1,extended
  */
-int
+static int
 aic7xxx_setup(char *s)
 {
 	int	i, n;
@@ -1888,7 +1891,7 @@
 	 * negotiation will occur for the first command, and DV
 	 * will comence should that first command be successful.
 	 */
-	for (target = 0; target < AHC_NUM_TARGETS; target++) {
+	for (target = 0; target < host->max_id*host->max_channel+1; target++) {
 		u_int channel;
 
 		channel = 0;
@@ -2732,6 +2735,22 @@
 				AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_EXIT);
 				break;
 			}
+#ifdef AHC_DEBUG
+			if (ahc_debug & AHC_SHOW_DV) {
+				int i;
+
+				ahc_print_devinfo(ahc, devinfo);
+				printf("Inquiry buffer mismatch:");
+				for (i = 0; i < AHC_LINUX_DV_INQ_LEN; i++) {
+					if ((i & 0xF) == 0)
+						printf("\n        ");
+					printf("0x%x:0x0%x ",
+					       ((uint8_t *)targ->inq_data)[i], 
+					       targ->dv_buffer[i]);
+				}
+				printf("\n");
+			}
+#endif
 
 			if (ahc_linux_fallback(ahc, devinfo) != 0) {
 				AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_EXIT);
@@ -3365,6 +3384,8 @@
 		targ->dv_next_narrow_period = MAX(period, AHC_SYNCRATE_ULTRA2);
 	if (targ->dv_next_wide_period == 0)
 		targ->dv_next_wide_period = period;
+	if (targ->dv_max_width == 0)
+		targ->dv_max_width = width;
 	if (targ->dv_max_ppr_options == 0)
 		targ->dv_max_ppr_options = ppr_options;
 	if (targ->dv_last_ppr_options == 0)
@@ -3459,7 +3480,7 @@
 				period++;
 			}
 		} else if ((ahc->features & AHC_WIDE) != 0
-			&& tinfo->user.width != 0
+			&& targ->dv_max_width != 0
 			&& wide_speed >= fallback_speed
 			&& (targ->dv_next_wide_period <= AHC_ASYNC_XFER_PERIOD
 			 || period >= AHC_ASYNC_XFER_PERIOD)) {
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h	Tue Jan  7 20:41:22 2003
@@ -53,7 +53,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#114 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#118 $
  *
  */
 #ifndef _AIC7XXX_LINUX_H_
@@ -72,7 +72,6 @@
 #endif
 #include <linux/module.h>
 #include <asm/byteorder.h>
-#include <asm/io.h>
 
 #ifndef KERNEL_VERSION
 #define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z))
@@ -302,7 +301,7 @@
 #include <linux/smp.h>
 #endif
 
-#define AIC7XXX_DRIVER_VERSION "6.2.25"
+#define AIC7XXX_DRIVER_VERSION "6.2.26"
 
 /**************************** Front End Queues ********************************/
 /*
@@ -472,10 +471,11 @@
 	/*
 	 * The next "fallback" period to use for narrow/wide transfers.
 	 */
-	u_int			  dv_next_narrow_period;
-	u_int			  dv_next_wide_period;
-	u_int			  dv_max_ppr_options;
-	u_int			  dv_last_ppr_options;
+	uint8_t			  dv_next_narrow_period;
+	uint8_t			  dv_next_wide_period;
+	uint8_t			  dv_max_width;
+	uint8_t			  dv_max_ppr_options;
+	uint8_t			  dv_last_ppr_options;
 	u_int			  dv_echo_size;
 	ahc_dv_state		  dv_state;
 	u_int			  dv_state_retry;
@@ -864,6 +864,7 @@
 #define PCIM_CMD_BUSMASTEREN	0x0004
 #define PCIM_CMD_MWRICEN	0x0010
 #define PCIM_CMD_PERRESPEN	0x0040
+#define	PCIM_CMD_SERRESPEN	0x0100
 #define PCIR_STATUS		0x06
 #define PCIR_REVID		0x08
 #define PCIR_PROGIF		0x09
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c	Tue Jan  7 20:41:22 2003
@@ -36,7 +36,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#42 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#43 $
  */
 
 #include "aic7xxx_osm.h"
@@ -167,8 +167,8 @@
 		ahc->platform_data->hw_dma_mask =
 		    (bus_addr_t)(0x7FFFFFFFFFULL & (bus_addr_t)~0);
 	} else {
-		ahc_pci_set_dma_mask(pdev, 0xffffffffULL);
-		ahc->platform_data->hw_dma_mask = 0xffffffffULL;
+		ahc_pci_set_dma_mask(pdev, 0xFFFFFFFF);
+		ahc->platform_data->hw_dma_mask = 0xFFFFFFFF;
 	}
 #endif
 	ahc->dev_softc = pci;
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c
--- a/drivers/scsi/aic7xxx/aic7xxx_pci.c	Tue Jan  7 20:41:21 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c	Tue Jan  7 20:41:21 2003
@@ -39,7 +39,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#54 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#55 $
  *
  * $FreeBSD$
  */
@@ -1202,15 +1202,20 @@
 int
 ahc_pci_test_register_access(struct ahc_softc *ahc)
 {
-	int	error;
-	u_int	status1;
-	uint8_t	seqctl;
+	int	 error;
+	u_int	 status1;
+	uint32_t cmd;
+	uint8_t	 hcntrl;
 
 	error = EIO;
 
-	/* Enable PCI error interrupt status */
-	seqctl = ahc_inb(ahc, SEQCTL);
-	ahc_outb(ahc, SEQCTL, seqctl & ~FAILDIS);
+	/*
+	 * Enable PCI error interrupt status, but suppress NMIs
+	 * generated by SERR raised due to target aborts.
+	 */
+	cmd = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/2);
+	ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
+			     cmd & ~PCIM_CMD_SERRESPEN, /*bytes*/2);
 
 	/*
 	 * First a simple test to see if any
@@ -1220,7 +1225,8 @@
 	 * be zero so it is a good register to
 	 * use for this test.
 	 */
-	if (ahc_inb(ahc, HCNTRL) == 0xFF)
+	hcntrl = ahc_inb(ahc, HCNTRL);
+	if (hcntrl == 0xFF)
 		goto fail;
 
 	/*
@@ -1230,8 +1236,13 @@
 	 * either, so look for data corruption and/or flagged
 	 * PCI errors.
 	 */
-	ahc_outl(ahc, SRAM_BASE, 0x5aa555aa);
-	if (ahc_inl(ahc, SRAM_BASE) != 0x5aa555aa)
+	ahc_outb(ahc, HCNTRL, hcntrl|PAUSE);
+	while (ahc_is_paused(ahc) == 0)
+		;
+	ahc_outb(ahc, SEQCTL, PERRORDIS);
+	ahc_outb(ahc, SCBPTR, 0);
+	ahc_outl(ahc, SCB_BASE, 0x5aa555aa);
+	if (ahc_inl(ahc, SCB_BASE) != 0x5aa555aa)
 		goto fail;
 
 	status1 = ahc_pci_read_config(ahc->dev_softc,
@@ -1248,7 +1259,8 @@
 	ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
 			     status1, /*bytes*/1);
 	ahc_outb(ahc, CLRINT, CLRPARERR);
-	ahc_outb(ahc, SEQCTL, seqctl);
+	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
+	ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
 	return (error);
 }
 
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped b/drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped
--- a/drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped	Tue Jan  7 20:41:22 2003
@@ -2,8 +2,8 @@
  * DO NOT EDIT - This file is automatically generated
  *		 from the following source files:
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#52 $
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#36 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#53 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#37 $
  */
 typedef int (ahc_reg_print_t)(u_int, u_int *, u_int);
 typedef struct ahc_reg_parse_entry {
@@ -1779,6 +1779,7 @@
 #define	MAX_OFFSET	0xff
 #define	BUS_16_BIT	0x01
 #define	SCB_UPLOAD_SIZE	0x20
+#define	STACK_SIZE	0x04
 
 
 /* Downloaded Constant Definitions */
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped b/drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped
--- a/drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped	Tue Jan  7 20:41:22 2003
@@ -2,8 +2,8 @@
  * DO NOT EDIT - This file is automatically generated
  *		 from the following source files:
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#52 $
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#36 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#53 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#37 $
  */
 
 #include "aic7xxx_osm.h"
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_seq.h_shipped b/drivers/scsi/aic7xxx/aic7xxx_seq.h_shipped
--- a/drivers/scsi/aic7xxx/aic7xxx_seq.h_shipped	Tue Jan  7 20:41:22 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_seq.h_shipped	Tue Jan  7 20:41:22 2003
@@ -2,8 +2,8 @@
  * DO NOT EDIT - This file is automatically generated
  *		 from the following source files:
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#52 $
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#36 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#53 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#37 $
  */
 static uint8_t seqprog[] = {
 	0xb2, 0x00, 0x00, 0x08,
diff -Nru a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y	Tue Jan  7 20:41:21 2003
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y	Tue Jan  7 20:41:22 2003
@@ -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#28 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#29 $
  *
  * $FreeBSD$
  */
@@ -209,7 +209,7 @@
 
 %type <value> export ret f1_opcode f2_opcode jmp_jc_jnc_call jz_jnz je_jne
 
-%type <value> numerical_value mode_value mode_list macro_arglist
+%type <value> mode_value mode_list macro_arglist
 
 %left '|'
 %left '&'
@@ -781,17 +781,6 @@
 		}
 		$$ = $1 + 1;
 		add_macro_arg($3, $1);
-	}
-;
-
-numerical_value:
-	T_NUMBER
-	{
-		$$ = $1;
-	}
-|	'-' T_NUMBER
-	{
-		$$ = -$2;
 	}
 ;
 

===================================================================


This BitKeeper patch contains the following changesets:
1.893..1.893.1.4
## Wrapped with gzip_uu ##


begin 664 bkpatch12837
M'XL(`.*=&SX``^Q<^U<;.9;^V?XKM)#.0H)M2?5V.IDFV$E\`H0VI">SFST^
M]9!Q+7:5IZH<8->]?_O>*Y5?8,#/9#)GZ`Z%77KKTW<?NM(N^9R*I%JX##TO
M+>Z2#W&:50OQ-Y$$2?A-E+W,+[N!V\^$7_;C'J1HQC&DJ`S2I-*)>Z(B<U:\
MJTHWC`8W)5XVBI#JS,W\#H%BTFJ!E;7Q-]EM7U0+S?K[S\>'S6+Q]6MRU'&C
M2W$N,O+Z=3&+DV]N-TA_<[-.-X[*6>)&:4]D+E8^'"<=<DHY_&<P2Z.&.60F
MU:VASP+&7)V)@'+=-O5):7T170["1XO3**,6UZAEL"$U-8L6:X25;4<C5*M0
M5J$684:5VE7#*L%O2LGCI9.7E)1H\2W9;)>.BCXY$<FE(-Y5M5*Y$DDDNF7O
MR@NSM!R)K!*XWT2ODO;=Q)=SX9,PRF(RMXU5-8/YN\JHI95$].,TA(^A2/,J
MU.P60R++_^U>O?,&DVO0DZ%N&-0L?B2F!8^35?.?37!2+"WY4RRNA`3;L``)
MV.H<"6569E-H<*K<J>IFB5J(!KD,?GMPX9"7;%MP^-P/W$R0K".(&_K6S<T-
M.7&O1#OL"I+&\+V;R9>)N`S33"0`B':<]-PLC".2N5Y7I%"*FP@2Q1FD\@9A
M-R/P3D!G;@E^#,J0`JM*`7<BPT(^RN]),L!:LEOX#86JQ&%T2=IATKN&,O.,
MYP.O%T*^@'BW57+N]DC3_19Y<7))?DW=WF])_JD,_]Y(L#"ZYIQ3EQ;?D#ZR
MSORQEO.4I)743\-*/G*5T<A-QM^FG)E#C7/;&+JZ9KB:K3M.VPY88#XUZT_7
M@6"#&KBCTR'3;9L7BT^5>0^L*K^)8&5T"JQ\!JP:KU+KAX-U-`;P=-->%;Z!
MGZ;H05LD2*-!3R3PKMN"B@>"].-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6^TT8P6`8KSZ7,5>TOD5I`IOM#I(FL2$4XBD)Q&200]C$BT64
M8+`XT?0@6>A(3P!%+HXNHCNM#%9!P=,$J_RX,6F`5;$,T-FXAV_!:XLUI^4-
MO3';<W4T?_0T>1@=0`;Q.&;%+"W[+_ZD[S]/;[,LA^%[%'YL]ZL>6QY:1I=&
*[2]EW9025G$`````
`
end

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx driver updates.
  2003-01-08  3:46   ` Aic7xxx and Aic79xx driver updates Justin T. Gibbs
@ 2003-01-08  3:49     ` Justin T. Gibbs
  0 siblings, 0 replies; 12+ messages in thread
From: Justin T. Gibbs @ 2003-01-08  3:49 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-scsi

> "bk send" version can be found here:
> 
> http://people.FreeBSD.org/~gibbs/linux/SRC/aic79xx-linux-2.5-bksend.gz

Should be:

http://people.freebsd.org/~gibbs/linux/SRC/aic79xx-linux-2.5-20030107.bksen
d.gz

--
Justin


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Aic7xxx and Aic79xx Driver Updates
@ 2003-05-01 22:28 Justin T. Gibbs
  2003-05-02  0:17 ` Willy Tarreau
  2003-05-02 14:30 ` James Bottomley
  0 siblings, 2 replies; 12+ messages in thread
From: Justin T. Gibbs @ 2003-05-01 22:28 UTC (permalink / raw)
  To: linux-scsi; +Cc: linux-kernel, Linus Torvalds, Alan Cox, Marcelo Tosatti

Folks,

I've just uploaded version 1.3.8 of the aic79xx driver and version 
6.2.33 of the aic7xxx driver.  Both are available for 2.4.X and
2.5.X kernels in either bk send format or as a tarball from here:

http://people.FreeBSD.org/~gibbs/linux/SRC/

RPMs and DUDs for various distributions are also available:

http://people.FreeBSD.org/~gibbs/linux/DUD/aic7xxx/
http://people.FreeBSD.org/~gibbs/linux/DUD/aic79xx/
http://people.FreeBSD.org/~gibbs/linux/RPM/aic7xxx/
http://people.FreeBSD.org/~gibbs/linux/RPM/aic79xx/

BK changes relative to top of the 2.5.X tree are listed below.

--
Justin

ChangeSet
  1.1118.33.8 03/05/01 11:06:21 gibbs@overdrive.btc.adaptec.com +3 -0
  Aic7xxx Driver Update (6.2.33)
   o Correct MODULE_INFO string.
   o Bump version number.

ChangeSet
  1.1118.33.7 03/05/01 11:04:13 gibbs@overdrive.btc.adaptec.com +2 -0
  Update Aic79xx and Aic7xxx Documenation

ChangeSet
  1.1118.33.6 03/05/01 11:00:31 gibbs@overdrive.btc.adaptec.com +5 -0
  Aic79xx Driver Update (version 1.3.8)
   o Correct a few BE processor bugs
   o Print an additional diagnostic during recovery processing

ChangeSet
  1.1118.33.5 03/04/24 15:12:48 gibbs@overdrive.btc.adaptec.com +7 -0
  Aic7xxx and Aic79xx Driver Updates
   o Adapt to new IRQ handler declaration/behavior for 2.5.X

ChangeSet
  1.1118.33.4 03/04/24 15:10:16 gibbs@overdrive.btc.adaptec.com +2 -0
  Aic79xx and Aic7xxx driver Update
   o Fix build on 2.5.X

ChangeSet
  1.1118.33.3 03/04/24 13:30:58 gibbs@overdrive.btc.adaptec.com +2 -0
  Merge http://linux.bkbits.net/linux-2.5
  into overdrive.btc.adaptec.com:/usr/home/gibbs/bk/linux-2.5

ChangeSet
  1.971.94.14 03/04/24 13:23:49 gibbs@overdrive.btc.adaptec.com +4 -0
  aic7xxx_osm.h, aic7xxx_osm.c, aic79xx_osm.h, aic79xx_osm.c:
    Remove pre-2.2.X kernel support. 

ChangeSet
  1.971.94.13 03/04/24 12:46:43 gibbs@overdrive.btc.adaptec.com +8 -0
  Aic79xx Driver Upate
   o Switch to handling bad SCSI status as a sequencer interrupt
     instead of having the kernel proccess these failures via
     the completion queue.  This is done because:
  
      - The old scheme required us to pause the sequencer and clear
        critical sections for each SCB.  It seems that these pause
        actions, if coincident with a sequencer FIFO interrupt, would
        result in a FIFO interrupt getting lost or directing to the
        wrong FIFO.  This caused hangs when the driver was stressed
        under high "queue full" loads.
      - The completion code assumed that it was always called with
        the sequencer running.  This may not be the case in timeout
        processing where completions occur manually via
        ahd_pause_and_flushwork().
      - With this scheme, the extra expense of clearing critical
        sections is avoided since the sequencer will only self pause
        once all pending selections have cleared and it is not in
        a critical section.

ChangeSet
  1.971.94.12 03/04/24 12:36:46 gibbs@overdrive.btc.adaptec.com +1 -0
  Aic79xx Driver Update
   o Revert ahd_pause_and_flushwork() behavior so that ENSELO can
     be cleared.  This makes ahd_pause_and_flushwork() more effective
     when the bus is hung.

ChangeSet
  1.971.94.11 03/04/24 12:24:31 gibbs@overdrive.btc.adaptec.com +1 -0
  Aic79xx Driver Update
   o Correct "Unexpected PKT Busfree" error observed under high
     tag loads.

ChangeSet
  1.971.94.10 03/04/24 12:15:47 gibbs@overdrive.btc.adaptec.com +7 -0
  Aic79xx Driver Update
   o Perform a few firmware optimizations
   o Correct the packetized status handler so that
     it can handle CRC errors during status data packets.

ChangeSet
  1.971.94.9 03/04/24 12:10:40 gibbs@overdrive.btc.adaptec.com +2 -0
  Aic7xxx Driver Update
   o Auto disable PCI parity error reporting after 10 parity errors
     are observed.  The user is given a loud warning message telling
     them that eiter a device plugged into their motherboard or their
     motherboard is not very healthy.

ChangeSet
  1.971.94.8 03/04/24 12:07:37 gibbs@overdrive.btc.adaptec.com +4 -0
  Aic7xxx and Aic79xx Driver Updates
   o Correct type safty of option parsing logic
   o Make option toggling work correctly
   o Add "probe_eisa_vlb" as an alias for the "no_probe" option so
     that there is a clearly defined name associated with the command
     line feature that allows eisa_vlb probes to be enabled/disabled
     in the aic7xxx driver.
   o PCI parity error checking defaults to being enabled.

ChangeSet
  1.971.94.7 03/04/24 11:53:55 gibbs@overdrive.btc.adaptec.com +2 -0
  Aic7xxx and Aic79xx driver Update
   o Fix style nits.

ChangeSet
  1.971.94.6 03/04/24 11:49:01 gibbs@overdrive.btc.adaptec.com +2 -0
  Aic7xxx and Aic79xx driver updates
   o Remove extra complexity and code duplication in processing
     the completeq now that the completeq can be run while holding
     both the ah?_lock and the done_lock.

ChangeSet
  1.971.94.5 03/04/24 11:46:55 gibbs@overdrive.btc.adaptec.com +2 -0
  Aic7xxx and Aic79xx driver updates
   o Work around peculiarities in the scan_scsis routines
     that could, due to having duplicate devices on our
     host's device list, cause tagged queing to be disabled
     for devices added via /proc.

ChangeSet
  1.971.94.4 03/04/24 11:42:36 gibbs@overdrive.btc.adaptec.com +2 -0
  Aic7xxx and Aic79xx Driver Update
   o Correct channel information in our /proc output.

ChangeSet
  1.971.94.3 03/04/24 11:24:15 gibbs@overdrive.btc.adaptec.com +6 -0
  Aic7xxx and Aic79xx driver Update
  o Avoid pre-2.5.X mid-layer deadlock due to SCSI malloc fragmentation
  
  For pre-2.5.X kernels, attempt to calculate a safe value
  for our S/G list length.  In these kernels, the midlayer
  allocates an S/G array dynamically when a command is issued
  using SCSI malloc.  This list, which is in an OS dependent
  format that must later be copied to our private S/G list, is
  sized to house just the number of segments needed for the
  current transfer.  Since the code that sizes the SCSI malloc
  pool does not take into consideration fragmentation of the
  pool, executing transactions numbering just a fraction of our
  concurrent transaction limit with list lengths aproaching
  AH?_NSEG in length will quickly depleat the SCSI malloc pool
  of usable space.
  
  Unfortunately, the mid-layer does not properly handle this
  scsi malloc failure.  In kernels prior to 2.4.20, should
  the device that experienced the malloc failure be idle and
  never have any new I/O initiated (block queue is not "kicked"),
  the process will hang indefinitely.  In 2.4.20 and beyond,
  the disk experiencing the failure is marked as a "starved
  device", but this only helps if I/O is initiated to or completes
  on that HBA.  If the failure was induced by another HBA, and
  no other I/O is pending on the HBA and no new transactions are
  queued, we are still succeptible to the hang.  (Also note that
  many 2.4.X kernels do not properly lock the "some_device_starved"
  and "device_starved" fields calling into question their overall
  effectiveness).
  
  By sizing our S/G list to avoid SCSI malloc pool fragmentation,
  we will hopefully avoid this deadlock at least for configurations
  where our own HBAs are the only ones using the SCSI subsystem.

ChangeSet
  1.971.94.2 03/04/09 18:12:31 gibbs@overdrive.btc.adaptec.com +1 -0
  Aic79xx Driver Update
   o Correct failed-wait recovery code so that the controller's registers
     will not be accessed without pausing the controller first.

ChangeSet
  1.971.94.1 03/04/09 13:07:08 gibbs@overdrive.btc.adaptec.com +1 -0
  Merge http://linux.bkbits.net/linux-2.5
  into overdrive.btc.adaptec.com:/usr/home/gibbs/bk/linux-2.5

ChangeSet
  1.971.37.4 03/04/09 13:01:11 gibbs@overdrive.btc.adaptec.com +4 -0
  Aic7xxx Driver Update (version 6.2.32)
   o Perform an audit on use of del_timer() and switch to del_timer_sync()
     where appropriate.
   o Remove the reboot notifier hook which is unused in 2.5.X.
   o Correct some driver unload bugs.

ChangeSet
  1.971.37.3 03/04/09 12:52:07 gibbs@overdrive.btc.adaptec.com +3 -0
  Aic79xx Driver Update (version 1.3.6)
   o Correct bus hang on SE->LVD/LVD->SE tranceiver changes
   o Close a race condition in handling bad scsi status that could
     allow the driver to modify the waiting for selection queue while
     selections were enabled.
   o Perform an audit on use of del_timer() and switch to del_timer_sync()
     where appropriate.
   o Remove the reboot notifier hook which is unused in 2.5.X.
   o Correct some driver unload bugs.

ChangeSet
  1.971.37.2 03/04/09 11:56:15 gibbs@overdrive.btc.adaptec.com +2 -0
  Change the callback argument for aic brace option parsing to u_long
  to avoid casting problems with different architectures.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-01 22:28 Aic7xxx and Aic79xx Driver Updates Justin T. Gibbs
@ 2003-05-02  0:17 ` Willy Tarreau
  2003-05-02  4:25   ` Justin T. Gibbs
  2003-05-02 14:30 ` James Bottomley
  1 sibling, 1 reply; 12+ messages in thread
From: Willy Tarreau @ 2003-05-02  0:17 UTC (permalink / raw)
  To: Justin T. Gibbs
  Cc: linux-scsi, linux-kernel, Linus Torvalds, Alan Cox,
	Marcelo Tosatti

On Thu, May 01, 2003 at 04:28:12PM -0600, Justin T. Gibbs wrote:
> Folks,
> 
> I've just uploaded version 1.3.8 of the aic79xx driver and version 
> 6.2.33 of the aic7xxx driver.  Both are available for 2.4.X and
> 2.5.X kernels in either bk send format or as a tarball from here:
> 
> http://people.FreeBSD.org/~gibbs/linux/SRC/

Hi Justin,

I've just tested it and I still have the deadlock on SMP. I also tried with
noapic, but it didn't change. I have reduced the TCQ from 253 to 32, and I
had the impression that it was more difficult to trigger, although I cannot
be certain. With 32, I could boot and go to about half the 'make -j 8 dep',
while it hanged during init script with 253. I may retest by the week-end, but
now I'm going to sleep. Now I'm back to 6.2.28 and everything's OK.

Regards,
Willy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-02  0:17 ` Willy Tarreau
@ 2003-05-02  4:25   ` Justin T. Gibbs
  2003-05-02  5:56     ` Willy Tarreau
  0 siblings, 1 reply; 12+ messages in thread
From: Justin T. Gibbs @ 2003-05-02  4:25 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: linux-scsi, linux-kernel, Linus Torvalds, Alan Cox,
	Marcelo Tosatti

> On Thu, May 01, 2003 at 04:28:12PM -0600, Justin T. Gibbs wrote:
>> Folks,
>> 
>> I've just uploaded version 1.3.8 of the aic79xx driver and version 
>> 6.2.33 of the aic7xxx driver.  Both are available for 2.4.X and
>> 2.5.X kernels in either bk send format or as a tarball from here:
>> 
>> http://people.FreeBSD.org/~gibbs/linux/SRC/
> 
> Hi Justin,
> 
> I've just tested it and I still have the deadlock on SMP. I also tried with
> noapic, but it didn't change. I have reduced the TCQ from 253 to 32, and I
> had the impression that it was more difficult to trigger, although I cannot
> be certain. With 32, I could boot and go to about half the 'make -j 8 dep',
> while it hanged during init script with 253. I may retest by the week-end, but
> now I'm going to sleep. Now I'm back to 6.2.28 and everything's OK.

Can you try with this patch?  It seems I forgot to pull part of a change
from the aic79xx driver into the aic7xxx driver.  This could easily cause
a lock order reversal. <sigh>

==== //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#159 - /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aic79xx_osm.c ====
--- /tmp/tmp.29873.0	2003-05-01 22:21:54.000000000 -0600
+++ /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aic79xx_osm.c	2003-05-01 22:04:07.000000000 -0600
@@ -670,7 +670,6 @@
 		TAILQ_REMOVE(&ahd->platform_data->completeq,
 			     acmd, acmd_links.tqe);
 		cmd = &acmd_scsi_cmd(acmd);
-		acmd = TAILQ_NEXT(acmd, acmd_links.tqe);
 		cmd->host_scribble = NULL;
 		if (ahd_cmd_get_transaction_status(cmd) != DID_OK
 		 || (cmd->result & 0xFF) != SCSI_STATUS_OK)
@@ -1756,9 +1755,11 @@
 		TAILQ_REMOVE(&ahd->platform_data->device_runq, dev, links);
 		dev->flags &= ~AHD_DEV_ON_RUN_LIST;
 		ahd_linux_check_device_queue(ahd, dev);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 		/* Yeild to our interrupt handler */
 		ahd_unlock(ahd, &flags);
 		ahd_lock(ahd, &flags);
+#endif
 	}
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 	ahd_unlock(ahd, &flags);
==== //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#220 - /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aic7xxx_osm.c ====
--- /tmp/tmp.29873.1	2003-05-01 22:21:54.000000000 -0600
+++ /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aic7xxx_osm.c	2003-05-01 22:19:46.000000000 -0600
@@ -664,7 +664,6 @@
 		TAILQ_REMOVE(&ahc->platform_data->completeq,
 			     acmd, acmd_links.tqe);
 		cmd = &acmd_scsi_cmd(acmd);
-		acmd = TAILQ_NEXT(acmd, acmd_links.tqe);
 		cmd->host_scribble = NULL;
 		if (ahc_cmd_get_transaction_status(cmd) != DID_OK
 		 || (cmd->result & 0xFF) != SCSI_STATUS_OK)
@@ -1385,9 +1384,11 @@
 		TAILQ_REMOVE(&ahc->platform_data->device_runq, dev, links);
 		dev->flags &= ~AHC_DEV_ON_RUN_LIST;
 		ahc_linux_check_device_queue(ahc, dev);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 		/* Yeild to our interrupt handler */
 		ahc_unlock(ahc, &flags);
 		ahc_lock(ahc, &flags);
+#endif
 	}
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 	ahc_unlock(ahc, &flags);
==== //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#140 - /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aic7xxx_osm.h ====
--- /tmp/tmp.29873.2	2003-05-01 22:21:54.000000000 -0600
+++ /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aic7xxx_osm.h	2003-05-01 22:21:10.000000000 -0600
@@ -737,7 +737,8 @@
 	 * trade the io_request_lock for our per-softc lock.
 	 */
 #if AHC_SCSI_HAS_HOST_LOCK == 0
-	ahc_lock(ahc, flags);
+	spin_unlock(&io_request_lock);
+	spin_lock(&ahc->platform_data->spin_lock);
 #endif
 }
 
@@ -745,7 +746,8 @@
 ahc_midlayer_entrypoint_unlock(struct ahc_softc *ahc, unsigned long *flags)
 {
 #if AHC_SCSI_HAS_HOST_LOCK == 0
-	ahc_unlock(ahc, flags);
+	spin_unlock(&ahd->platform_data->spin_lock);
+	spin_lock(&io_request_lock);
 #endif
 }
 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-02  4:25   ` Justin T. Gibbs
@ 2003-05-02  5:56     ` Willy Tarreau
  0 siblings, 0 replies; 12+ messages in thread
From: Willy Tarreau @ 2003-05-02  5:56 UTC (permalink / raw)
  To: Justin T. Gibbs
  Cc: Willy Tarreau, linux-scsi, linux-kernel, Linus Torvalds, Alan Cox,
	Marcelo Tosatti

On Thu, May 01, 2003 at 10:25:31PM -0600, Justin T. Gibbs wrote:
 
> Can you try with this patch?  It seems I forgot to pull part of a change
> from the aic79xx driver into the aic7xxx driver.  This could easily cause
> a lock order reversal. <sigh>

Congratulations, Justin, you just spotted it !

I cannot hang it anymore. It supported an fsck and the make -j dep.
I'm happy, I'll be able to reintegrate your updates to my tree !
I just have changed one typo for it to compile :

> --- /tmp/tmp.29873.2	2003-05-01 22:21:54.000000000 -0600
> +++ /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aic7xxx_osm.h	2003-05-01 22:21:10.000000000 -0600
> @@ -745,7 +746,8 @@
>  ahc_midlayer_entrypoint_unlock(struct ahc_softc *ahc, unsigned long *flags)
>  {
>  #if AHC_SCSI_HAS_HOST_LOCK == 0
> -	ahc_unlock(ahc, flags);
> +	spin_unlock(&ahd->platform_data->spin_lock);

                    ^^^^ this one is in fact &ahc->platform_data...

Thanks ;-)
Willy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-01 22:28 Aic7xxx and Aic79xx Driver Updates Justin T. Gibbs
  2003-05-02  0:17 ` Willy Tarreau
@ 2003-05-02 14:30 ` James Bottomley
  2003-05-02 17:51   ` Justin T. Gibbs
  1 sibling, 1 reply; 12+ messages in thread
From: James Bottomley @ 2003-05-02 14:30 UTC (permalink / raw)
  To: Justin T. Gibbs
  Cc: SCSI Mailing List, Linux Kernel, Linus Torvalds, Alan Cox,
	Marcelo Tosatti

First off, could you take a look at

http://bugzilla.kernel.org/show_bug.cgi?id=608

I thought it was an sr problem, but it doesn't seem to show up on
anything other than adaptec controllers?  Thanks.

On Thu, 2003-05-01 at 17:28, Justin T. Gibbs wrote:
> ChangeSet
>   1.1118.33.5 03/04/24 15:12:48 gibbs@overdrive.btc.adaptec.com +7 -0
>   Aic7xxx and Aic79xx Driver Updates
>    o Adapt to new IRQ handler declaration/behavior for 2.5.X

The changes for this:

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#define        AIC_LINUX_IRQRETURN_T irqreturn_t
+#define        AIC_LINUX_IRQRETURN(ours) return (IRQ_RETVAL(ours))
+#else
+#define        AIC_LINUX_IRQRETURN_T void
+#define        AIC_LINUX_IRQRETURN(ours)  return
+#endif

Are rather convoluted.  Could you just remove the wrappering for 2.5?


> ChangeSet
>   1.971.94.5 03/04/24 11:46:55 gibbs@overdrive.btc.adaptec.com +2 -0
>   Aic7xxx and Aic79xx driver updates
>    o Work around peculiarities in the scan_scsis routines
>      that could, due to having duplicate devices on our
>      host's device list, cause tagged queing to be disabled
>      for devices added via /proc.

-ahc_linux_select_queue_depth(struct Scsi_Host * host,
-                            Scsi_Device * scsi_devs)
+ahc_linux_select_queue_depth(struct Scsi_Host *host, Scsi_Device
*scsi_devs)

select_queue_depth isn't a 2.5 interface anymore, why do you even still
need it?

> ChangeSet
>   1.971.94.3 03/04/24 11:24:15 gibbs@overdrive.btc.adaptec.com +6 -0
>   Aic7xxx and Aic79xx driver Update
>   o Avoid pre-2.5.X mid-layer deadlock due to SCSI malloc fragmentation
[...]

This is entirely irrelevant to 2.5 as well.

James

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-02 14:30 ` James Bottomley
@ 2003-05-02 17:51   ` Justin T. Gibbs
  2003-05-02 18:07     ` James Bottomley
  0 siblings, 1 reply; 12+ messages in thread
From: Justin T. Gibbs @ 2003-05-02 17:51 UTC (permalink / raw)
  To: James Bottomley
  Cc: SCSI Mailing List, Linux Kernel, Linus Torvalds, Alan Cox,
	Marcelo Tosatti

> First off, could you take a look at
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=608
> 
> I thought it was an sr problem, but it doesn't seem to show up on
> anything other than adaptec controllers?  Thanks.

I've just updated the bug.

> On Thu, 2003-05-01 at 17:28, Justin T. Gibbs wrote:
>> ChangeSet
>>   1.1118.33.5 03/04/24 15:12:48 gibbs@overdrive.btc.adaptec.com +7 -0
>>   Aic7xxx and Aic79xx Driver Updates
>>    o Adapt to new IRQ handler declaration/behavior for 2.5.X
> 
> The changes for this:
> 
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
> +#define        AIC_LINUX_IRQRETURN_T irqreturn_t
> +#define        AIC_LINUX_IRQRETURN(ours) return (IRQ_RETVAL(ours))
> +#else
> +#define        AIC_LINUX_IRQRETURN_T void
> +#define        AIC_LINUX_IRQRETURN(ours)  return
> +#endif
> 
> Are rather convoluted.  Could you just remove the wrappering for 2.5?

The answer to this and your other issues you raise about the driver are
the same.  I do not want to fork the driver.  I still have to maintain
support all the way back to 2.4.7 and branching the driver for every
different supported kernel would be a nightmare to maintain.  As it stands
now, other than the Makefile and kernel config files, there is just one
set of files that supports all of these kernels.  It makes it much
easier for everyone involved including the primary maintainer of the
driver.

Personally, I don't see how this:

AIC_LINUX_IRQRETURN_T
ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs)
{
        struct  ahd_softc *ahd;
        u_long  flags;
        int     ours;

...

        AIC_LINUX_IRQRETURN(ours);
}

Is any harder to parse than:

irqreturn_t
ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs)
{
        struct  ahd_softc *ahd;
        u_long  flags;
        int     ours;

...

        return IRQ_RETVAL(ours);
}

I've tried hard to make most of the API differences similarly transparent
within the driver to avoid messy ifdefs.  I haven't succeeded everywhere,
but this is the price you pay when APIs change so often.  All of the code
is also setup so that the backwards compatibility hooks have no impact on
the driver's performance under any support kernel (i.e. each kernel is
supported as best as it can be supported).

Is there some new policy against having drivers that support multiple
kernel versions?

--
Justin


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-02 17:51   ` Justin T. Gibbs
@ 2003-05-02 18:07     ` James Bottomley
  2003-05-02 18:19       ` Linus Torvalds
  2003-05-03 23:01       ` Justin T. Gibbs
  0 siblings, 2 replies; 12+ messages in thread
From: James Bottomley @ 2003-05-02 18:07 UTC (permalink / raw)
  To: Justin T. Gibbs
  Cc: SCSI Mailing List, Linux Kernel, Linus Torvalds, Alan Cox,
	Marcelo Tosatti

On Fri, 2003-05-02 at 12:51, Justin T. Gibbs wrote:
> > First off, could you take a look at
> > 
> > http://bugzilla.kernel.org/show_bug.cgi?id=608
> > 
> > I thought it was an sr problem, but it doesn't seem to show up on
> > anything other than adaptec controllers?  Thanks.
> 
> I've just updated the bug.


Thanks.

> > On Thu, 2003-05-01 at 17:28, Justin T. Gibbs wrote:
> >> ChangeSet
> >>   1.1118.33.5 03/04/24 15:12:48 gibbs@overdrive.btc.adaptec.com +7 -0
> >>   Aic7xxx and Aic79xx Driver Updates
> >>    o Adapt to new IRQ handler declaration/behavior for 2.5.X
> > 
> > The changes for this:
> > 
> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
> > +#define        AIC_LINUX_IRQRETURN_T irqreturn_t
> > +#define        AIC_LINUX_IRQRETURN(ours) return (IRQ_RETVAL(ours))
> > +#else
> > +#define        AIC_LINUX_IRQRETURN_T void
> > +#define        AIC_LINUX_IRQRETURN(ours)  return
> > +#endif
> > 
> > Are rather convoluted.  Could you just remove the wrappering for 2.5?
> 
> The answer to this and your other issues you raise about the driver are
> the same.  I do not want to fork the driver.  I still have to maintain
> support all the way back to 2.4.7 and branching the driver for every
> different supported kernel would be a nightmare to maintain.  As it stands
> now, other than the Makefile and kernel config files, there is just one
> set of files that supports all of these kernels.  It makes it much
> easier for everyone involved including the primary maintainer of the
> driver.

Well, you do keep a 2.4 and a 2.5 tree, so you still have to apply your
patches twice.  You also seem to have two drivers: aic7xxx and aic79xx
which seem to duplicate about 80% of the code between them, so you have
to further patch each of these drivers for each of your fixes.

I'm not asking for any changes to the way you do 2.4, just for 2.5 where
we have no vendor versions to support and there should only be a single
tree.

> Personally, I don't see how this:
> 
> AIC_LINUX_IRQRETURN_T
> ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs)
> {
>         struct  ahd_softc *ahd;
>         u_long  flags;
>         int     ours;
> 
> ...
> 
>         AIC_LINUX_IRQRETURN(ours);
> }
> 
> Is any harder to parse than:
> 
> irqreturn_t
> ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs)
> {
>         struct  ahd_softc *ahd;
>         u_long  flags;
>         int     ours;
> 
> ...
> 
>         return IRQ_RETVAL(ours);
> }

The latter requires fewer levels of indirection to understand what's
going on.

> I've tried hard to make most of the API differences similarly transparent
> within the driver to avoid messy ifdefs.  I haven't succeeded everywhere,
> but this is the price you pay when APIs change so often.  All of the code
> is also setup so that the backwards compatibility hooks have no impact on
> the driver's performance under any support kernel (i.e. each kernel is
> supported as best as it can be supported).

Well, for 2.4, where there are multiple vendor versions, I'm OK with
this.  For 2.5 it's not necessary (yet).

> Is there some new policy against having drivers that support multiple
> kernel versions?

Not as such.  There is a preference for clean additions, though.  Adding
code to drivers that is never used and will never be used does tend to
make them more obscure to the reader.

James



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-02 18:07     ` James Bottomley
@ 2003-05-02 18:19       ` Linus Torvalds
  2003-05-03 23:03         ` Justin T. Gibbs
  2003-05-03 23:01       ` Justin T. Gibbs
  1 sibling, 1 reply; 12+ messages in thread
From: Linus Torvalds @ 2003-05-02 18:19 UTC (permalink / raw)
  To: James Bottomley
  Cc: Justin T. Gibbs, SCSI Mailing List, Linux Kernel, Alan Cox,
	Marcelo Tosatti


On 2 May 2003, James Bottomley wrote:
> 
> I'm not asking for any changes to the way you do 2.4, just for 2.5 where
> we have no vendor versions to support and there should only be a single
> tree.

The way the backwards-compatibility is _meant_ to work is that a driver 
can just do this:

	#ifndef IRQ_RETVAL
	  typedef void irqreturn_t;
	  #define IRQ_NONE
	  #define IRQ_HANDLED
	  #define IRQ_RETVAL(x)
	#endif

and after that you can just use the 2.5.x semantics even with a 2.4.x 
kernel.

Which is nice and clean, and allows you to support old kernels _without_ 
having any translation layer.

		Linus


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-02 18:07     ` James Bottomley
  2003-05-02 18:19       ` Linus Torvalds
@ 2003-05-03 23:01       ` Justin T. Gibbs
  1 sibling, 0 replies; 12+ messages in thread
From: Justin T. Gibbs @ 2003-05-03 23:01 UTC (permalink / raw)
  To: James Bottomley
  Cc: SCSI Mailing List, Linux Kernel, Linus Torvalds, Alan Cox,
	Marcelo Tosatti

>> The answer to this and your other issues you raise about the driver are
>> the same.  I do not want to fork the driver.  I still have to maintain
>> support all the way back to 2.4.7 and branching the driver for every
>> different supported kernel would be a nightmare to maintain.  As it stands
>> now, other than the Makefile and kernel config files, there is just one
>> set of files that supports all of these kernels.  It makes it much
>> easier for everyone involved including the primary maintainer of the
>> driver.
> 
> Well, you do keep a 2.4 and a 2.5 tree, so you still have to apply your
> patches twice.

Linux has finally started to use revision control, so I try to take
advantage of that by breaking up my changes and providing complete
changelogs.  Yes, it is a pain since I have to do three commits (Perforce,
BK linux-2.4, BK linux-2.5), but there is only one "version" of the driver
that I have to keep in my head, rather than two or twenty.  The 2.4.X code
also encourages those "upgrading" the drivers for 2.5.X features to do so in
a 2.4.X compatible fashion.  It's usually not that hard.

> You also seem to have two drivers: aic7xxx and aic79xx
> which seem to duplicate about 80% of the code between them, so you have
> to further patch each of these drivers for each of your fixes.

80% is a bit of an overstatement.  Yes, the OSMs are similar because
the author is the same.  Where code can be factored it is put into the
aiclib files - a process that is not fully complete.  The concentration
has been on keeping the drivers up to date with 2.5 and fixing bugs, but
some bit of code moves to common files in almost every version bump.

> I'm not asking for any changes to the way you do 2.4, just for 2.5 where
> we have no vendor versions to support and there should only be a single
> tree.

And as the maintainer, I know that maintaining a single driver is
far easier than splitting it up.  Other maintainers may feel differently,
but they are not maintaining these drivers.

>> I've tried hard to make most of the API differences similarly transparent
>> within the driver to avoid messy ifdefs.  I haven't succeeded everywhere,
>> but this is the price you pay when APIs change so often.  All of the code
>> is also setup so that the backwards compatibility hooks have no impact on
>> the driver's performance under any support kernel (i.e. each kernel is
>> supported as best as it can be supported).
> 
> Well, for 2.4, where there are multiple vendor versions, I'm OK with
> this.  For 2.5 it's not necessary (yet).

If at some point there becomes an official policy that all backward
compatibility code must be removed, I will do so.  I'm sure I'm not
the only driver maintainer that will complain if/when this happens.  Until
then, I hope that the level of "obscurity" this adds to the code doesn't
prevent you or others from providing substantive reviews of my drivers.

--
Justin

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Aic7xxx and Aic79xx Driver Updates
  2003-05-02 18:19       ` Linus Torvalds
@ 2003-05-03 23:03         ` Justin T. Gibbs
  0 siblings, 0 replies; 12+ messages in thread
From: Justin T. Gibbs @ 2003-05-03 23:03 UTC (permalink / raw)
  To: Linus Torvalds, James Bottomley
  Cc: SCSI Mailing List, Linux Kernel, Alan Cox, Marcelo Tosatti

> On 2 May 2003, James Bottomley wrote:
>> 
>> I'm not asking for any changes to the way you do 2.4, just for 2.5 where
>> we have no vendor versions to support and there should only be a single
>> tree.
> 
> The way the backwards-compatibility is _meant_ to work is that a driver 
> can just do this:
> 
> 	#ifndef IRQ_RETVAL
> 	  typedef void irqreturn_t;
> 	  #define IRQ_NONE
> 	  #define IRQ_HANDLED
> 	  #define IRQ_RETVAL(x)
> 	#endif

I switched the drivers to using this yesterday.

	#ifndef IRQ_RETVAL
	  typedef void irqreturn_t;
	  #define IRQ_RETVAL(x)
	#endif

Updated BK send and tar files are here:

http://people.FreeBSD.org/~gibbs/linux/SRC/

--
Justin


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-05-03 23:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-01 22:28 Aic7xxx and Aic79xx Driver Updates Justin T. Gibbs
2003-05-02  0:17 ` Willy Tarreau
2003-05-02  4:25   ` Justin T. Gibbs
2003-05-02  5:56     ` Willy Tarreau
2003-05-02 14:30 ` James Bottomley
2003-05-02 17:51   ` Justin T. Gibbs
2003-05-02 18:07     ` James Bottomley
2003-05-02 18:19       ` Linus Torvalds
2003-05-03 23:03         ` Justin T. Gibbs
2003-05-03 23:01       ` Justin T. Gibbs
     [not found] <200212210334.gBL3Yi111607@localhost.localdomain>
     [not found] ` <175810000.1041300864@aslan.btc.adaptec.com>
2003-01-08  3:46   ` Aic7xxx and Aic79xx driver updates Justin T. Gibbs
2003-01-08  3:49     ` Justin T. Gibbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox