public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Aic7xxx v6.2.22 and Aic79xx v1.3.0Alpha2 Released
@ 2002-12-09 23:53 Justin T. Gibbs
  2002-12-10  0:12 ` Christoph Hellwig
  0 siblings, 1 reply; 38+ messages in thread
From: Justin T. Gibbs @ 2002-12-09 23:53 UTC (permalink / raw)
  To: linux-scsi; +Cc: Alan Cox, Marcelo Tosatti, Linus Torvalds

The latest installments of the Aic7xxx (Legacy -> U160) and Aic79xx (U320)
driver are now available here:

http://people.FreeBSD.org/~gibbs/linux/RPM  # RPMs for popular distributions
http://people.FreeBSD.org/~gibbs/linux/DUD  # Driver Update Diskettes
http://people.FreeBSD.org/~gibbs/linux/SRC  # Source tarballs for 2.4.X and 
					      2.5.x relative to today's
					      bk trees.

When compared to the versions of the driver currently embedded in either
the 2.4.X or the 2.5.X (at least for the U160 driver), the fixes and changes
are so numerous as to make it difficult to name them all.  Highlights
include:

o Auto-detection and fallback to PIO for broken VIA chipsets with byte
  merging enabled.
o Domain Validation
o Support for the 2.5.X dynamic queue depth facility
o Support for the 2.5.X slave alloc/configure/destroy API
o The shutdown hook has been disabled on 2.5.X to avoid a panic
  on shutdown since the hooks are called to early in that kernel series.
  I'm still working on an alternative.  In the mean time, aic785X based
  cards may not play nice with the Adaptec BIOS on a warm reboot.
o Even more workarounds for deadlocks in the 2.4.X SCSI error recovery code.
  We now "spoon feed" transactions that have failure codes back to the
  mid-layer so as to avoid the stack blow-out from recursion that can occur
  in scsi_queue_next_request.

--
Justin


^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: scsi_scan.c complaints...
@ 2002-12-21 18:42 Christoph Hellwig
  0 siblings, 0 replies; 38+ messages in thread
From: Christoph Hellwig @ 2002-12-21 18:42 UTC (permalink / raw)
  To: James.Bottomley, linux-scsi

On Fri, Dec 20, 2002 at 08:29:23PM -0500, Doug Ledford wrote:
> And I was right.  One little q = NULL; is all that was missing.  Anyway, 
> here's a printout of what startup looks like with this patch in place 
> under 2.5.52.  This should make you happy Justin ;-)

Okay, I looked at the patches that are in mainline and they look pretty
cool to me.  When looking over the code (in preparation of implementing
Justin's suggestion to get rid of the highmem_io flag) I found quite
a bit small stuff to make the code in that area a lot cleaner:

- new helper scsi_calculate_bounce_limit to calculate the bounce
  limit for a scsi host, remove a copy of that code ni st.c
- scsi_initialize_queue gets replace with scsi_alloc_queue, this
  one now takes only a struct Scsi_Host and returns the request queue,
  it's paired with a small scsi_free_queue helper.

Diffstat:

 hosts.h     |    3 -
 scsi.c      |   43 ----------------------
 scsi.h      |    1
 scsi_scan.c |  113 ++++++++++++++++++++++++++++++++++--------------------------
 scsi_syms.c |    5 ++
 st.c        |   16 +-------
 6 files changed, 73 insertions(+), 108 deletions(-)


--- 1.46/drivers/scsi/hosts.h	Thu Nov 28 14:36:44 2002
+++ edited/drivers/scsi/hosts.h	Sat Dec 21 16:47:36 2002
@@ -554,9 +554,6 @@
     struct device_driver scsi_driverfs_driver;
 };
 
-void  scsi_initialize_queue(Scsi_Device *, struct Scsi_Host *);
-
-
 /*
  * Highlevel driver registration/unregistration.
  */
--- 1.81/drivers/scsi/scsi.c	Fri Dec 20 20:59:59 2002
+++ edited/drivers/scsi/scsi.c	Sat Dec 21 16:34:24 2002
@@ -147,49 +147,6 @@
 extern void scsi_times_out(Scsi_Cmnd * SCpnt);
 void scsi_build_commandblocks(Scsi_Device * SDpnt);
 
-/*
- * Function:    scsi_initialize_queue()
- *
- * Purpose:     Sets up the block queue for a device.
- *
- * Arguments:   SDpnt   - device for which we need a handler function.
- *
- * Returns:     Nothing
- *
- * Lock status: No locking assumed or required.
- */
-void  scsi_initialize_queue(Scsi_Device * SDpnt, struct Scsi_Host * SHpnt)
-{
-	request_queue_t *q = SDpnt->request_queue;
-
-	/*
-	 * tell block layer about assigned host_lock for this host
-	 */
-	blk_init_queue(q, scsi_request_fn, SHpnt->host_lock);
-
-	/* Hardware imposed limit. */
-	blk_queue_max_hw_segments(q, SHpnt->sg_tablesize);
-
-	/*
-	 * scsi_alloc_sgtable max
-	 */
-	blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
-
-	if(!SHpnt->max_sectors)
-		/* driver imposes no hard sector transfer limit.
-		 * start at machine infinity initially */
-		SHpnt->max_sectors = SCSI_DEFAULT_MAX_SECTORS;
-
-	/* FIXME: we should also adjust this limit later on
-	 * after we know what the device capabilities are */
-	blk_queue_max_sectors(q, SHpnt->max_sectors);
-
-	if (!SHpnt->use_clustering)
-		clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
-
-        blk_queue_prep_rq(q, scsi_prep_fn);
-}
-
 #ifdef MODULE
 MODULE_PARM(scsi_logging_level, "i");
 MODULE_PARM_DESC(scsi_logging_level, "SCSI logging level; should be zero or nonzero");
--- 1.53/drivers/scsi/scsi.h	Fri Dec 20 20:59:59 2002
+++ edited/drivers/scsi/scsi.h	Sat Dec 21 16:54:22 2002
@@ -511,6 +511,7 @@
  */
 extern int scsi_add_single_device(uint, uint, uint, uint);
 extern int scsi_remove_single_device(uint, uint, uint, uint);
+extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
 
 /*
  * Prototypes for functions in constants.c
--- 1.50/drivers/scsi/scsi_scan.c	Fri Dec 20 21:00:00 2002
+++ edited/drivers/scsi/scsi_scan.c	Sat Dec 21 17:44:03 2002
@@ -28,7 +28,6 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
-
 #include <linux/blk.h>
 
 #include "scsi.h"
@@ -365,34 +364,60 @@
 		printk("\n");
 }
 
-/**
- * scsi_initialize_merge_fn() -Æ£initialize merge function for a host
- * @sd:		host descriptor
- */
-static void scsi_initialize_merge_fn(struct scsi_device *sd)
+u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost)
 {
-	request_queue_t *q = sd->request_queue;
-	struct Scsi_Host *sh = sd->host;
-	struct device *dev = scsi_get_device(sh);
-	u64 bounce_limit;
-
-	if (sh->highmem_io) {
-		if (dev && dev->dma_mask && PCI_DMA_BUS_IS_PHYS) {
-			bounce_limit = *dev->dma_mask;
-		} else {
-			/*
-			 * Platforms with virtual-DMA translation
- 			 * hardware have no practical limit.
-			 */
-			bounce_limit = BLK_BOUNCE_ANY;
-		}
-	} else if (sh->unchecked_isa_dma) {
-		bounce_limit = BLK_BOUNCE_ISA;
-	} else {
-		bounce_limit = BLK_BOUNCE_HIGH;
+	if (shost->highmem_io) {
+		struct device *host_dev = scsi_get_device(shost);
+
+		if (PCI_DMA_BUS_IS_PHYS && host_dev && host_dev->dma_mask)
+			return *host_dev->dma_mask;
+
+		/*
+		 * Platforms with virtual-DMA translation
+ 		 * hardware have no practical limit.
+		 */
+		return BLK_BOUNCE_ANY;
+	} else if (shost->unchecked_isa_dma)
+		return BLK_BOUNCE_ISA;
+
+	return BLK_BOUNCE_HIGH;
+}
+
+static request_queue_t *scsi_alloc_queue(struct Scsi_Host *shost)
+{
+	request_queue_t *q;
+
+	q = kmalloc(sizeof(*q), GFP_ATOMIC);
+	if (!q)
+		return NULL;
+	memset(q, 0, sizeof(*q));
+
+	if (!shost->max_sectors) {
+		/*
+		 * Driver imposes no hard sector transfer limit.
+		 * start at machine infinity initially.
+		 */
+		shost->max_sectors = SCSI_DEFAULT_MAX_SECTORS;
 	}
 
-	blk_queue_bounce_limit(q, bounce_limit);
+	blk_init_queue(q, scsi_request_fn, shost->host_lock);
+	blk_queue_prep_rq(q, scsi_prep_fn);
+
+	blk_queue_max_hw_segments(q, shost->sg_tablesize);
+	blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
+	blk_queue_max_sectors(q, shost->max_sectors);
+	blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost));
+
+	if (!shost->use_clustering)
+		clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
+
+	return q;
+}
+
+static void scsi_free_queue(request_queue_t *q)
+{
+	blk_cleanup_queue(q);
+	kfree(q);
 }
 
 /**
@@ -435,19 +460,15 @@
 		 */
 		sdev->borken = 1;
 
-		if(!q || *q == NULL) {
-			sdev->request_queue = kmalloc(sizeof(struct request_queue), GFP_ATOMIC);
-			if(sdev->request_queue == NULL) {
+		if (!q || *q == NULL) {
+			sdev->request_queue = scsi_alloc_queue(shost);
+			if (!sdev->request_queue)
 				goto out_bail;
-			}
-			memset(sdev->request_queue, 0,
-				       	sizeof(struct request_queue));
-			scsi_initialize_queue(sdev, shost);
-			scsi_initialize_merge_fn(sdev);
 		} else {
 			sdev->request_queue = *q;
 			*q = NULL;
 		}
+
 		sdev->request_queue->queuedata = sdev;
 		scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
 		scsi_build_commandblocks(sdev);
@@ -488,13 +509,12 @@
 	}
 out_bail:
 	printk(ALLOC_FAILURE_MSG, __FUNCTION__);
-	if(q && sdev->request_queue) {
+	if (q && sdev->request_queue) {
 		*q = sdev->request_queue;
 		sdev->request_queue = NULL;
-	} else if(sdev->request_queue) {
-		blk_cleanup_queue(sdev->request_queue);
-		kfree(sdev->request_queue);
-	}
+	} else if (sdev->request_queue)
+		scsi_free_queue(sdev->request_queue);
+
 	scsi_release_commandblocks(sdev);
 	kfree(sdev);
 	return NULL;
@@ -513,14 +533,12 @@
 	list_del(&sdev->siblings);
 	list_del(&sdev->same_target_siblings);
 
-	if(sdev->request_queue != NULL) {
-		blk_cleanup_queue(sdev->request_queue);
-		kfree(sdev->request_queue);
-	}
+	if (sdev->request_queue)
+		scsi_free_queue(sdev->request_queue);
 	scsi_release_commandblocks(sdev);
 	if (sdev->host->hostt->slave_destroy)
 		sdev->host->hostt->slave_destroy(sdev);
-	if (sdev->inquiry != NULL)
+	if (sdev->inquiry)
 		kfree(sdev->inquiry);
 	kfree(sdev);
 }
@@ -1946,10 +1964,9 @@
 			scsi_scan_target(shost, &q, channel, order_id);
 		}
 	}
-	if(q) {
-		blk_cleanup_queue(q);
-		kfree(q);
-	}
+
+	if (q)
+		scsi_free_queue(q);
 }
 
 void scsi_forget_host(struct Scsi_Host *shost)
--- 1.23/drivers/scsi/scsi_syms.c	Thu Nov 28 09:09:53 2002
+++ edited/drivers/scsi/scsi_syms.c	Sat Dec 21 17:52:49 2002
@@ -98,6 +98,11 @@
 EXPORT_SYMBOL(scsi_device_types);
 
 /*
+ * This is for st to find the bounce limit
+ */
+EXPORT_SYMBOL(scsi_calculate_bounce_limit);
+
+/*
  * Externalize timers so that HBAs can safely start/restart commands.
  */
 extern void scsi_add_timer(Scsi_Cmnd *, int, void ((*) (Scsi_Cmnd *)));
--- 1.51/drivers/scsi/st.c	Mon Dec 16 10:55:37 2002
+++ edited/drivers/scsi/st.c	Sat Dec 21 16:53:05 2002
@@ -3764,21 +3764,9 @@
 	tpnt->nbr_partitions = 0;
 	tpnt->timeout = ST_TIMEOUT;
 	tpnt->long_timeout = ST_LONG_TIMEOUT;
-
 	tpnt->try_dio = try_direct_io && !SDp->host->unchecked_isa_dma;
-	bounce_limit = BLK_BOUNCE_HIGH; /* Borrowed from scsi_merge.c */
-	if (SDp->host->highmem_io) {
-		struct device *dev = scsi_get_device(SDp->host);
-		if (!PCI_DMA_BUS_IS_PHYS)
-			/* Platforms with virtual-DMA translation
-			 * hardware have no practical limit.
-			 */
-			bounce_limit = BLK_BOUNCE_ANY;
-		else if (dev && dev->dma_mask)
-			bounce_limit = *dev->dma_mask;
-	} else if (SDp->host->unchecked_isa_dma)
-		bounce_limit = BLK_BOUNCE_ISA;
-	bounce_limit >>= PAGE_SHIFT;
+
+	bounce_limit = scsi_calculate_bounce_limit(SDp->host) >> PAGE_SHIFT;
 	if (bounce_limit > ULONG_MAX)
 		bounce_limit = ULONG_MAX;
 	tpnt->max_pfn = bounce_limit;




-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2002-12-21 18:42 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-09 23:53 Aic7xxx v6.2.22 and Aic79xx v1.3.0Alpha2 Released Justin T. Gibbs
2002-12-10  0:12 ` Christoph Hellwig
2002-12-10  0:33   ` Justin T. Gibbs
2002-12-10 13:14     ` Christoph Hellwig
2002-12-10 16:02       ` James Bottomley
2002-12-10 20:03         ` Justin T. Gibbs
2002-12-10 20:58           ` James Bottomley
     [not found]         ` <20021211135855.A19325@infradead.org>
