From c0df28cfe012652160a530f9aa74b0a49c77eac5 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sat, 25 Jun 2005 16:23:44 -0500 Subject: [SCSI] aic7xxx: correct target valid check in aic7xxx_proc.c From: Andy Whitcroft Updated to remove the bogus translated target check. Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic7xxx_proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/aic7xxx') diff --git a/drivers/scsi/aic7xxx/aic7xxx_proc.c b/drivers/scsi/aic7xxx/aic7xxx_proc.c index ab4469d83fb..3802c91f0b0 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_proc.c +++ b/drivers/scsi/aic7xxx/aic7xxx_proc.c @@ -155,9 +155,9 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info, copy_info(info, "\tUser: "); ahc_format_transinfo(info, &tinfo->user); starget = ahc->platform_data->starget[target_offset]; - targ = scsi_transport_target_data(starget); - if (targ == NULL) + if (!starget) return; + targ = scsi_transport_target_data(starget); copy_info(info, "\tGoal: "); ahc_format_transinfo(info, &tinfo->goal); -- cgit v1.2.3-70-g09d2 From ace4e7185d565cab057139e8927659bd072bf25a Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sat, 2 Jul 2005 14:46:14 -0500 Subject: [SCSI] aic7xxx: fix boot hang with Fujitsu drives Apparently these are the only drives that try to negotiate IU and QAS at u160 speeds. The aic7xxx driver can't cope with this. The fix is to eliminate the IU and QAS setting routines. I've #if 0'd them out, just in case we ever get the sequencer documentation out of Adaptec, since we'd then be able to fix the driver. Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic7xxx_osm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/scsi/aic7xxx') diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index b89094db14c..cf37e8c0760 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -2633,6 +2633,11 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt) ahc_unlock(ahc, &flags); } +#if 0 +/* FIXME: This code claims to support IU and QAS. However, the actual + * sequencer code and aic7xxx_core have no support for these parameters and + * will get into a bad state if they're negotiated. Do not enable this + * unless you know what you're doing */ static void ahc_linux_set_qas(struct scsi_target *starget, int qas) { struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); @@ -2688,6 +2693,7 @@ static void ahc_linux_set_iu(struct scsi_target *starget, int iu) ppr_options, AHC_TRANS_GOAL, FALSE); ahc_unlock(ahc, &flags); } +#endif static struct spi_function_template ahc_linux_transport_functions = { .set_offset = ahc_linux_set_offset, @@ -2698,10 +2704,12 @@ static struct spi_function_template ahc_linux_transport_functions = { .show_width = 1, .set_dt = ahc_linux_set_dt, .show_dt = 1, +#if 0 .set_iu = ahc_linux_set_iu, .show_iu = 1, .set_qas = ahc_linux_set_qas, .show_qas = 1, +#endif }; -- cgit v1.2.3-70-g09d2 From cc33895abbba85668de11df2cd04d6faf0be43e1 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 9 Jul 2005 01:30:03 -0700 Subject: [SCSI] aic79xx: ahd_linux_dev_reset() cleanup Use the macros consistently in ahd_linux_dev_reset(). If ahd_linux_dev_reset() really can be called with local interrupts disabled then yuk. Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/aic7xxx') diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 5f526dd0aaa..6466a184a14 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -1553,7 +1553,7 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd) ahd_queue_scb(ahd, scb); scb->platform_data->flags |= AHD_SCB_UP_EH_SEM; - spin_unlock_irq(&ahd->platform_data->spin_lock); + ahd_unlock(ahd, &s); init_timer(&timer); timer.data = (u_long)scb; timer.expires = jiffies + (5 * HZ); @@ -1567,7 +1567,7 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd) printf("Timer Expired\n"); retval = FAILED; } - spin_lock_irq(&ahd->platform_data->spin_lock); + ahd_lock(ahd, &s); ahd_schedule_runq(ahd); ahd_linux_run_complete_queue(ahd); ahd_unlock(ahd, &s); -- cgit v1.2.3-70-g09d2 From dfd287f6ee9be1e3ae8fe1160c185aac6ca83c6a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 28 Jun 2005 16:49:44 +0200 Subject: [SCSI] aic7xxx: sane pci probing always probe in bus order, avoid any reordering Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic7770_osm.c | 3 +- drivers/scsi/aic7xxx/aic7xxx_osm.c | 75 +++++++++------------------------- drivers/scsi/aic7xxx/aic7xxx_osm.h | 1 - drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 3 +- 4 files changed, 22 insertions(+), 60 deletions(-) (limited to 'drivers/scsi/aic7xxx') diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c index d4ed5e9f830..70c5fb59c9e 100644 --- a/drivers/scsi/aic7xxx/aic7770_osm.c +++ b/drivers/scsi/aic7xxx/aic7770_osm.c @@ -102,8 +102,7 @@ aic7770_probe(struct device *dev) dev_set_drvdata(dev, ahc); - if (aic7xxx_detect_complete) - error = ahc_linux_register_host(ahc, &aic7xxx_driver_template); + error = ahc_linux_register_host(ahc, &aic7xxx_driver_template); return (error); } diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index cf37e8c0760..f94a67be0be 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -337,13 +337,6 @@ static uint32_t aic7xxx_pci_parity = ~0; */ uint32_t aic7xxx_allow_memio = ~0; -/* - * aic7xxx_detect() has been run, so register all device arrivals - * immediately with the system rather than deferring to the sorted - * attachment performed by aic7xxx_detect(). - */ -int aic7xxx_detect_complete; - /* * So that we can set how long each device is given as a selection timeout. * The table of values goes like this: @@ -475,48 +468,6 @@ ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb, return (consumed); } -/* - * Try to detect an Adaptec 7XXX controller. - */ -static int -ahc_linux_detect(struct scsi_host_template *template) -{ - struct ahc_softc *ahc; - int found = 0; - - /* - * If we've been passed any parameters, process them now. - */ - if (aic7xxx) - aic7xxx_setup(aic7xxx); - - template->proc_name = "aic7xxx"; - - /* - * Initialize our softc list lock prior to - * probing for any adapters. - */ - ahc_list_lockinit(); - - found = ahc_linux_pci_init(); - if (!ahc_linux_eisa_init()) - found++; - - /* - * Register with the SCSI layer all - * controllers we've found. - */ - TAILQ_FOREACH(ahc, &ahc_tailq, links) { - - if (ahc_linux_register_host(ahc, template) == 0) - found++; - } - - aic7xxx_detect_complete++; - - return (found); -} - /* * Return a string describing the driver. */ @@ -848,6 +799,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd) struct scsi_host_template aic7xxx_driver_template = { .module = THIS_MODULE, .name = "aic7xxx", + .proc_name = "aic7xxx", .proc_info = ahc_linux_proc_info, .info = ahc_linux_info, .queuecommand = ahc_linux_queue, @@ -2717,18 +2669,31 @@ static struct spi_function_template ahc_linux_transport_functions = { static int __init ahc_linux_init(void) { - ahc_linux_transport_template = spi_attach_transport(&ahc_linux_transport_functions); + /* + * If we've been passed any parameters, process them now. + */ + if (aic7xxx) + aic7xxx_setup(aic7xxx); + + ahc_linux_transport_template = + spi_attach_transport(&ahc_linux_transport_functions); if (!ahc_linux_transport_template) return -ENODEV; + scsi_transport_reserve_target(ahc_linux_transport_template, sizeof(struct ahc_linux_target)); scsi_transport_reserve_device(ahc_linux_transport_template, sizeof(struct ahc_linux_device)); - if (ahc_linux_detect(&aic7xxx_driver_template)) - return 0; - spi_release_transport(ahc_linux_transport_template); - ahc_linux_exit(); - return -ENODEV; + + /* + * Initialize our softc list lock prior to + * probing for any adapters. + */ + ahc_list_lockinit(); + + ahc_linux_pci_init(); + ahc_linux_eisa_init(); + return 0; } static void diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index 8ffe2d3e1d9..5c0c9f9725b 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h @@ -132,7 +132,6 @@ typedef struct scsi_cmnd *ahc_io_ctx_t; /************************* Configuration Data *********************************/ extern u_int aic7xxx_no_probe; extern u_int aic7xxx_allow_memio; -extern int aic7xxx_detect_complete; extern struct scsi_host_template aic7xxx_driver_template; /***************************** Bus Space/DMA **********************************/ diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 89d737ee551..45ad438c994 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c @@ -208,8 +208,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return (-error); } pci_set_drvdata(pdev, ahc); - if (aic7xxx_detect_complete) - ahc_linux_register_host(ahc, &aic7xxx_driver_template); + ahc_linux_register_host(ahc, &aic7xxx_driver_template); return (0); } -- cgit v1.2.3-70-g09d2 From 2a40342e0e72a2ba89aaa9e6c9a9eceb04741b24 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 28 Jun 2005 16:50:40 +0200 Subject: [SCSI] aic7xxx: remove ahc_tailq now that we do normal PCI probing there's no need to keep a list of all HBAs. Rejections fixed up and Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic7770.c | 9 +- drivers/scsi/aic7xxx/aic7xxx.h | 7 -- drivers/scsi/aic7xxx/aic7xxx_core.c | 59 ------------- drivers/scsi/aic7xxx/aic7xxx_osm.c | 152 +-------------------------------- drivers/scsi/aic7xxx/aic7xxx_osm.h | 28 ------ drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 4 - drivers/scsi/aic7xxx/aic7xxx_pci.c | 8 +- 7 files changed, 6 insertions(+), 261 deletions(-) (limited to 'drivers/scsi/aic7xxx') diff --git a/drivers/scsi/aic7xxx/aic7770.c b/drivers/scsi/aic7xxx/aic7770.c index 92703bb3598..00f3bd1e181 100644 --- a/drivers/scsi/aic7xxx/aic7770.c +++ b/drivers/scsi/aic7xxx/aic7770.c @@ -254,19 +254,12 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io) if (error != 0) return (error); - ahc_list_lock(&l); - /* - * Link this softc in with all other ahc instances. - */ - ahc_softc_insert(ahc); + ahc->init_level++; /* * Enable the board's BUS drivers */ ahc_outb(ahc, BCTL, ENABLE); - - ahc_list_unlock(&l); - return (0); } diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h index 0948d50ae75..088cbc23743 100644 --- a/drivers/scsi/aic7xxx/aic7xxx.h +++ b/drivers/scsi/aic7xxx/aic7xxx.h @@ -1023,9 +1023,6 @@ struct ahc_softc { struct cs *critical_sections; u_int num_critical_sections; - /* Links for chaining softcs */ - TAILQ_ENTRY(ahc_softc) links; - /* Channel Names ('A', 'B', etc.) */ char channel; char channel_b; @@ -1110,9 +1107,6 @@ struct ahc_softc { uint16_t user_tagenable;/* Tagged Queuing allowed */ }; -TAILQ_HEAD(ahc_softc_tailq, ahc_softc); -extern struct ahc_softc_tailq ahc_tailq; - /************************ Active Device Information ***************************/ typedef enum { ROLE_UNKNOWN, @@ -1198,7 +1192,6 @@ void ahc_intr_enable(struct ahc_softc *ahc, int enable); void ahc_pause_and_flushwork(struct ahc_softc *ahc); int ahc_suspend(struct ahc_softc *ahc); int ahc_resume(struct ahc_softc *ahc); -void ahc_softc_insert(struct ahc_softc *); void ahc_set_unit(struct ahc_softc *, int); void ahc_set_name(struct ahc_softc *, char *); void ahc_alloc_scbs(struct ahc_softc *ahc); diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index 8a2bb6f8d77..7bc01e41bcc 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c @@ -52,9 +52,6 @@ #include #endif -/****************************** Softc Data ************************************/ -struct ahc_softc_tailq ahc_tailq = TAILQ_HEAD_INITIALIZER(ahc_tailq); - /***************************** Lookup Tables **********************************/ char *ahc_chip_names[] = { @@ -3878,62 +3875,6 @@ ahc_softc_init(struct ahc_softc *ahc) return (0); } -void -ahc_softc_insert(struct ahc_softc *ahc) -{ - struct ahc_softc *list_ahc; - -#if AHC_PCI_CONFIG > 0 - /* - * Second Function PCI devices need to inherit some - * settings from function 0. - */ - if ((ahc->chip & AHC_BUS_MASK) == AHC_PCI - && (ahc->features & AHC_MULTI_FUNC) != 0) { - TAILQ_FOREACH(list_ahc, &ahc_tailq, links) { - ahc_dev_softc_t list_pci; - ahc_dev_softc_t pci; - - list_pci = list_ahc->dev_softc; - pci = ahc->dev_softc; - if (ahc_get_pci_slot(list_pci) == ahc_get_pci_slot(pci) - && ahc_get_pci_bus(list_pci) == ahc_get_pci_bus(pci)) { - struct ahc_softc *master; - struct ahc_softc *slave; - - if (ahc_get_pci_function(list_pci) == 0) { - master = list_ahc; - slave = ahc; - } else { - master = ahc; - slave = list_ahc; - } - slave->flags &= ~AHC_BIOS_ENABLED; - slave->flags |= - master->flags & AHC_BIOS_ENABLED; - slave->flags &= ~AHC_PRIMARY_CHANNEL; - slave->flags |= - master->flags & AHC_PRIMARY_CHANNEL; - break; - } - } - } -#endif - - /* - * Insertion sort into our list of softcs. - */ - list_ahc = TAILQ_FIRST(&ahc_tailq); - while (list_ahc != NULL - && ahc_softc_comp(ahc, list_ahc) <= 0) - list_ahc = TAILQ_NEXT(list_ahc, links); - if (list_ahc != NULL) - TAILQ_INSERT_BEFORE(list_ahc, ahc, links); - else - TAILQ_INSERT_TAIL(&ahc_tailq, ahc, links); - ahc->init_level++; -} - void ahc_set_unit(struct ahc_softc *ahc, int unit) { diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index f94a67be0be..116d0f51ca2 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -136,10 +136,6 @@ static struct scsi_transport_template *ahc_linux_transport_template = NULL; #include /* For block_size() */ #include /* For ssleep/msleep */ -/* - * Lock protecting manipulation of the ahc softc list. - */ -spinlock_t ahc_list_spinlock; /* * Set this to the delay in seconds after SCSI bus reset. @@ -291,25 +287,6 @@ ahc_print_path(struct ahc_softc *ahc, struct scb *scb) */ static uint32_t aic7xxx_no_reset; -/* - * Certain PCI motherboards will scan PCI devices from highest to lowest, - * others scan from lowest to highest, and they tend to do all kinds of - * strange things when they come into contact with PCI bridge chips. The - * net result of all this is that the PCI card that is actually used to boot - * the machine is very hard to detect. Most motherboards go from lowest - * PCI slot number to highest, and the first SCSI controller found is the - * one you boot from. The only exceptions to this are when a controller - * has its BIOS disabled. So, we by default sort all of our SCSI controllers - * from lowest PCI slot number to highest PCI slot number. We also force - * all controllers with their BIOS disabled to the end of the list. This - * works on *almost* all computers. Where it doesn't work, we have this - * option. Setting this option to non-0 will reverse the order of the sort - * to highest first, then lowest, but will still leave cards with their BIOS - * disabled at the very end. That should fix everyone up unless there are - * really strange cirumstances. - */ -static uint32_t aic7xxx_reverse_scan; - /* * Should we force EXTENDED translation on a controller. * 0 == Use whatever is in the SEEPROM or default to off @@ -416,7 +393,9 @@ static int ahc_linux_run_command(struct ahc_softc*, static void ahc_linux_setup_tag_info_global(char *p); static aic_option_callback_t ahc_linux_setup_tag_info; static int aic7xxx_setup(char *s); -static int ahc_linux_next_unit(void); + +static int ahc_linux_unit; + /********************************* Inlines ************************************/ static __inline void ahc_linux_unmap_scb(struct ahc_softc*, struct scb*); @@ -911,99 +890,6 @@ ahc_dmamap_unload(struct ahc_softc *ahc, bus_dma_tag_t dmat, bus_dmamap_t map) return (0); } -/********************* Platform Dependent Functions ***************************/ -/* - * Compare "left hand" softc with "right hand" softc, returning: - * < 0 - lahc has a lower priority than rahc - * 0 - Softcs are equal - * > 0 - lahc has a higher priority than rahc - */ -int -ahc_softc_comp(struct ahc_softc *lahc, struct ahc_softc *rahc) -{ - int value; - int rvalue; - int lvalue; - - /* - * Under Linux, cards are ordered as follows: - * 1) VLB/EISA BIOS enabled devices sorted by BIOS address. - * 2) PCI devices with BIOS enabled sorted by bus/slot/func. - * 3) All remaining VLB/EISA devices sorted by ioport. - * 4) All remaining PCI devices sorted by bus/slot/func. - */ - value = (lahc->flags & AHC_BIOS_ENABLED) - - (rahc->flags & AHC_BIOS_ENABLED); - if (value != 0) - /* Controllers with BIOS enabled have a *higher* priority */ - return (value); - - /* - * Same BIOS setting, now sort based on bus type. - * EISA and VL controllers sort together. EISA/VL - * have higher priority than PCI. - */ - rvalue = (rahc->chip & AHC_BUS_MASK); - if (rvalue == AHC_VL) - rvalue = AHC_EISA; - lvalue = (lahc->chip & AHC_BUS_MASK); - if (lvalue == AHC_VL) - lvalue = AHC_EISA; - value = rvalue - lvalue; - if (value != 0) - return (value); - - /* Still equal. Sort by BIOS address, ioport, or bus/slot/func. */ - switch (rvalue) { -#ifdef CONFIG_PCI - case AHC_PCI: - { - char primary_channel; - - if (aic7xxx_reverse_scan != 0) - value = ahc_get_pci_bus(lahc->dev_softc) - - ahc_get_pci_bus(rahc->dev_softc); - else - value = ahc_get_pci_bus(rahc->dev_softc) - - ahc_get_pci_bus(lahc->dev_softc); - if (value != 0) - break; - if (aic7xxx_reverse_scan != 0) - value = ahc_get_pci_slot(lahc->dev_softc) - - ahc_get_pci_slot(rahc->dev_softc); - else - value = ahc_get_pci_slot(rahc->dev_softc) - - ahc_get_pci_slot(lahc->dev_softc); - if (value != 0) - break; - /* - * On multi-function devices, the user can choose - * to have function 1 probed before function 0. - * Give whichever channel is the primary channel - * the highest priority. - */ - primary_channel = (lahc->flags & AHC_PRIMARY_CHANNEL) + 'A'; - value = -1; - if (lahc->channel == primary_channel) - value = 1; - break; - } -#endif - case AHC_EISA: - if ((rahc->flags & AHC_BIOS_ENABLED) != 0) { - value = rahc->platform_data->bios_address - - lahc->platform_data->bios_address; - } else { - value = rahc->bsh.ioport - - lahc->bsh.ioport; - } - break; - default: - panic("ahc_softc_sort: invalid bus type"); - } - return (value); -} - static void ahc_linux_setup_tag_info_global(char *p) { @@ -1055,7 +941,6 @@ aic7xxx_setup(char *s) #ifdef AHC_DEBUG { "debug", &ahc_debug }, #endif - { "reverse_scan", &aic7xxx_reverse_scan }, { "periodic_otag", &aic7xxx_periodic_otag }, { "pci_parity", &aic7xxx_pci_parity }, { "seltime", &aic7xxx_seltime }, @@ -1130,7 +1015,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa host->max_lun = AHC_NUM_LUNS; host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0; host->sg_tablesize = AHC_NSEG; - ahc_set_unit(ahc, ahc_linux_next_unit()); + ahc_set_unit(ahc, ahc_linux_unit++); sprintf(buf, "scsi%d", host->host_no); new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); if (new_name != NULL) { @@ -1158,29 +1043,6 @@ ahc_linux_get_memsize(void) return ((uint64_t)si.totalram << PAGE_SHIFT); } -/* - * Find the smallest available unit number to use - * for a new device. We don't just use a static - * count to handle the "repeated hot-(un)plug" - * scenario. - */ -static int -ahc_linux_next_unit(void) -{ - struct ahc_softc *ahc; - int unit; - - unit = 0; -retry: - TAILQ_FOREACH(ahc, &ahc_tailq, links) { - if (ahc->unit == unit) { - unit++; - goto retry; - } - } - return (unit); -} - /* * Place the SCSI bus into a known state by either resetting it, * or forcing transfer negotiations on the next command to any @@ -2685,12 +2547,6 @@ ahc_linux_init(void) scsi_transport_reserve_device(ahc_linux_transport_template, sizeof(struct ahc_linux_device)); - /* - * Initialize our softc list lock prior to - * probing for any adapters. - */ - ahc_list_lockinit(); - ahc_linux_pci_init(); ahc_linux_eisa_init(); return 0; diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index 5c0c9f9725b..0e47ac21754 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h @@ -509,15 +509,6 @@ void ahc_format_transinfo(struct info_str *info, /******************************** Locking *************************************/ /* Lock protecting internal data structures */ -static __inline void ahc_lockinit(struct ahc_softc *); -static __inline void ahc_lock(struct ahc_softc *, unsigned long *flags); -static __inline void ahc_unlock(struct ahc_softc *, unsigned long *flags); - -/* Lock held during ahc_list manipulation and ahc softc frees */ -extern spinlock_t ahc_list_spinlock; -static __inline void ahc_list_lockinit(void); -static __inline void ahc_list_lock(unsigned long *flags); -static __inline void ahc_list_unlock(unsigned long *flags); static __inline void ahc_lockinit(struct ahc_softc *ahc) @@ -537,24 +528,6 @@ ahc_unlock(struct ahc_softc *ahc, unsigned long *flags) spin_unlock_irqrestore(&ahc->platform_data->spin_lock, *flags); } -static __inline void -ahc_list_lockinit(void) -{ - spin_lock_init(&ahc_list_spinlock); -} - -static __inline void -ahc_list_lock(unsigned long *flags) -{ - spin_lock_irqsave(&ahc_list_spinlock, *flags); -} - -static __inline void -ahc_list_unlock(unsigned long *flags) -{ - spin_unlock_irqrestore(&ahc_list_spinlock, *flags); -} - /******************************* PCI Definitions ******************************/ /* * PCIM_xxx: mask to locate subfield in register @@ -891,7 +864,6 @@ int ahc_platform_abort_scbs(struct ahc_softc *ahc, int target, irqreturn_t ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs); void ahc_platform_flushwork(struct ahc_softc *ahc); -int ahc_softc_comp(struct ahc_softc *, struct ahc_softc *); void ahc_done(struct ahc_softc*, struct scb*); void ahc_send_async(struct ahc_softc *, char channel, u_int target, u_int lun, ac_code, void *); diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 45ad438c994..9d318ce2c99 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c @@ -143,10 +143,6 @@ ahc_linux_pci_dev_remove(struct pci_dev *pdev) struct ahc_softc *ahc = pci_get_drvdata(pdev); u_long s; - ahc_list_lock(&s); - TAILQ_REMOVE(&ahc_tailq, ahc, links); - ahc_list_unlock(&s); - ahc_lock(ahc, &s); ahc_intr_enable(ahc, FALSE); ahc_unlock(ahc, &s); diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c index 7ddcc97fb24..b3b2e2237eb 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c @@ -704,7 +704,6 @@ ahc_find_pci_device(ahc_dev_softc_t pci) int ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry) { - u_long l; u_int command; u_int our_id; u_int sxfrctl1; @@ -964,12 +963,7 @@ ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry) if (error != 0) return (error); - ahc_list_lock(&l); - /* - * Link this softc in with all other ahc instances. - */ - ahc_softc_insert(ahc); - ahc_list_unlock(&l); + ahc->init_level++; return (0); } -- cgit v1.2.3-70-g09d2