aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/Kconfig3
-rw-r--r--drivers/scsi/NCR5380.c2
-rw-r--r--drivers/scsi/aacraid/linit.c22
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_core.c2
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c9
-rw-r--r--drivers/scsi/arcmsr/arcmsr_attr.c18
-rw-r--r--drivers/scsi/atari_NCR5380.c44
-rw-r--r--drivers/scsi/esp_scsi.c1
-rw-r--r--drivers/scsi/ide-scsi.c2
-rw-r--r--drivers/scsi/ipr.c40
-rw-r--r--drivers/scsi/ips.c9
-rw-r--r--drivers/scsi/libsas/sas_expander.c17
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c14
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c5
-rw-r--r--drivers/scsi/nsp32.c10
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c56
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c2
-rw-r--r--drivers/scsi/scsi_scan.c9
19 files changed, 110 insertions, 157 deletions
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index ed0ca1508027..9d2119b53ac9 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -65,6 +65,7 @@ config BLK_DEV_SD
65 depends on SCSI 65 depends on SCSI
66 ---help--- 66 ---help---
67 If you want to use SCSI hard disks, Fibre Channel disks, 67 If you want to use SCSI hard disks, Fibre Channel disks,
68 Serial ATA (SATA) or Parallel ATA (PATA) hard disks,
68 USB storage or the SCSI or parallel port version of 69 USB storage or the SCSI or parallel port version of
69 the IOMEGA ZIP drive, say Y and read the SCSI-HOWTO, 70 the IOMEGA ZIP drive, say Y and read the SCSI-HOWTO,
70 the Disk-HOWTO and the Multi-Disk-HOWTO, available from 71 the Disk-HOWTO and the Multi-Disk-HOWTO, available from
@@ -1542,6 +1543,7 @@ source "drivers/scsi/arm/Kconfig"
1542config JAZZ_ESP 1543config JAZZ_ESP
1543 bool "MIPS JAZZ FAS216 SCSI support" 1544 bool "MIPS JAZZ FAS216 SCSI support"
1544 depends on MACH_JAZZ && SCSI 1545 depends on MACH_JAZZ && SCSI
1546 select SCSI_SPI_ATTRS
1545 help 1547 help
1546 This is the driver for the onboard SCSI host adapter of MIPS Magnum 1548 This is the driver for the onboard SCSI host adapter of MIPS Magnum
1547 4000, Acer PICA, Olivetti M700-10 and a few other identical OEM 1549 4000, Acer PICA, Olivetti M700-10 and a few other identical OEM
@@ -1766,6 +1768,7 @@ config SUN3X_ESP
1766config SCSI_SUNESP 1768config SCSI_SUNESP
1767 tristate "Sparc ESP Scsi Driver" 1769 tristate "Sparc ESP Scsi Driver"
1768 depends on SBUS && SCSI 1770 depends on SBUS && SCSI
1771 select SCSI_SPI_ATTRS
1769 help 1772 help
1770 This is the driver for the Sun ESP SCSI host adapter. The ESP 1773 This is the driver for the Sun ESP SCSI host adapter. The ESP
1771 chipset is present in most SPARC SBUS-based computers. 1774 chipset is present in most SPARC SBUS-based computers.
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 37de6b37b084..f8e449a98d29 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -2627,7 +2627,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2627#ifdef REAL_DMA 2627#ifdef REAL_DMA
2628static void NCR5380_dma_complete(NCR5380_instance * instance) { 2628static void NCR5380_dma_complete(NCR5380_instance * instance) {
2629 NCR5380_local_declare(); 2629 NCR5380_local_declare();
2630 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata * instance->hostdata); 2630 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
2631 int transferred; 2631 int transferred;
2632 NCR5380_setup(instance); 2632 NCR5380_setup(instance);
2633 2633
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 4fda01e97f46..d76e1a8cb93a 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -943,6 +943,14 @@ static struct scsi_host_template aac_driver_template = {
943 .emulated = 1, 943 .emulated = 1,
944}; 944};
945 945
946static void __aac_shutdown(struct aac_dev * aac)
947{
948 kthread_stop(aac->thread);
949 aac_send_shutdown(aac);
950 aac_adapter_disable_int(aac);
951 free_irq(aac->pdev->irq, aac);
952}
953
946static int __devinit aac_probe_one(struct pci_dev *pdev, 954static int __devinit aac_probe_one(struct pci_dev *pdev,
947 const struct pci_device_id *id) 955 const struct pci_device_id *id)
948{ 956{
@@ -1095,10 +1103,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1095 return 0; 1103 return 0;
1096 1104
1097 out_deinit: 1105 out_deinit:
1098 kthread_stop(aac->thread); 1106 __aac_shutdown(aac);
1099 aac_send_shutdown(aac);
1100 aac_adapter_disable_int(aac);
1101 free_irq(pdev->irq, aac);
1102 out_unmap: 1107 out_unmap:
1103 aac_fib_map_free(aac); 1108 aac_fib_map_free(aac);
1104 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); 1109 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
@@ -1118,7 +1123,8 @@ static void aac_shutdown(struct pci_dev *dev)
1118{ 1123{
1119 struct Scsi_Host *shost = pci_get_drvdata(dev); 1124 struct Scsi_Host *shost = pci_get_drvdata(dev);
1120 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; 1125 struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
1121 aac_send_shutdown(aac); 1126 scsi_block_requests(shost);
1127 __aac_shutdown(aac);
1122} 1128}
1123 1129
1124static void __devexit aac_remove_one(struct pci_dev *pdev) 1130static void __devexit aac_remove_one(struct pci_dev *pdev)
@@ -1128,16 +1134,12 @@ static void __devexit aac_remove_one(struct pci_dev *pdev)
1128 1134
1129 scsi_remove_host(shost); 1135 scsi_remove_host(shost);
1130 1136
1131 kthread_stop(aac->thread); 1137 __aac_shutdown(aac);
1132
1133 aac_send_shutdown(aac);
1134 aac_adapter_disable_int(aac);
1135 aac_fib_map_free(aac); 1138 aac_fib_map_free(aac);
1136 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, 1139 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
1137 aac->comm_phys); 1140 aac->comm_phys);
1138 kfree(aac->queues); 1141 kfree(aac->queues);
1139 1142
1140 free_irq(pdev->irq, aac);
1141 aac_adapter_ioremap(aac, 0); 1143 aac_adapter_ioremap(aac, 0);
1142 1144
1143 kfree(aac->fibs); 1145 kfree(aac->fibs);
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 9ddc6e4a74b0..05f692bd0adc 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -5180,7 +5180,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
5180 cur_lun = lun; 5180 cur_lun = lun;
5181 max_lun = lun; 5181 max_lun = lun;
5182 } 5182 }
5183 for (cur_lun <= max_lun; cur_lun++) { 5183 for (;cur_lun <= max_lun; cur_lun++) {
5184 struct ahd_tmode_lstate* lstate; 5184 struct ahd_tmode_lstate* lstate;
5185 5185
5186 lstate = tstate->enabled_luns[cur_lun]; 5186 lstate = tstate->enabled_luns[cur_lun];
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 27852b43b904..1c0d7578e791 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -223,13 +223,8 @@ static int __devinit asd_common_setup(struct asd_ha_struct *asd_ha)
223{ 223{
224 int err, i; 224 int err, i;
225 225
226 err = pci_read_config_byte(asd_ha->pcidev, PCI_REVISION_ID, 226 asd_ha->revision_id = asd_ha->pcidev->revision;
227 &asd_ha->revision_id); 227
228 if (err) {
229 asd_printk("couldn't read REVISION ID register of %s\n",
230 pci_name(asd_ha->pcidev));
231 goto Err;
232 }
233 err = -ENODEV; 228 err = -ENODEV;
234 if (asd_ha->revision_id < AIC9410_DEV_REV_B0) { 229 if (asd_ha->revision_id < AIC9410_DEV_REV_B0) {
235 asd_printk("%s is revision %s (%X), which is not supported\n", 230 asd_printk("%s is revision %s (%X), which is not supported\n",
diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c
index 03bfed61bffc..06c0dce3b839 100644
--- a/drivers/scsi/arcmsr/arcmsr_attr.c
+++ b/drivers/scsi/arcmsr/arcmsr_attr.c
@@ -59,8 +59,9 @@
59struct class_device_attribute *arcmsr_host_attrs[]; 59struct class_device_attribute *arcmsr_host_attrs[];
60 60
61static ssize_t 61static ssize_t
62arcmsr_sysfs_iop_message_read(struct kobject *kobj, char *buf, loff_t off, 62arcmsr_sysfs_iop_message_read(struct kobject *kobj,
63 size_t count) 63 struct bin_attribute *bin_attr,
64 char *buf, loff_t off, size_t count)
64{ 65{
65 struct class_device *cdev = container_of(kobj,struct class_device,kobj); 66 struct class_device *cdev = container_of(kobj,struct class_device,kobj);
66 struct Scsi_Host *host = class_to_shost(cdev); 67 struct Scsi_Host *host = class_to_shost(cdev);
@@ -105,8 +106,9 @@ arcmsr_sysfs_iop_message_read(struct kobject *kobj, char *buf, loff_t off,
105} 106}
106 107
107static ssize_t 108static ssize_t
108arcmsr_sysfs_iop_message_write(struct kobject *kobj, char *buf, loff_t off, 109arcmsr_sysfs_iop_message_write(struct kobject *kobj,
109 size_t count) 110 struct bin_attribute *bin_attr,
111 char *buf, loff_t off, size_t count)
110{ 112{
111 struct class_device *cdev = container_of(kobj,struct class_device,kobj); 113 struct class_device *cdev = container_of(kobj,struct class_device,kobj);
112 struct Scsi_Host *host = class_to_shost(cdev); 114 struct Scsi_Host *host = class_to_shost(cdev);
@@ -152,8 +154,9 @@ arcmsr_sysfs_iop_message_write(struct kobject *kobj, char *buf, loff_t off,
152} 154}
153 155
154static ssize_t 156static ssize_t
155arcmsr_sysfs_iop_message_clear(struct kobject *kobj, char *buf, loff_t off, 157arcmsr_sysfs_iop_message_clear(struct kobject *kobj,
156 size_t count) 158 struct bin_attribute *bin_attr,
159 char *buf, loff_t off, size_t count)
157{ 160{
158 struct class_device *cdev = container_of(kobj,struct class_device,kobj); 161 struct class_device *cdev = container_of(kobj,struct class_device,kobj);
159 struct Scsi_Host *host = class_to_shost(cdev); 162 struct Scsi_Host *host = class_to_shost(cdev);
@@ -188,7 +191,6 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = {
188 .attr = { 191 .attr = {
189 .name = "mu_read", 192 .name = "mu_read",
190 .mode = S_IRUSR , 193 .mode = S_IRUSR ,
191 .owner = THIS_MODULE,
192 }, 194 },
193 .size = 1032, 195 .size = 1032,
194 .read = arcmsr_sysfs_iop_message_read, 196 .read = arcmsr_sysfs_iop_message_read,
@@ -198,7 +200,6 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = {
198 .attr = { 200 .attr = {
199 .name = "mu_write", 201 .name = "mu_write",
200 .mode = S_IWUSR, 202 .mode = S_IWUSR,
201 .owner = THIS_MODULE,
202 }, 203 },
203 .size = 1032, 204 .size = 1032,
204 .write = arcmsr_sysfs_iop_message_write, 205 .write = arcmsr_sysfs_iop_message_write,
@@ -208,7 +209,6 @@ static struct bin_attribute arcmsr_sysfs_message_clear_attr = {
208 .attr = { 209 .attr = {
209 .name = "mu_clear", 210 .name = "mu_clear",
210 .mode = S_IWUSR, 211 .mode = S_IWUSR,
211 .owner = THIS_MODULE,
212 }, 212 },
213 .size = 1, 213 .size = 1,
214 .write = arcmsr_sysfs_iop_message_clear, 214 .write = arcmsr_sysfs_iop_message_clear,
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index eff846ae0aff..03dbe60c264a 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -894,45 +894,6 @@ static int NCR5380_init(struct Scsi_Host *instance, int flags)
894} 894}
895 895
896/* 896/*
897 * our own old-style timeout update
898 */
899/*
900 * The strategy is to cause the timer code to call scsi_times_out()
901 * when the soonest timeout is pending.
902 * The arguments are used when we are queueing a new command, because
903 * we do not want to subtract the time used from this time, but when we
904 * set the timer, we want to take this value into account.
905 */
906
907int atari_scsi_update_timeout(Scsi_Cmnd * SCset, int timeout)
908{
909 int rtn;
910
911 /*
912 * We are using the new error handling code to actually register/deregister
913 * timers for timeout.
914 */
915
916 if (!timer_pending(&SCset->eh_timeout))
917 rtn = 0;
918 else
919 rtn = SCset->eh_timeout.expires - jiffies;
920
921 if (timeout == 0) {
922 del_timer(&SCset->eh_timeout);
923 SCset->eh_timeout.data = (unsigned long)NULL;
924 SCset->eh_timeout.expires = 0;
925 } else {
926 if (SCset->eh_timeout.data != (unsigned long)NULL)
927 del_timer(&SCset->eh_timeout);
928 SCset->eh_timeout.data = (unsigned long)SCset;
929 SCset->eh_timeout.expires = jiffies + timeout;
930 add_timer(&SCset->eh_timeout);
931 }
932 return rtn;
933}
934
935/*
936 * Function : int NCR5380_queue_command (Scsi_Cmnd *cmd, 897 * Function : int NCR5380_queue_command (Scsi_Cmnd *cmd,
937 * void (*done)(Scsi_Cmnd *)) 898 * void (*done)(Scsi_Cmnd *))
938 * 899 *
@@ -956,7 +917,6 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
956 Scsi_Cmnd *tmp; 917 Scsi_Cmnd *tmp;
957 int oldto; 918 int oldto;
958 unsigned long flags; 919 unsigned long flags;
959 // extern int update_timeout(Scsi_Cmnd * SCset, int timeout);
960 920
961#if (NDEBUG & NDEBUG_NO_WRITE) 921#if (NDEBUG & NDEBUG_NO_WRITE)
962 switch (cmd->cmnd[0]) { 922 switch (cmd->cmnd[0]) {
@@ -1029,9 +989,9 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
1029 * alter queues and touch the lock. 989 * alter queues and touch the lock.
1030 */ 990 */
1031 if (!IS_A_TT()) { 991 if (!IS_A_TT()) {
1032 oldto = atari_scsi_update_timeout(cmd, 0); 992 /* perhaps stop command timer here */
1033 falcon_get_lock(); 993 falcon_get_lock();
1034 atari_scsi_update_timeout(cmd, oldto); 994 /* perhaps restart command timer here */
1035 } 995 }
1036 if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) { 996 if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
1037 LIST(cmd, hostdata->issue_queue); 997 LIST(cmd, hostdata->issue_queue);
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index c1d50e669c43..77b06a983fa7 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -2029,6 +2029,7 @@ static void esp_reset_cleanup(struct esp *esp)
2029 starget_for_each_device(tp->starget, NULL, 2029 starget_for_each_device(tp->starget, NULL,
2030 esp_clear_hold); 2030 esp_clear_hold);
2031 } 2031 }
2032 esp->flags &= ~ESP_FLAG_RESETTING;
2032} 2033}
2033 2034
2034/* Runs under host->lock */ 2035/* Runs under host->lock */
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 8263f752809d..bb90df8bdce4 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -463,7 +463,7 @@ static inline unsigned long get_timeout(idescsi_pc_t *pc)
463 463
464static int idescsi_expiry(ide_drive_t *drive) 464static int idescsi_expiry(ide_drive_t *drive)
465{ 465{
466 idescsi_scsi_t *scsi = drive->driver_data; 466 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
467 idescsi_pc_t *pc = scsi->pc; 467 idescsi_pc_t *pc = scsi->pc;
468 468
469#if IDESCSI_DEBUG_LOG 469#if IDESCSI_DEBUG_LOG
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 072f57715658..f142eafb6fc7 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2439,6 +2439,7 @@ restart:
2439/** 2439/**
2440 * ipr_read_trace - Dump the adapter trace 2440 * ipr_read_trace - Dump the adapter trace
2441 * @kobj: kobject struct 2441 * @kobj: kobject struct
2442 * @bin_attr: bin_attribute struct
2442 * @buf: buffer 2443 * @buf: buffer
2443 * @off: offset 2444 * @off: offset
2444 * @count: buffer size 2445 * @count: buffer size
@@ -2446,8 +2447,9 @@ restart:
2446 * Return value: 2447 * Return value:
2447 * number of bytes printed to buffer 2448 * number of bytes printed to buffer
2448 **/ 2449 **/
2449static ssize_t ipr_read_trace(struct kobject *kobj, char *buf, 2450static ssize_t ipr_read_trace(struct kobject *kobj,
2450 loff_t off, size_t count) 2451 struct bin_attribute *bin_attr,
2452 char *buf, loff_t off, size_t count)
2451{ 2453{
2452 struct class_device *cdev = container_of(kobj,struct class_device,kobj); 2454 struct class_device *cdev = container_of(kobj,struct class_device,kobj);
2453 struct Scsi_Host *shost = class_to_shost(cdev); 2455 struct Scsi_Host *shost = class_to_shost(cdev);
@@ -3140,6 +3142,7 @@ static struct class_device_attribute *ipr_ioa_attrs[] = {
3140/** 3142/**
3141 * ipr_read_dump - Dump the adapter 3143 * ipr_read_dump - Dump the adapter
3142 * @kobj: kobject struct 3144 * @kobj: kobject struct
3145 * @bin_attr: bin_attribute struct
3143 * @buf: buffer 3146 * @buf: buffer
3144 * @off: offset 3147 * @off: offset
3145 * @count: buffer size 3148 * @count: buffer size
@@ -3147,8 +3150,9 @@ static struct class_device_attribute *ipr_ioa_attrs[] = {
3147 * Return value: 3150 * Return value:
3148 * number of bytes printed to buffer 3151 * number of bytes printed to buffer
3149 **/ 3152 **/
3150static ssize_t ipr_read_dump(struct kobject *kobj, char *buf, 3153static ssize_t ipr_read_dump(struct kobject *kobj,
3151 loff_t off, size_t count) 3154 struct bin_attribute *bin_attr,
3155 char *buf, loff_t off, size_t count)
3152{ 3156{
3153 struct class_device *cdev = container_of(kobj,struct class_device,kobj); 3157 struct class_device *cdev = container_of(kobj,struct class_device,kobj);
3154 struct Scsi_Host *shost = class_to_shost(cdev); 3158 struct Scsi_Host *shost = class_to_shost(cdev);
@@ -3301,6 +3305,7 @@ static int ipr_free_dump(struct ipr_ioa_cfg *ioa_cfg)
3301/** 3305/**
3302 * ipr_write_dump - Setup dump state of adapter 3306 * ipr_write_dump - Setup dump state of adapter
3303 * @kobj: kobject struct 3307 * @kobj: kobject struct
3308 * @bin_attr: bin_attribute struct
3304 * @buf: buffer 3309 * @buf: buffer
3305 * @off: offset 3310 * @off: offset
3306 * @count: buffer size 3311 * @count: buffer size
@@ -3308,8 +3313,9 @@ static int ipr_free_dump(struct ipr_ioa_cfg *ioa_cfg)
3308 * Return value: 3313 * Return value:
3309 * number of bytes printed to buffer 3314 * number of bytes printed to buffer
3310 **/ 3315 **/
3311static ssize_t ipr_write_dump(struct kobject *kobj, char *buf, 3316static ssize_t ipr_write_dump(struct kobject *kobj,
3312 loff_t off, size_t count) 3317 struct bin_attribute *bin_attr,
3318 char *buf, loff_t off, size_t count)
3313{ 3319{
3314 struct class_device *cdev = container_of(kobj,struct class_device,kobj); 3320 struct class_device *cdev = container_of(kobj,struct class_device,kobj);
3315 struct Scsi_Host *shost = class_to_shost(cdev); 3321 struct Scsi_Host *shost = class_to_shost(cdev);
@@ -5303,18 +5309,12 @@ static const u16 ipr_blocked_processors[] = {
5303 **/ 5309 **/
5304static int ipr_invalid_adapter(struct ipr_ioa_cfg *ioa_cfg) 5310static int ipr_invalid_adapter(struct ipr_ioa_cfg *ioa_cfg)
5305{ 5311{
5306 u8 rev_id;
5307 int i; 5312 int i;
5308 5313
5309 if (ioa_cfg->type == 0x5702) { 5314 if ((ioa_cfg->type == 0x5702) && (ioa_cfg->pdev->revision < 4)) {
5310 if (pci_read_config_byte(ioa_cfg->pdev, PCI_REVISION_ID, 5315 for (i = 0; i < ARRAY_SIZE(ipr_blocked_processors); i++){
5311 &rev_id) == PCIBIOS_SUCCESSFUL) { 5316 if (__is_processor(ipr_blocked_processors[i]))
5312 if (rev_id < 4) { 5317 return 1;
5313 for (i = 0; i < ARRAY_SIZE(ipr_blocked_processors); i++){
5314 if (__is_processor(ipr_blocked_processors[i]))
5315 return 1;
5316 }
5317 }
5318 } 5318 }
5319 } 5319 }
5320 return 0; 5320 return 0;
@@ -7471,13 +7471,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
7471 else 7471 else
7472 ioa_cfg->transop_timeout = IPR_OPERATIONAL_TIMEOUT; 7472 ioa_cfg->transop_timeout = IPR_OPERATIONAL_TIMEOUT;
7473 7473
7474 rc = pci_read_config_byte(pdev, PCI_REVISION_ID, &ioa_cfg->revid); 7474 ioa_cfg->revid = pdev->revision;
7475
7476 if (rc != PCIBIOS_SUCCESSFUL) {
7477 dev_err(&pdev->dev, "Failed to read PCI revision ID\n");
7478 rc = -EIO;
7479 goto out_scsi_host_put;
7480 }
7481 7475
7482 ipr_regs_pci = pci_resource_start(pdev, 0); 7476 ipr_regs_pci = pci_resource_start(pdev, 0);
7483 7477
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index f9fce70f396a..9f8ed6b81576 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -6987,7 +6987,6 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr)
6987 uint32_t mem_addr; 6987 uint32_t mem_addr;
6988 uint32_t io_len; 6988 uint32_t io_len;
6989 uint32_t mem_len; 6989 uint32_t mem_len;
6990 uint8_t revision_id;
6991 uint8_t bus; 6990 uint8_t bus;
6992 uint8_t func; 6991 uint8_t func;
6993 uint8_t irq; 6992 uint8_t irq;
@@ -7066,12 +7065,6 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr)
7066 } 7065 }
7067 } 7066 }
7068 7067
7069 /* get the revision ID */
7070 if (pci_read_config_byte(pci_dev, PCI_REVISION_ID, &revision_id)) {
7071 IPS_PRINTK(KERN_WARNING, pci_dev, "Can't get revision id.\n");
7072 return -1;
7073 }
7074
7075 subdevice_id = pci_dev->subsystem_device; 7068 subdevice_id = pci_dev->subsystem_device;
7076 7069
7077 /* found a controller */ 7070 /* found a controller */
@@ -7097,7 +7090,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr)
7097 ha->mem_ptr = mem_ptr; 7090 ha->mem_ptr = mem_ptr;
7098 ha->ioremap_ptr = ioremap_ptr; 7091 ha->ioremap_ptr = ioremap_ptr;
7099 ha->host_num = (uint32_t) index; 7092 ha->host_num = (uint32_t) index;
7100 ha->revision_id = revision_id; 7093 ha->revision_id = pci_dev->revision;
7101 ha->slot_num = PCI_SLOT(pci_dev->devfn); 7094 ha->slot_num = PCI_SLOT(pci_dev->devfn);
7102 ha->device_id = pci_dev->device; 7095 ha->device_id = pci_dev->device;
7103 ha->subdevice_id = subdevice_id; 7096 ha->subdevice_id = subdevice_id;
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index e34442e405e8..23e90c5f8f35 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -38,8 +38,10 @@ static int sas_disable_routing(struct domain_device *dev, u8 *sas_addr);
38 38
39#if 0 39#if 0
40/* FIXME: smp needs to migrate into the sas class */ 40/* FIXME: smp needs to migrate into the sas class */
41static ssize_t smp_portal_read(struct kobject *, char *, loff_t, size_t); 41static ssize_t smp_portal_read(struct kobject *, struct bin_attribute *,
42static ssize_t smp_portal_write(struct kobject *, char *, loff_t, size_t); 42 char *, loff_t, size_t);
43static ssize_t smp_portal_write(struct kobject *, struct bin_attribute *,
44 char *, loff_t, size_t);
43#endif 45#endif
44 46
45/* ---------- SMP task management ---------- */ 47/* ---------- SMP task management ---------- */
@@ -1368,7 +1370,6 @@ static void sas_ex_smp_hook(struct domain_device *dev)
1368 memset(bin_attr, 0, sizeof(*bin_attr)); 1370 memset(bin_attr, 0, sizeof(*bin_attr));
1369 1371
1370 bin_attr->attr.name = SMP_BIN_ATTR_NAME; 1372 bin_attr->attr.name = SMP_BIN_ATTR_NAME;
1371 bin_attr->attr.owner = THIS_MODULE;
1372 bin_attr->attr.mode = 0600; 1373 bin_attr->attr.mode = 0600;
1373 1374
1374 bin_attr->size = 0; 1375 bin_attr->size = 0;
@@ -1846,8 +1847,9 @@ out:
1846#if 0 1847#if 0
1847/* ---------- SMP portal ---------- */ 1848/* ---------- SMP portal ---------- */
1848 1849
1849static ssize_t smp_portal_write(struct kobject *kobj, char *buf, loff_t offs, 1850static ssize_t smp_portal_write(struct kobject *kobj,
1850 size_t size) 1851 struct bin_attribute *bin_attr,
1852 char *buf, loff_t offs, size_t size)
1851{ 1853{
1852 struct domain_device *dev = to_dom_device(kobj); 1854 struct domain_device *dev = to_dom_device(kobj);
1853 struct expander_device *ex = &dev->ex_dev; 1855 struct expander_device *ex = &dev->ex_dev;
@@ -1873,8 +1875,9 @@ static ssize_t smp_portal_write(struct kobject *kobj, char *buf, loff_t offs,
1873 return size; 1875 return size;
1874} 1876}
1875 1877
1876static ssize_t smp_portal_read(struct kobject *kobj, char *buf, loff_t offs, 1878static ssize_t smp_portal_read(struct kobject *kobj,
1877 size_t size) 1879 struct bin_attribute *bin_attr,
1880 char *buf, loff_t offs, size_t size)
1878{ 1881{
1879 struct domain_device *dev = to_dom_device(kobj); 1882 struct domain_device *dev = to_dom_device(kobj);
1880 struct expander_device *ex = &dev->ex_dev; 1883 struct expander_device *ex = &dev->ex_dev;
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 6a2c1ac42442..860a52c090f4 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -1405,7 +1405,8 @@ struct class_device_attribute *lpfc_hba_attrs[] = {
1405}; 1405};
1406 1406
1407static ssize_t 1407static ssize_t
1408sysfs_ctlreg_write(struct kobject *kobj, char *buf, loff_t off, size_t count) 1408sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr,
1409 char *buf, loff_t off, size_t count)
1409{ 1410{
1410 size_t buf_off; 1411 size_t buf_off;
1411 struct class_device *cdev = container_of(kobj, struct class_device, 1412 struct class_device *cdev = container_of(kobj, struct class_device,
@@ -1437,7 +1438,8 @@ sysfs_ctlreg_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
1437} 1438}
1438 1439
1439static ssize_t 1440static ssize_t
1440sysfs_ctlreg_read(struct kobject *kobj, char *buf, loff_t off, size_t count) 1441sysfs_ctlreg_read(struct kobject *kobj, struct bin_attribute *bin_attr,
1442 char *buf, loff_t off, size_t count)
1441{ 1443{
1442 size_t buf_off; 1444 size_t buf_off;
1443 uint32_t * tmp_ptr; 1445 uint32_t * tmp_ptr;
@@ -1474,7 +1476,6 @@ static struct bin_attribute sysfs_ctlreg_attr = {
1474 .attr = { 1476 .attr = {
1475 .name = "ctlreg", 1477 .name = "ctlreg",
1476 .mode = S_IRUSR | S_IWUSR, 1478 .mode = S_IRUSR | S_IWUSR,
1477 .owner = THIS_MODULE,
1478 }, 1479 },
1479 .size = 256, 1480 .size = 256,
1480 .read = sysfs_ctlreg_read, 1481 .read = sysfs_ctlreg_read,
@@ -1496,7 +1497,8 @@ sysfs_mbox_idle(struct lpfc_hba *phba)
1496} 1497}
1497 1498
1498static ssize_t 1499static ssize_t
1499sysfs_mbox_write(struct kobject *kobj, char *buf, loff_t off, size_t count) 1500sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr,
1501 char *buf, loff_t off, size_t count)
1500{ 1502{
1501 struct class_device *cdev = container_of(kobj, struct class_device, 1503 struct class_device *cdev = container_of(kobj, struct class_device,
1502 kobj); 1504 kobj);
@@ -1550,7 +1552,8 @@ sysfs_mbox_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
1550} 1552}
1551 1553
1552static ssize_t 1554static ssize_t
1553sysfs_mbox_read(struct kobject *kobj, char *buf, loff_t off, size_t count) 1555sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
1556 char *buf, loff_t off, size_t count)
1554{ 1557{
1555 struct class_device *cdev = container_of(kobj, struct class_device, 1558 struct class_device *cdev = container_of(kobj, struct class_device,
1556 kobj); 1559 kobj);
@@ -1699,7 +1702,6 @@ static struct bin_attribute sysfs_mbox_attr = {
1699 .attr = { 1702 .attr = {
1700 .name = "mbox", 1703 .name = "mbox",
1701 .mode = S_IRUSR | S_IWUSR, 1704 .mode = S_IRUSR | S_IWUSR,
1702 .owner = THIS_MODULE,
1703 }, 1705 },
1704 .size = MAILBOX_CMD_SIZE, 1706 .size = MAILBOX_CMD_SIZE,
1705 .read = sysfs_mbox_read, 1707 .read = sysfs_mbox_read,
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 4a50e0a21470..f81f85ee190f 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1768,10 +1768,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1768 phba->fabric_block_timer.data = (unsigned long) phba; 1768 phba->fabric_block_timer.data = (unsigned long) phba;
1769 1769
1770 pci_set_master(pdev); 1770 pci_set_master(pdev);
1771 retval = pci_set_mwi(pdev); 1771 pci_try_set_mwi(pdev);
1772 if (retval)
1773 dev_printk(KERN_WARNING, &pdev->dev,
1774 "Warning: pci_set_mwi returned %d\n", retval);
1775 1772
1776 if (pci_set_dma_mask(phba->pcidev, DMA_64BIT_MASK) != 0) 1773 if (pci_set_dma_mask(phba->pcidev, DMA_64BIT_MASK) != 0)
1777 if (pci_set_dma_mask(phba->pcidev, DMA_32BIT_MASK) != 0) 1774 if (pci_set_dma_mask(phba->pcidev, DMA_32BIT_MASK) != 0)
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index 8cc9e64bbdff..7fed35372150 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -3379,15 +3379,6 @@ static int nsp32_resume(struct pci_dev *pdev)
3379 return 0; 3379 return 0;
3380} 3380}
3381 3381
3382/* Enable wake event */
3383static int nsp32_enable_wake(struct pci_dev *pdev, pci_power_t state, int enable)
3384{
3385 struct Scsi_Host *host = pci_get_drvdata(pdev);
3386
3387 nsp32_msg(KERN_INFO, "pci-enable_wake: stub, pdev=0x%p, enable=%d, slot=%s, host=0x%p", pdev, enable, pci_name(pdev), host);
3388
3389 return 0;
3390}
3391#endif 3382#endif
3392 3383
3393/************************************************************************ 3384/************************************************************************
@@ -3451,7 +3442,6 @@ static struct pci_driver nsp32_driver = {
3451#ifdef CONFIG_PM 3442#ifdef CONFIG_PM
3452 .suspend = nsp32_suspend, 3443 .suspend = nsp32_suspend,
3453 .resume = nsp32_resume, 3444 .resume = nsp32_resume,
3454 .enable_wake = nsp32_enable_wake,
3455#endif 3445#endif
3456}; 3446};
3457 3447
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index b79c4dfc2a9c..3eb2208675ae 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -14,8 +14,9 @@ int qla24xx_vport_disable(struct fc_vport *, bool);
14/* SYSFS attributes --------------------------------------------------------- */ 14/* SYSFS attributes --------------------------------------------------------- */
15 15
16static ssize_t 16static ssize_t
17qla2x00_sysfs_read_fw_dump(struct kobject *kobj, char *buf, loff_t off, 17qla2x00_sysfs_read_fw_dump(struct kobject *kobj,
18 size_t count) 18 struct bin_attribute *bin_attr,
19 char *buf, loff_t off, size_t count)
19{ 20{
20 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 21 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
21 struct device, kobj))); 22 struct device, kobj)));
@@ -34,8 +35,9 @@ qla2x00_sysfs_read_fw_dump(struct kobject *kobj, char *buf, loff_t off,
34} 35}
35 36
36static ssize_t 37static ssize_t
37qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off, 38qla2x00_sysfs_write_fw_dump(struct kobject *kobj,
38 size_t count) 39 struct bin_attribute *bin_attr,
40 char *buf, loff_t off, size_t count)
39{ 41{
40 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 42 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
41 struct device, kobj))); 43 struct device, kobj)));
@@ -76,7 +78,6 @@ static struct bin_attribute sysfs_fw_dump_attr = {
76 .attr = { 78 .attr = {
77 .name = "fw_dump", 79 .name = "fw_dump",
78 .mode = S_IRUSR | S_IWUSR, 80 .mode = S_IRUSR | S_IWUSR,
79 .owner = THIS_MODULE,
80 }, 81 },
81 .size = 0, 82 .size = 0,
82 .read = qla2x00_sysfs_read_fw_dump, 83 .read = qla2x00_sysfs_read_fw_dump,
@@ -84,8 +85,9 @@ static struct bin_attribute sysfs_fw_dump_attr = {
84}; 85};
85 86
86static ssize_t 87static ssize_t
87qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off, 88qla2x00_sysfs_read_nvram(struct kobject *kobj,
88 size_t count) 89 struct bin_attribute *bin_attr,
90 char *buf, loff_t off, size_t count)
89{ 91{
90 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 92 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
91 struct device, kobj))); 93 struct device, kobj)));
@@ -104,8 +106,9 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off,
104} 106}
105 107
106static ssize_t 108static ssize_t
107qla2x00_sysfs_write_nvram(struct kobject *kobj, char *buf, loff_t off, 109qla2x00_sysfs_write_nvram(struct kobject *kobj,
108 size_t count) 110 struct bin_attribute *bin_attr,
111 char *buf, loff_t off, size_t count)
109{ 112{
110 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 113 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
111 struct device, kobj))); 114 struct device, kobj)));
@@ -152,7 +155,6 @@ static struct bin_attribute sysfs_nvram_attr = {
152 .attr = { 155 .attr = {
153 .name = "nvram", 156 .name = "nvram",
154 .mode = S_IRUSR | S_IWUSR, 157 .mode = S_IRUSR | S_IWUSR,
155 .owner = THIS_MODULE,
156 }, 158 },
157 .size = 512, 159 .size = 512,
158 .read = qla2x00_sysfs_read_nvram, 160 .read = qla2x00_sysfs_read_nvram,
@@ -160,8 +162,9 @@ static struct bin_attribute sysfs_nvram_attr = {
160}; 162};
161 163
162static ssize_t 164static ssize_t
163qla2x00_sysfs_read_optrom(struct kobject *kobj, char *buf, loff_t off, 165qla2x00_sysfs_read_optrom(struct kobject *kobj,
164 size_t count) 166 struct bin_attribute *bin_attr,
167 char *buf, loff_t off, size_t count)
165{ 168{
166 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 169 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
167 struct device, kobj))); 170 struct device, kobj)));
@@ -179,8 +182,9 @@ qla2x00_sysfs_read_optrom(struct kobject *kobj, char *buf, loff_t off,
179} 182}
180 183
181static ssize_t 184static ssize_t
182qla2x00_sysfs_write_optrom(struct kobject *kobj, char *buf, loff_t off, 185qla2x00_sysfs_write_optrom(struct kobject *kobj,
183 size_t count) 186 struct bin_attribute *bin_attr,
187 char *buf, loff_t off, size_t count)
184{ 188{
185 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 189 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
186 struct device, kobj))); 190 struct device, kobj)));
@@ -201,7 +205,6 @@ static struct bin_attribute sysfs_optrom_attr = {
201 .attr = { 205 .attr = {
202 .name = "optrom", 206 .name = "optrom",
203 .mode = S_IRUSR | S_IWUSR, 207 .mode = S_IRUSR | S_IWUSR,
204 .owner = THIS_MODULE,
205 }, 208 },
206 .size = OPTROM_SIZE_24XX, 209 .size = OPTROM_SIZE_24XX,
207 .read = qla2x00_sysfs_read_optrom, 210 .read = qla2x00_sysfs_read_optrom,
@@ -209,8 +212,9 @@ static struct bin_attribute sysfs_optrom_attr = {
209}; 212};
210 213
211static ssize_t 214static ssize_t
212qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, char *buf, loff_t off, 215qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
213 size_t count) 216 struct bin_attribute *bin_attr,
217 char *buf, loff_t off, size_t count)
214{ 218{
215 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 219 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
216 struct device, kobj))); 220 struct device, kobj)));
@@ -282,15 +286,15 @@ static struct bin_attribute sysfs_optrom_ctl_attr = {
282 .attr = { 286 .attr = {
283 .name = "optrom_ctl", 287 .name = "optrom_ctl",
284 .mode = S_IWUSR, 288 .mode = S_IWUSR,
285 .owner = THIS_MODULE,
286 }, 289 },
287 .size = 0, 290 .size = 0,
288 .write = qla2x00_sysfs_write_optrom_ctl, 291 .write = qla2x00_sysfs_write_optrom_ctl,
289}; 292};
290 293
291static ssize_t 294static ssize_t
292qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off, 295qla2x00_sysfs_read_vpd(struct kobject *kobj,
293 size_t count) 296 struct bin_attribute *bin_attr,
297 char *buf, loff_t off, size_t count)
294{ 298{
295 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 299 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
296 struct device, kobj))); 300 struct device, kobj)));
@@ -308,8 +312,9 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off,
308} 312}
309 313
310static ssize_t 314static ssize_t
311qla2x00_sysfs_write_vpd(struct kobject *kobj, char *buf, loff_t off, 315qla2x00_sysfs_write_vpd(struct kobject *kobj,
312 size_t count) 316 struct bin_attribute *bin_attr,
317 char *buf, loff_t off, size_t count)
313{ 318{
314 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 319 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
315 struct device, kobj))); 320 struct device, kobj)));
@@ -330,7 +335,6 @@ static struct bin_attribute sysfs_vpd_attr = {
330 .attr = { 335 .attr = {
331 .name = "vpd", 336 .name = "vpd",
332 .mode = S_IRUSR | S_IWUSR, 337 .mode = S_IRUSR | S_IWUSR,
333 .owner = THIS_MODULE,
334 }, 338 },
335 .size = 0, 339 .size = 0,
336 .read = qla2x00_sysfs_read_vpd, 340 .read = qla2x00_sysfs_read_vpd,
@@ -338,8 +342,9 @@ static struct bin_attribute sysfs_vpd_attr = {
338}; 342};
339 343
340static ssize_t 344static ssize_t
341qla2x00_sysfs_read_sfp(struct kobject *kobj, char *buf, loff_t off, 345qla2x00_sysfs_read_sfp(struct kobject *kobj,
342 size_t count) 346 struct bin_attribute *bin_attr,
347 char *buf, loff_t off, size_t count)
343{ 348{
344 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, 349 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
345 struct device, kobj))); 350 struct device, kobj)));
@@ -378,7 +383,6 @@ static struct bin_attribute sysfs_sfp_attr = {
378 .attr = { 383 .attr = {
379 .name = "sfp", 384 .name = "sfp",
380 .mode = S_IRUSR | S_IWUSR, 385 .mode = S_IRUSR | S_IWUSR,
381 .owner = THIS_MODULE,
382 }, 386 },
383 .size = SFP_DEV_SIZE * 2, 387 .size = SFP_DEV_SIZE * 2,
384 .read = qla2x00_sysfs_read_sfp, 388 .read = qla2x00_sysfs_read_sfp,
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index bd95f7dc5cfc..cc6ebb609e98 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -296,7 +296,7 @@ qla24xx_pci_config(scsi_qla_host_t *ha)
296 d &= ~PCI_ROM_ADDRESS_ENABLE; 296 d &= ~PCI_ROM_ADDRESS_ENABLE;
297 pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d); 297 pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d);
298 298
299 pci_read_config_word(ha->pdev, PCI_REVISION_ID, &ha->chip_revision); 299 ha->chip_revision = ha->pdev->revision;
300 300
301 /* Get PCI bus information. */ 301 /* Get PCI bus information. */
302 spin_lock_irqsave(&ha->hardware_lock, flags); 302 spin_lock_irqsave(&ha->hardware_lock, flags);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index a8658b1d284f..b5a77b0c0deb 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2610,7 +2610,7 @@ qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout)
2610 return 0; 2610 return 0;
2611 if (msleep_interruptible(step)) 2611 if (msleep_interruptible(step))
2612 break; 2612 break;
2613 } while (--iterations >= 0); 2613 } while (--iterations > 0);
2614 2614
2615 return -ETIMEDOUT; 2615 return -ETIMEDOUT;
2616} 2616}
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 0827df2ebb6d..a86e62f4b3ba 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -184,6 +184,15 @@ int scsi_complete_async_scans(void)
184/* Only exported for the benefit of scsi_wait_scan */ 184/* Only exported for the benefit of scsi_wait_scan */
185EXPORT_SYMBOL_GPL(scsi_complete_async_scans); 185EXPORT_SYMBOL_GPL(scsi_complete_async_scans);
186 186
187#ifndef MODULE
188/*
189 * For async scanning we need to wait for all the scans to complete before
190 * trying to mount the root fs. Otherwise non-modular drivers may not be ready
191 * yet.
192 */
193late_initcall(scsi_complete_async_scans);
194#endif
195
187/** 196/**
188 * scsi_unlock_floptical - unlock device via a special MODE SENSE command 197 * scsi_unlock_floptical - unlock device via a special MODE SENSE command
189 * @sdev: scsi device to send command to 198 * @sdev: scsi device to send command to