Skip to contentSkip to conversation

aic79xx: remove busyq

PATCH In review Jeff Garzik 4 participants 9 messages May 29, 2005 – Jun 14, 2005

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

PATCH 1/1 aic79xx: remove busyq

Can anyone with aic79xx hardware give me a simple "it works" or "this breaks things" answer, for the patch below?

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

 drivers/scsi/aic7xxx/aic79xx_core.c    |    1 
 drivers/scsi/aic7xxx/aic79xx_osm.c     |  822 +++++----------------------------
 drivers/scsi/aic7xxx/aic79xx_osm.h     |   24 
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |    6 
 drivers/scsi/aic7xxx/aic79xx_proc.c    |   12 
 include/linux/libata.h                 |    6 
 include/linux/pci.h                    |    5 
 7 files changed, 146 insertions(+), 730 deletions(-)
drivers/scsi/aic7xxx/aic79xx_core.c +0 -1
@@ -9039,7 +9039,6 @@ ahd_dump_card_state(struct ahd_softc *ah
 		ahd_outb(ahd, STACK, (ahd->saved_stack[i] >> 8) & 0xFF);
 	}
 	printf("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n");
-	ahd_platform_dump_card_state(ahd);
 	ahd_restore_modes(ahd, saved_modes);
 	if (paused == 0)
 		ahd_unpause(ahd);
drivers/scsi/aic7xxx/aic79xx_osm.c +140 -682

1,152 lines not on this page · raw message

drivers/scsi/aic7xxx/aic79xx_osm.h +1 -23
@@ -269,11 +269,7 @@ ahd_scb_timer_reset(struct scb *scb, u_i
 /***************************** SMP support ************************************/
 #include <linux/spinlock.h>
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) || defined(SCSI_HAS_HOST_LOCK))
 #define AHD_SCSI_HAS_HOST_LOCK 1
-#else
-#define AHD_SCSI_HAS_HOST_LOCK 0
-#endif
 
 #define AIC79XX_DRIVER_VERSION "1.3.11"
 
