aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-06-28 10:49:44 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-07-11 13:43:09 -0400
commitdfd287f6ee9be1e3ae8fe1160c185aac6ca83c6a (patch)
tree1fbe2c728b84fad009b34693b1b0797e79eca90d /drivers/scsi/aic7xxx
parent7f602c53939fdb1bca12151a28f9b90cde046fb1 (diff)
[SCSI] aic7xxx: sane pci probing
always probe in bus order, avoid any reordering Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic7xxx')
-rw-r--r--drivers/scsi/aic7xxx/aic7770_osm.c3
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c75
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.h1
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm_pci.c3
4 files changed, 22 insertions, 60 deletions
diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c
index d4ed5e9f830a..70c5fb59c9ea 100644
--- a/drivers/scsi/aic7xxx/aic7770_osm.c
+++ b/drivers/scsi/aic7xxx/aic7770_osm.c
@@ -102,8 +102,7 @@ aic7770_probe(struct device *dev)
102 102
103 dev_set_drvdata(dev, ahc); 103 dev_set_drvdata(dev, ahc);
104 104
105 if (aic7xxx_detect_complete) 105 error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
106 error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
107 return (error); 106 return (error);
108} 107}
109 108
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index cf37e8c07601..f94a67be0be4 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -338,13 +338,6 @@ static uint32_t aic7xxx_pci_parity = ~0;
338uint32_t aic7xxx_allow_memio = ~0; 338uint32_t aic7xxx_allow_memio = ~0;
339 339
340/* 340/*
341 * aic7xxx_detect() has been run, so register all device arrivals
342 * immediately with the system rather than deferring to the sorted
343 * attachment performed by aic7xxx_detect().
344 */
345int aic7xxx_detect_complete;
346
347/*
348 * So that we can set how long each device is given as a selection timeout. 341 * So that we can set how long each device is given as a selection timeout.
349 * The table of values goes like this: 342 * The table of values goes like this:
350 * 0 - 256ms 343 * 0 - 256ms
@@ -476,48 +469,6 @@ ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
476} 469}
477 470
478/* 471/*
479 * Try to detect an Adaptec 7XXX controller.
480 */
481static int
482ahc_linux_detect(struct scsi_host_template *template)
483{
484 struct ahc_softc *ahc;
485 int found = 0;
486
487 /*
488 * If we've been passed any parameters, process them now.
489 */
490 if (aic7xxx)
491 aic7xxx_setup(aic7xxx);
492
493 template->proc_name = "aic7xxx";
494
495 /*
496 * Initialize our softc list lock prior to
497 * probing for any adapters.
498 */
499 ahc_list_lockinit();
500
501 found = ahc_linux_pci_init();
502 if (!ahc_linux_eisa_init())
503 found++;
504
505 /*
506 * Register with the SCSI layer all
507 * controllers we've found.
508 */
509 TAILQ_FOREACH(ahc, &ahc_tailq, links) {
510
511 if (ahc_linux_register_host(ahc, template) == 0)
512 found++;
513 }
514
515 aic7xxx_detect_complete++;
516
517 return (found);
518}
519
520/*
521 * Return a string describing the driver. 472 * Return a string describing the driver.
522 */ 473 */
523static const char * 474static const char *
@@ -848,6 +799,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd)
848struct scsi_host_template aic7xxx_driver_template = { 799struct scsi_host_template aic7xxx_driver_template = {
849 .module = THIS_MODULE, 800 .module = THIS_MODULE,
850 .name = "aic7xxx", 801 .name = "aic7xxx",
802 .proc_name = "aic7xxx",
851 .proc_info = ahc_linux_proc_info, 803 .proc_info = ahc_linux_proc_info,
852 .info = ahc_linux_info, 804 .info = ahc_linux_info,
853 .queuecommand = ahc_linux_queue, 805 .queuecommand = ahc_linux_queue,
@@ -2717,18 +2669,31 @@ static struct spi_function_template ahc_linux_transport_functions = {
2717static int __init 2669static int __init
2718ahc_linux_init(void) 2670ahc_linux_init(void)
2719{ 2671{
2720 ahc_linux_transport_template = spi_attach_transport(&ahc_linux_transport_functions); 2672 /*
2673 * If we've been passed any parameters, process them now.
2674 */
2675 if (aic7xxx)
2676 aic7xxx_setup(aic7xxx);
2677
2678 ahc_linux_transport_template =
2679 spi_attach_transport(&ahc_linux_transport_functions);
2721 if (!ahc_linux_transport_template) 2680 if (!ahc_linux_transport_template)
2722 return -ENODEV; 2681 return -ENODEV;
2682
2723 scsi_transport_reserve_target(ahc_linux_transport_template, 2683 scsi_transport_reserve_target(ahc_linux_transport_template,
2724 sizeof(struct ahc_linux_target)); 2684 sizeof(struct ahc_linux_target));
2725 scsi_transport_reserve_device(ahc_linux_transport_template, 2685 scsi_transport_reserve_device(ahc_linux_transport_template,
2726 sizeof(struct ahc_linux_device)); 2686 sizeof(struct ahc_linux_device));
2727 if (ahc_linux_detect(&aic7xxx_driver_template)) 2687
2728 return 0; 2688 /*
2729 spi_release_transport(ahc_linux_transport_template); 2689 * Initialize our softc list lock prior to
2730 ahc_linux_exit(); 2690 * probing for any adapters.
2731 return -ENODEV; 2691 */
2692 ahc_list_lockinit();
2693
2694 ahc_linux_pci_init();
2695 ahc_linux_eisa_init();
2696 return 0;
2732} 2697}
2733 2698
2734static void 2699static void
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 8ffe2d3e1d95..5c0c9f9725b2 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;
132/************************* Configuration Data *********************************/ 132/************************* Configuration Data *********************************/
133extern u_int aic7xxx_no_probe; 133extern u_int aic7xxx_no_probe;
134extern u_int aic7xxx_allow_memio; 134extern u_int aic7xxx_allow_memio;
135extern int aic7xxx_detect_complete;
136extern struct scsi_host_template aic7xxx_driver_template; 135extern struct scsi_host_template aic7xxx_driver_template;
137 136
138/***************************** Bus Space/DMA **********************************/ 137/***************************** Bus Space/DMA **********************************/
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index 89d737ee551a..45ad438c9943 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)
208 return (-error); 208 return (-error);
209 } 209 }
210 pci_set_drvdata(pdev, ahc); 210 pci_set_drvdata(pdev, ahc);
211 if (aic7xxx_detect_complete) 211 ahc_linux_register_host(ahc, &aic7xxx_driver_template);
212 ahc_linux_register_host(ahc, &aic7xxx_driver_template);
213 return (0); 212 return (0);
214} 213}
215 214