2002-12-11 15:18           ` Justin T. Gibbs
2002-12-11 15:39             ` Christoph Hellwig
2002-12-11 16:08               ` Justin T. Gibbs
2002-12-11 16:23                 ` Christoph Hellwig
2002-12-12  7:16                   ` Jens Axboe
2002-12-12 17:20                     ` Justin T. Gibbs
2002-12-12 17:38                       ` Jens Axboe
2002-12-13 21:06                         ` Christoph Hellwig
2002-12-14 10:42                           ` Jens Axboe
2002-12-11 17:06                 ` Alan Cox
2002-12-11 17:31               ` Justin T. Gibbs
2002-12-11 18:17                 ` Christoph Hellwig
2002-12-11 20:23                   ` Justin T. Gibbs
2002-12-12 20:20                   ` Doug Ledford
2002-12-12 20:39                     ` Christoph Hellwig
2002-12-12 21:06                     ` Justin T. Gibbs
2002-12-13 21:02                     ` Christoph Hellwig
2002-12-13 21:23                       ` Doug Ledford
2002-12-13 21:37                         ` Justin T. Gibbs
2002-12-13 21:51                         ` Christoph Hellwig
2002-12-13 22:52                           ` Doug Ledford
2002-12-13 23:08                             ` Justin T. Gibbs
2002-12-13 23:20                               ` Doug Ledford
2002-12-13 23:32                                 ` Justin T. Gibbs
2002-12-14 21:55               ` Gérard Roudier
2002-12-14 23:29                 ` Justin T. Gibbs
2002-12-19 18:56                   ` scsi_scan.c complaints Doug Ledford
2002-12-21  1:29                     ` Doug Ledford
2002-12-12  5:51         ` Aic7xxx v6.2.22 and Aic79xx v1.3.0Alpha2 Released Andrew Morton
2002-12-12 14:51           ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2002-12-21 18:42 scsi_scan.c complaints Christoph Hellwig

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