@@ -314,7 +310,7 @@ struct ahd_cmd {
  * after a successfully completed inquiry command to the target when
  * that inquiry data indicates a lun is present.
  */
-TAILQ_HEAD(ahd_busyq, ahd_cmd);
+
 typedef enum {
 	AHD_DEV_UNCONFIGURED	 = 0x01,
 	AHD_DEV_FREEZE_TIL_EMPTY = 0x02, /* Freeze queue until active == 0 */
@@ -329,7 +325,6 @@ typedef enum {
 struct ahd_linux_target;
 struct ahd_linux_device {
 	TAILQ_ENTRY(ahd_linux_device) links;
-	struct			ahd_busyq busyq;
 
 	/*
 	 * The number of transactions currently
@@ -470,18 +465,7 @@ struct ahd_linux_target {
  * manner and are allocated below 4GB, the number of S/G segments is
  * unrestricted.
  */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-/*
- * We dynamically adjust the number of segments in pre-2.5 kernels to
- * avoid fragmentation issues in the SCSI mid-layer's private memory
- * allocator.  See aic79xx_osm.c ahd_linux_size_nseg() for details.
- */
-extern u_int ahd_linux_nseg;
-#define	AHD_NSEG ahd_linux_nseg
-#define	AHD_LINUX_MIN_NSEG 64
-#else
 #define	AHD_NSEG 128
-#endif
 
 /*
  * Per-SCB OSM storage.
@@ -523,7 +507,6 @@ struct ahd_platform_data {
 	struct ahd_completeq	 completeq;
 
 	spinlock_t		 spin_lock;
-	struct tasklet_struct	 runq_tasklet;
 	u_int			 qfrozen;
 	pid_t			 dv_pid;
 	struct timer_list	 completeq_timer;
@@ -942,12 +925,8 @@ ahd_flush_device_writes(struct ahd_softc
 }
 
 /**************************** Proc FS Support *********************************/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-int	ahd_linux_proc_info(char *, char **, off_t, int, int, int);
-#else
 int	ahd_linux_proc_info(struct Scsi_Host *, char *, char **,
 			    off_t, int, int);
-#endif
 
 /*************************** Domain Validation ********************************/
 #define AHD_DV_CMD(cmd) ((cmd)->scsi_done == ahd_linux_dv_complete)
@@ -1134,7 +1113,6 @@ void	ahd_done(struct ahd_softc*, struct 
 void	ahd_send_async(struct ahd_softc *, char channel,
 		       u_int target, u_int lun, ac_code, void *);
 void	ahd_print_path(struct ahd_softc *, struct scb *);
-void	ahd_platform_dump_card_state(struct ahd_softc *ahd);
 
 #ifdef CONFIG_PCI
 #define AHD_PCI_CONFIG 1
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +0 -6
@@ -195,13 +195,7 @@ ahd_linux_pci_dev_probe(struct pci_dev *
 	}
 	pci_set_drvdata(pdev, ahd);
 	if (aic79xx_detect_complete) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 		ahd_linux_register_host(ahd, &aic79xx_driver_template);
-#else
-		printf("aic79xx: ignoring PCI device found after "
-		       "initialization\n");
-		return (-ENODEV);
-#endif
 	}
 	return (0);
 }
drivers/scsi/aic7xxx/aic79xx_proc.c +0 -12
@@ -278,13 +278,8 @@ done:
  * Return information to handle /proc support for the driver.
  */
 int
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-ahd_linux_proc_info(char *buffer, char **start, off_t offset,
-		    int length, int hostno, int inout)
-#else
 ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
 		    off_t offset, int length, int inout)
-#endif
 {
 	struct	ahd_softc *ahd;
 	struct	info_str info;
@@ -296,14 +291,7 @@ ahd_linux_proc_info(struct Scsi_Host *sh
 
 	retval = -EINVAL;
 	ahd_list_lock(&l);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	TAILQ_FOREACH(ahd, &ahd_tailq, links) {
-		if (ahd->platform_data->host->host_no == hostno)
-			break;
-	}
-#else
 	ahd = ahd_find_softc(*(struct ahd_softc **)shost->hostdata);
-#endif
 
 	if (ahd == NULL)
 		goto done;
include/linux/libata.h +0 -6
@@ -69,12 +69,6 @@
 /* defines only for the constants which don't work well as enums */
 #define ATA_TAG_POISON		0xfafbfcfdU
 
-/* move to PCI layer? */
-static inline struct device *pci_dev_to_dev(struct pci_dev *pdev)
-{
-	return &pdev->dev;
-}
-
 enum {
 	/* various global constants */
 	LIBATA_MAX_PRD		= ATA_MAX_PRD / 2,
include/linux/pci.h +5 -0
@@ -573,6 +573,11 @@ struct pci_dev {
 #define	to_pci_dev(n) container_of(n, struct pci_dev, dev)
 #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
 
+static inline struct device *pci_dev_to_dev(struct pci_dev *pdev)
+{
+	return &pdev->dev;
+}
+
 /*
  *  For PCI devices, the region numbers are assigned this way:
  *
#1 lore raw
Quoted 6 lines · Jeff Garzik

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

s/PF_FREEZE/PF_NOFREEZE/ to apply to recent ones.

Quoted 23 lines
drivers/scsi/aic7xxx/aic79xx_osm.c +1 -9
@@ -2478,18 +2045,10 @@ ahd_linux_dv_thread(void *data)
 	 * Complete thread creation.
 	 */
 	lock_kernel();
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,60)
-	/*
-	 * Don't care about any signals.
-	 */
-	siginitsetinv(&current->blocked, 0);
 
-	daemonize();
-	sprintf(current->comm, "ahd_dv_%d", ahd->unit);
-#else
 	daemonize("ahd_dv_%d", ahd->unit);
 	current->flags |= PF_FREEZE;
-#endif
+
 	unlock_kernel();
 
 	while (1) {
#2 lore raw
In reply to Jeff Garzik
Quoted 11 lines · Jeff Garzik

Can anyone with aic79xx hardware give me a simple "it works" or "this breaks things" answer, for the patch below?

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

Applied with even no offsets to -rc5-mm1. Booted and working fine:

before

/dev/sda:
Timing cached reads: 2744 MB in 2.00 seconds = 1370.15 MB/sec
Timing buffered disk reads: 158 MB in 3.00 seconds = 52.64 MB/sec

after

/dev/sda:
Timing cached reads: 3000 MB in 2.00 seconds = 1498.73 MB/sec
Timing buffered disk reads: 160 MB in 3.03 seconds = 52.85 MB/sec

so no loose.

Thanks.

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.11-jam20 (gcc 4.0.0 (4.0.0-3mdk for Mandriva Linux release 2006.0))

#3 lore raw
Quoted 9 lines · J.A. Magallon
Quoted 7 lines · Jeff Garzik

Can anyone with aic79xx hardware give me a simple "it works" or "this breaks things" answer, for the patch below?

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

Quoted 6 lines
Quoted 3 lines

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

Applied with even no offsets to -rc5-mm1. Booted and working fine:

Thanks a bunch!

Jeff

#4 lore raw
Quoted 10 lines · Jeff Garzik
Quoted 9 lines · J.A. Magallon
Quoted 7 lines · Jeff Garzik

Can anyone with aic79xx hardware give me a simple "it works" or "this breaks things" answer, for the patch below?

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

Applied with even no offsets to -rc5-mm1. Booted and working fine:

Thanks a bunch!

Ooops, I forgot...

CC drivers/scsi/aic7xxx/aic7xxx_osm_pci.o
drivers/scsi/aic7xxx/aic7xxx_osm.c: In function 'ahc_linux_register_host':
drivers/scsi/aic7xxx/aic7xxx_osm.c:1205: warning: ignoring return value of 'scsi_add_host', declared with attribute warn_unused_result

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.11-jam20 (gcc 4.0.0 (4.0.0-3mdk for Mandriva Linux release 2006.0))

#5 lore raw
Quoted 25 lines · J.A. Magallon
Quoted 12 lines · Jeff Garzik
Quoted 10 lines · J.A. Magallon
Quoted 7 lines · Jeff Garzik

Can anyone with aic79xx hardware give me a simple "it works" or "this breaks things" answer, for the patch below?

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

Applied with even no offsets to -rc5-mm1. Booted and working fine:

Thanks a bunch!

Quoted 6 lines

Ooops, I forgot...

CC drivers/scsi/aic7xxx/aic7xxx_osm_pci.o
drivers/scsi/aic7xxx/aic7xxx_osm.c: In function 'ahc_linux_register_host':
drivers/scsi/aic7xxx/aic7xxx_osm.c:1205: warning: ignoring return value of 'scsi_add_host', declared with attribute warn_unused_result

Yeah, that was there prior to my patch. We'll get it fixed up eventually.

Jeff

#8 lore raw
In reply to Jeff Garzik
Quoted 10 lines · Jeff Garzik

Can anyone with aic79xx hardware give me a simple "it works" or "this breaks things" answer, for the patch below?

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

Hmm. Does not quite work here:

scsi0: Starting DV
scsi0 : Adaptec AIC79XX PCI-X SCSI HBA DRIVER, Rev 1.3.11

        <Adaptec 29320 Ultra320 SCSI adapter>
        aic7902: Ultra320 Wide Channel A, SCSI Id=7, PCI 33 or 66Mhz,

512 SCBs

In DV Thread
scsi0: Beginning Domain Validation
scsi0:A:0:0: Performing DV
scsi0:2223: Going from state 0 to state 1
scsi0:A:0:0: Sending INQ
scsi0: Timeout while doing DV command 12.

And from there all hell breaks loose.

It looks as if it simply refuses to send any commands ... Investigating.

Cheers,

Hannes

Signature · 8 lines
Dr. Hannes Reinecke			[email protected]
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw
In reply to Jeff Garzik
Quoted 10 lines · Jeff Garzik
Quoted 9 lines · J.A. Magallon
Quoted 7 lines · Jeff Garzik

Can anyone with aic79xx hardware give me a simple "it works" or "this breaks things" answer, for the patch below?

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

Applied with even no offsets to -rc5-mm1. Booted and working fine:

Thanks a bunch!

Oops, don't be so happy.
Following the other aic thread, I realized I applied the patch but booted on an U160 box :).

Will try shortly on a real 320.. sorry.

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.11-jam25 (gcc 4.0.0 (4.0.0-3mdk for Mandriva Linux release 2006.0))

#7 lore raw
Quoted 19 lines · J.A. Magallon
Quoted 17 lines · Jeff Garzik
Quoted 15 lines · J.A. Magallon
Quoted 10 lines · Jeff Garzik

Can anyone with aic79xx hardware give me a simple "it works" or "this breaks things" answer, for the patch below?

This changes the aic79xx driver to use the standard Linux SCSI queueing code, rather than its own. After applying this patch, NO behavior changes should be seen.

The patch is against 2.6.12-rc5, but probably applies OK to recent 2.6.x kernels.

Applied with even no offsets to -rc5-mm1. Booted and working fine:

Quoted 9 lines
Quoted 2 lines

Thanks a bunch!

Oops, don't be so happy.
Following the other aic thread, I realized I applied the patch but booted on an U160 box :).

Will try shortly on a real 320.. sorry.

Bad news, it just hangs forever after detecting the first SCSI disk. No sysrq-p, sysrq-t, nothing.

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.11-jam25 (gcc 4.0.0 (4.0.0-3mdk for Mandriva Linux release 2006.0))