aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-03-28 21:24:50 -0500
committerPaul Mackerras <paulus@samba.org>2006-03-28 21:24:50 -0500
commitbac30d1a78d0f11c613968fc8b351a91ed465386 (patch)
treee52f3c876522a2f6047a6ec1c27df2e8a79486b8 /drivers/scsi
parente8222502ee6157e2713da9e0792c21f4ad458d50 (diff)
parentca9ba4471c1203bb6e759b76e83167fec54fe590 (diff)
Merge ../linux-2.6
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/3w-9xxx.c2
-rw-r--r--drivers/scsi/BusLogic.c10
-rw-r--r--drivers/scsi/a100u2w.c3
-rw-r--r--drivers/scsi/aacraid/aachba.c1
-rw-r--r--drivers/scsi/aacraid/linit.c5
-rw-r--r--drivers/scsi/atp870u.c3
-rw-r--r--drivers/scsi/dpt_i2o.c5
-rw-r--r--drivers/scsi/eata.c3
-rw-r--r--drivers/scsi/gdth.c16
-rw-r--r--drivers/scsi/initio.c3
-rw-r--r--drivers/scsi/ips.c5
-rw-r--r--drivers/scsi/megaraid.c7
-rw-r--r--drivers/scsi/nsp32.c3
-rw-r--r--drivers/scsi/osst.c5
-rw-r--r--drivers/scsi/ppa.c3
-rw-r--r--drivers/scsi/qla1280.c5
-rw-r--r--drivers/scsi/qlogicfc.c8
-rw-r--r--drivers/scsi/qlogicpti.c3
18 files changed, 56 insertions, 34 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 0ab26d01877b..0d2b447c50ed 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -1026,7 +1026,7 @@ static void twa_free_request_id(TW_Device_Extension *tw_dev, int request_id)
1026 tw_dev->free_tail = (tw_dev->free_tail + 1) % TW_Q_LENGTH; 1026 tw_dev->free_tail = (tw_dev->free_tail + 1) % TW_Q_LENGTH;
1027} /* End twa_free_request_id() */ 1027} /* End twa_free_request_id() */
1028 1028
1029/* This function will get parameter table entires from the firmware */ 1029/* This function will get parameter table entries from the firmware */
1030static void *twa_get_param(TW_Device_Extension *tw_dev, int request_id, int table_id, int parameter_id, int parameter_size_bytes) 1030static void *twa_get_param(TW_Device_Extension *tw_dev, int request_id, int table_id, int parameter_id, int parameter_size_bytes)
1031{ 1031{
1032 TW_Command_Full *full_command_packet; 1032 TW_Command_Full *full_command_packet;
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index 1c459343292b..bde3d5834ade 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -41,6 +41,8 @@
41#include <linux/stat.h> 41#include <linux/stat.h>
42#include <linux/pci.h> 42#include <linux/pci.h>
43#include <linux/spinlock.h> 43#include <linux/spinlock.h>
44#include <linux/jiffies.h>
45#include <linux/dma-mapping.h>
44#include <scsi/scsicam.h> 46#include <scsi/scsicam.h>
45 47
46#include <asm/dma.h> 48#include <asm/dma.h>
@@ -676,7 +678,7 @@ static int __init BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAd
676 if (pci_enable_device(PCI_Device)) 678 if (pci_enable_device(PCI_Device))
677 continue; 679 continue;
678 680
679 if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) 681 if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK ))
680 continue; 682 continue;
681 683
682 Bus = PCI_Device->bus->number; 684 Bus = PCI_Device->bus->number;
@@ -831,7 +833,7 @@ static int __init BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAd
831 if (pci_enable_device(PCI_Device)) 833 if (pci_enable_device(PCI_Device))
832 continue; 834 continue;
833 835
834 if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) 836 if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK))
835 continue; 837 continue;
836 838
837 Bus = PCI_Device->bus->number; 839 Bus = PCI_Device->bus->number;
@@ -885,7 +887,7 @@ static int __init BusLogic_InitializeFlashPointProbeInfo(struct BusLogic_HostAda
885 if (pci_enable_device(PCI_Device)) 887 if (pci_enable_device(PCI_Device))
886 continue; 888 continue;
887 889
888 if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) 890 if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK))
889 continue; 891 continue;
890 892
891 Bus = PCI_Device->bus->number; 893 Bus = PCI_Device->bus->number;
@@ -2896,7 +2898,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou
2896 */ 2898 */
2897 if (HostAdapter->ActiveCommands[TargetID] == 0) 2899 if (HostAdapter->ActiveCommands[TargetID] == 0)
2898 HostAdapter->LastSequencePoint[TargetID] = jiffies; 2900 HostAdapter->LastSequencePoint[TargetID] = jiffies;
2899 else if (jiffies - HostAdapter->LastSequencePoint[TargetID] > 4 * HZ) { 2901 else if (time_after(jiffies, HostAdapter->LastSequencePoint[TargetID] + 4 * HZ)) {
2900 HostAdapter->LastSequencePoint[TargetID] = jiffies; 2902 HostAdapter->LastSequencePoint[TargetID] = jiffies;
2901 QueueTag = BusLogic_OrderedQueueTag; 2903 QueueTag = BusLogic_OrderedQueueTag;
2902 } 2904 }
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index 9f45ae1745da..3dce21c78737 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -89,6 +89,7 @@
89#include <linux/string.h> 89#include <linux/string.h>
90#include <linux/ioport.h> 90#include <linux/ioport.h>
91#include <linux/slab.h> 91#include <linux/slab.h>
92#include <linux/dma-mapping.h>
92 93
93#include <asm/io.h> 94#include <asm/io.h>
94#include <asm/irq.h> 95#include <asm/irq.h>
@@ -1052,7 +1053,7 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
1052 1053
1053 if (pci_enable_device(pdev)) 1054 if (pci_enable_device(pdev))
1054 goto out; 1055 goto out;
1055 if (pci_set_dma_mask(pdev, 0xffffffffULL)) { 1056 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
1056 printk(KERN_WARNING "Unable to set 32bit DMA " 1057 printk(KERN_WARNING "Unable to set 32bit DMA "
1057 "on inia100 adapter, ignoring.\n"); 1058 "on inia100 adapter, ignoring.\n");
1058 goto out_disable_device; 1059 goto out_disable_device;
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index a16f8ded8f1d..8df4a0ea3761 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -32,6 +32,7 @@
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/completion.h> 33#include <linux/completion.h>
34#include <linux/blkdev.h> 34#include <linux/blkdev.h>
35#include <linux/dma-mapping.h>
35#include <asm/semaphore.h> 36#include <asm/semaphore.h>
36#include <asm/uaccess.h> 37#include <asm/uaccess.h>
37 38
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index c2596335549d..720330778648 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -45,6 +45,7 @@
45#include <linux/pci.h> 45#include <linux/pci.h>
46#include <linux/slab.h> 46#include <linux/slab.h>
47#include <linux/spinlock.h> 47#include <linux/spinlock.h>
48#include <linux/dma-mapping.h>
48#include <linux/syscalls.h> 49#include <linux/syscalls.h>
49#include <linux/delay.h> 50#include <linux/delay.h>
50#include <linux/smp_lock.h> 51#include <linux/smp_lock.h>
@@ -806,8 +807,8 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
806 * to driver communication memory to be allocated below 2gig 807 * to driver communication memory to be allocated below 2gig
807 */ 808 */
808 if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) 809 if (aac_drivers[index].quirks & AAC_QUIRK_31BIT)
809 if (pci_set_dma_mask(pdev, 0x7FFFFFFFULL) || 810 if (pci_set_dma_mask(pdev, DMA_31BIT_MASK) ||
810 pci_set_consistent_dma_mask(pdev, 0x7FFFFFFFULL)) 811 pci_set_consistent_dma_mask(pdev, DMA_31BIT_MASK))
811 goto out; 812 goto out;
812 813
813 pci_set_master(pdev); 814 pci_set_master(pdev);
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index 5227a779c05c..a198d86667e9 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -28,6 +28,7 @@
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/pci.h> 29#include <linux/pci.h>
30#include <linux/blkdev.h> 30#include <linux/blkdev.h>
31#include <linux/dma-mapping.h>
31#include <asm/system.h> 32#include <asm/system.h>
32#include <asm/io.h> 33#include <asm/io.h>
33 34
@@ -2631,7 +2632,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2631 if (pci_enable_device(pdev)) 2632 if (pci_enable_device(pdev))
2632 return -EIO; 2633 return -EIO;
2633 2634
2634 if (!pci_set_dma_mask(pdev, 0xFFFFFFFFUL)) { 2635 if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
2635 printk(KERN_INFO "atp870u: use 32bit DMA mask.\n"); 2636 printk(KERN_INFO "atp870u: use 32bit DMA mask.\n");
2636 } else { 2637 } else {
2637 printk(KERN_ERR "atp870u: DMA mask required but not available.\n"); 2638 printk(KERN_ERR "atp870u: DMA mask required but not available.\n");
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 6e6b293dcb28..b1b704a42efd 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -57,6 +57,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver");
57#include <linux/reboot.h> 57#include <linux/reboot.h>
58#include <linux/spinlock.h> 58#include <linux/spinlock.h>
59#include <linux/smp_lock.h> 59#include <linux/smp_lock.h>
60#include <linux/dma-mapping.h>
60 61
61#include <linux/timer.h> 62#include <linux/timer.h>
62#include <linux/string.h> 63#include <linux/string.h>
@@ -906,8 +907,8 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
906 } 907 }
907 908
908 pci_set_master(pDev); 909 pci_set_master(pDev);
909 if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) && 910 if (pci_set_dma_mask(pDev, DMA_64BIT_MASK) &&
910 pci_set_dma_mask(pDev, 0xffffffffULL)) 911 pci_set_dma_mask(pDev, DMA_32BIT_MASK))
911 return -EINVAL; 912 return -EINVAL;
912 913
913 base_addr0_phys = pci_resource_start(pDev,0); 914 base_addr0_phys = pci_resource_start(pDev,0);
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index b3f9de8f7595..059eeee4b554 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -490,6 +490,7 @@
490#include <linux/init.h> 490#include <linux/init.h>
491#include <linux/ctype.h> 491#include <linux/ctype.h>
492#include <linux/spinlock.h> 492#include <linux/spinlock.h>
493#include <linux/dma-mapping.h>
493#include <asm/byteorder.h> 494#include <asm/byteorder.h>
494#include <asm/dma.h> 495#include <asm/dma.h>
495#include <asm/io.h> 496#include <asm/io.h>
@@ -1426,7 +1427,7 @@ static int port_detect(unsigned long port_base, unsigned int j,
1426 1427
1427 if (ha->pdev) { 1428 if (ha->pdev) {
1428 pci_set_master(ha->pdev); 1429 pci_set_master(ha->pdev);
1429 if (pci_set_dma_mask(ha->pdev, 0xffffffff)) 1430 if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK))
1430 printk("%s: warning, pci_set_dma_mask failed.\n", 1431 printk("%s: warning, pci_set_dma_mask failed.\n",
1431 ha->board_name); 1432 ha->board_name);
1432 } 1433 }
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 62e3cda859af..d5740bbdef3e 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -388,6 +388,7 @@
388#include <linux/proc_fs.h> 388#include <linux/proc_fs.h>
389#include <linux/time.h> 389#include <linux/time.h>
390#include <linux/timer.h> 390#include <linux/timer.h>
391#include <linux/dma-mapping.h>
391#ifdef GDTH_RTC 392#ifdef GDTH_RTC
392#include <linux/mc146818rtc.h> 393#include <linux/mc146818rtc.h>
393#endif 394#endif
@@ -671,7 +672,7 @@ static struct file_operations gdth_fops = {
671static struct notifier_block gdth_notifier = { 672static struct notifier_block gdth_notifier = {
672 gdth_halt, NULL, 0 673 gdth_halt, NULL, 0
673}; 674};
674 675static int notifier_disabled = 0;
675 676
676static void gdth_delay(int milliseconds) 677static void gdth_delay(int milliseconds)
677{ 678{
@@ -4527,15 +4528,15 @@ static int __init gdth_detect(struct scsi_host_template *shtp)
4527 if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)|| 4528 if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)||
4528 /* 64-bit DMA only supported from FW >= x.43 */ 4529 /* 64-bit DMA only supported from FW >= x.43 */
4529 (!ha->dma64_support)) { 4530 (!ha->dma64_support)) {
4530 if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) { 4531 if (pci_set_dma_mask(pcistr[ctr].pdev, DMA_32BIT_MASK)) {
4531 printk(KERN_WARNING "GDT-PCI %d: Unable to set 32-bit DMA\n", hanum); 4532 printk(KERN_WARNING "GDT-PCI %d: Unable to set 32-bit DMA\n", hanum);
4532 err = TRUE; 4533 err = TRUE;
4533 } 4534 }
4534 } else { 4535 } else {
4535 shp->max_cmd_len = 16; 4536 shp->max_cmd_len = 16;
4536 if (!pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffffffffffffULL)) { 4537 if (!pci_set_dma_mask(pcistr[ctr].pdev, DMA_64BIT_MASK)) {
4537 printk("GDT-PCI %d: 64-bit DMA enabled\n", hanum); 4538 printk("GDT-PCI %d: 64-bit DMA enabled\n", hanum);
4538 } else if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) { 4539 } else if (pci_set_dma_mask(pcistr[ctr].pdev, DMA_32BIT_MASK)) {
4539 printk(KERN_WARNING "GDT-PCI %d: Unable to set 64/32-bit DMA\n", hanum); 4540 printk(KERN_WARNING "GDT-PCI %d: Unable to set 64/32-bit DMA\n", hanum);
4540 err = TRUE; 4541 err = TRUE;
4541 } 4542 }
@@ -4595,13 +4596,13 @@ static int __init gdth_detect(struct scsi_host_template *shtp)
4595 add_timer(&gdth_timer); 4596 add_timer(&gdth_timer);
4596#endif 4597#endif
4597 major = register_chrdev(0,"gdth",&gdth_fops); 4598 major = register_chrdev(0,"gdth",&gdth_fops);
4599 notifier_disabled = 0;
4598 register_reboot_notifier(&gdth_notifier); 4600 register_reboot_notifier(&gdth_notifier);
4599 } 4601 }
4600 gdth_polling = FALSE; 4602 gdth_polling = FALSE;
4601 return gdth_ctr_vcount; 4603 return gdth_ctr_vcount;
4602} 4604}
4603 4605
4604
4605static int gdth_release(struct Scsi_Host *shp) 4606static int gdth_release(struct Scsi_Host *shp)
4606{ 4607{
4607 int hanum; 4608 int hanum;
@@ -5632,10 +5633,14 @@ static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5632 char cmnd[MAX_COMMAND_SIZE]; 5633 char cmnd[MAX_COMMAND_SIZE];
5633#endif 5634#endif
5634 5635
5636 if (notifier_disabled)
5637 return NOTIFY_OK;
5638
5635 TRACE2(("gdth_halt() event %d\n",(int)event)); 5639 TRACE2(("gdth_halt() event %d\n",(int)event));
5636 if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF) 5640 if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
5637 return NOTIFY_DONE; 5641 return NOTIFY_DONE;
5638 5642
5643 notifier_disabled = 1;
5639 printk("GDT-HA: Flushing all host drives .. "); 5644 printk("GDT-HA: Flushing all host drives .. ");
5640 for (hanum = 0; hanum < gdth_ctr_count; ++hanum) { 5645 for (hanum = 0; hanum < gdth_ctr_count; ++hanum) {
5641 gdth_flush(hanum); 5646 gdth_flush(hanum);
@@ -5679,7 +5684,6 @@ static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5679#ifdef GDTH_STATISTICS 5684#ifdef GDTH_STATISTICS
5680 del_timer(&gdth_timer); 5685 del_timer(&gdth_timer);
5681#endif 5686#endif
5682 unregister_reboot_notifier(&gdth_notifier);
5683 return NOTIFY_OK; 5687 return NOTIFY_OK;
5684} 5688}
5685 5689
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index ea6f3c0e05d9..0cc7f65b584f 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -127,6 +127,7 @@
127#include <linux/sched.h> 127#include <linux/sched.h>
128#include <linux/slab.h> 128#include <linux/slab.h>
129#include <linux/jiffies.h> 129#include <linux/jiffies.h>
130#include <linux/dma-mapping.h>
130#include <asm/io.h> 131#include <asm/io.h>
131 132
132#include <scsi/scsi.h> 133#include <scsi/scsi.h>
@@ -2780,7 +2781,7 @@ static int tul_NewReturnNumberOfAdapters(void)
2780 if (((dRegValue & 0xFF00) >> 8) == 0xFF) 2781 if (((dRegValue & 0xFF00) >> 8) == 0xFF)
2781 dRegValue = 0; 2782 dRegValue = 0;
2782 wBIOS = (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8)); 2783 wBIOS = (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8));
2783 if (pci_set_dma_mask(pDev, 0xffffffff)) { 2784 if (pci_set_dma_mask(pDev, DMA_32BIT_MASK)) {
2784 printk(KERN_WARNING 2785 printk(KERN_WARNING
2785 "i91u: Could not set 32 bit DMA mask\n"); 2786 "i91u: Could not set 32 bit DMA mask\n");
2786 continue; 2787 continue;
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 481708d527ae..a4c0b04cfdbd 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -179,6 +179,7 @@
179 179
180#include <linux/blkdev.h> 180#include <linux/blkdev.h>
181#include <linux/types.h> 181#include <linux/types.h>
182#include <linux/dma-mapping.h>
182 183
183#include <scsi/sg.h> 184#include <scsi/sg.h>
184 185
@@ -7284,10 +7285,10 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr)
7284 * are guaranteed to be < 4G. 7285 * are guaranteed to be < 4G.
7285 */ 7286 */
7286 if (IPS_ENABLE_DMA64 && IPS_HAS_ENH_SGLIST(ha) && 7287 if (IPS_ENABLE_DMA64 && IPS_HAS_ENH_SGLIST(ha) &&
7287 !pci_set_dma_mask(ha->pcidev, 0xffffffffffffffffULL)) { 7288 !pci_set_dma_mask(ha->pcidev, DMA_64BIT_MASK)) {
7288 (ha)->flags |= IPS_HA_ENH_SG; 7289 (ha)->flags |= IPS_HA_ENH_SG;
7289 } else { 7290 } else {
7290 if (pci_set_dma_mask(ha->pcidev, 0xffffffffULL) != 0) { 7291 if (pci_set_dma_mask(ha->pcidev, DMA_32BIT_MASK) != 0) {
7291 printk(KERN_WARNING "Unable to set DMA Mask\n"); 7292 printk(KERN_WARNING "Unable to set DMA Mask\n");
7292 return ips_abort_init(ha, index); 7293 return ips_abort_init(ha, index);
7293 } 7294 }
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 7144674bc8e6..80b68a2481b3 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -45,6 +45,7 @@
45#include <linux/interrupt.h> 45#include <linux/interrupt.h>
46#include <linux/pci.h> 46#include <linux/pci.h>
47#include <linux/init.h> 47#include <linux/init.h>
48#include <linux/dma-mapping.h>
48#include <scsi/scsicam.h> 49#include <scsi/scsicam.h>
49 50
50#include "scsi.h" 51#include "scsi.h"
@@ -2094,7 +2095,7 @@ make_local_pdev(adapter_t *adapter, struct pci_dev **pdev)
2094 2095
2095 memcpy(*pdev, adapter->dev, sizeof(struct pci_dev)); 2096 memcpy(*pdev, adapter->dev, sizeof(struct pci_dev));
2096 2097
2097 if( pci_set_dma_mask(*pdev, 0xffffffff) != 0 ) { 2098 if( pci_set_dma_mask(*pdev, DMA_32BIT_MASK) != 0 ) {
2098 kfree(*pdev); 2099 kfree(*pdev);
2099 return -1; 2100 return -1;
2100 } 2101 }
@@ -4859,10 +4860,10 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4859 4860
4860 /* Set the Mode of addressing to 64 bit if we can */ 4861 /* Set the Mode of addressing to 64 bit if we can */
4861 if ((adapter->flag & BOARD_64BIT) && (sizeof(dma_addr_t) == 8)) { 4862 if ((adapter->flag & BOARD_64BIT) && (sizeof(dma_addr_t) == 8)) {
4862 pci_set_dma_mask(pdev, 0xffffffffffffffffULL); 4863 pci_set_dma_mask(pdev, DMA_64BIT_MASK);
4863 adapter->has_64bit_addr = 1; 4864 adapter->has_64bit_addr = 1;
4864 } else { 4865 } else {
4865 pci_set_dma_mask(pdev, 0xffffffff); 4866 pci_set_dma_mask(pdev, DMA_32BIT_MASK);
4866 adapter->has_64bit_addr = 0; 4867 adapter->has_64bit_addr = 0;
4867 } 4868 }
4868 4869
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index a279ebb61447..30ee0ef4b459 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -38,6 +38,7 @@
38#include <linux/pci.h> 38#include <linux/pci.h>
39#include <linux/delay.h> 39#include <linux/delay.h>
40#include <linux/ctype.h> 40#include <linux/ctype.h>
41#include <linux/dma-mapping.h>
41 42
42#include <asm/dma.h> 43#include <asm/dma.h>
43#include <asm/system.h> 44#include <asm/system.h>
@@ -2776,7 +2777,7 @@ static int nsp32_detect(struct scsi_host_template *sht)
2776 /* 2777 /*
2777 * setup DMA 2778 * setup DMA
2778 */ 2779 */
2779 if (pci_set_dma_mask(PCIDEV, 0xffffffffUL) != 0) { 2780 if (pci_set_dma_mask(PCIDEV, DMA_32BIT_MASK) != 0) {
2780 nsp32_msg (KERN_ERR, "failed to set PCI DMA mask"); 2781 nsp32_msg (KERN_ERR, "failed to set PCI DMA mask");
2781 goto scsi_unregister; 2782 goto scsi_unregister;
2782 } 2783 }
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 66ea47a9c53c..e3bd4bc339f4 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -49,6 +49,7 @@ static const char * osst_version = "0.99.4";
49#include <linux/blkdev.h> 49#include <linux/blkdev.h>
50#include <linux/moduleparam.h> 50#include <linux/moduleparam.h>
51#include <linux/delay.h> 51#include <linux/delay.h>
52#include <linux/jiffies.h>
52#include <asm/uaccess.h> 53#include <asm/uaccess.h>
53#include <asm/dma.h> 54#include <asm/dma.h>
54#include <asm/system.h> 55#include <asm/system.h>
@@ -856,7 +857,7 @@ static int osst_wait_frame(struct osst_tape * STp, struct osst_request ** aSRpnt
856 ) && result >= 0) 857 ) && result >= 0)
857 { 858 {
858#if DEBUG 859#if DEBUG
859 if (debugging || jiffies - startwait >= 2*HZ/OSST_POLL_PER_SEC) 860 if (debugging || time_after_eq(jiffies, startwait + 2*HZ/OSST_POLL_PER_SEC))
860 printk (OSST_DEB_MSG 861 printk (OSST_DEB_MSG
861 "%s:D: Succ wait f fr %i (>%i): %i-%i %i (%i): %3li.%li s\n", 862 "%s:D: Succ wait f fr %i (>%i): %i-%i %i (%i): %3li.%li s\n",
862 name, curr, curr+minlast, STp->first_frame_position, 863 name, curr, curr+minlast, STp->first_frame_position,
@@ -867,7 +868,7 @@ static int osst_wait_frame(struct osst_tape * STp, struct osst_request ** aSRpnt
867 return 0; 868 return 0;
868 } 869 }
869#if DEBUG 870#if DEBUG
870 if (jiffies - startwait >= 2*HZ/OSST_POLL_PER_SEC && notyetprinted) 871 if (time_after_eq(jiffies, startwait + 2*HZ/OSST_POLL_PER_SEC) && notyetprinted)
871 { 872 {
872 printk (OSST_DEB_MSG "%s:D: Wait for frame %i (>%i): %i-%i %i (%i)\n", 873 printk (OSST_DEB_MSG "%s:D: Wait for frame %i (>%i): %i-%i %i (%i)\n",
873 name, curr, curr+minlast, STp->first_frame_position, 874 name, curr, curr+minlast, STp->first_frame_position,
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index 05347eed9dd5..fee843fab1c7 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -18,6 +18,7 @@
18#include <linux/parport.h> 18#include <linux/parport.h>
19#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/jiffies.h>
21#include <asm/io.h> 22#include <asm/io.h>
22 23
23#include <scsi/scsi.h> 24#include <scsi/scsi.h>
@@ -726,7 +727,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
726 retv--; 727 retv--;
727 728
728 if (retv) { 729 if (retv) {
729 if ((jiffies - dev->jstart) > (1 * HZ)) { 730 if (time_after(jiffies, dev->jstart + (1 * HZ))) {
730 printk 731 printk
731 ("ppa: Parallel port cable is unplugged!!\n"); 732 ("ppa: Parallel port cable is unplugged!!\n");
732 ppa_fail(dev, DID_BUS_BUSY); 733 ppa_fail(dev, DID_BUS_BUSY);
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index e0230249fa0f..5a48e55f9418 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -350,6 +350,7 @@
350#include <linux/pci_ids.h> 350#include <linux/pci_ids.h>
351#include <linux/interrupt.h> 351#include <linux/interrupt.h>
352#include <linux/init.h> 352#include <linux/init.h>
353#include <linux/dma-mapping.h>
353 354
354#include <asm/io.h> 355#include <asm/io.h>
355#include <asm/irq.h> 356#include <asm/irq.h>
@@ -4321,7 +4322,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4321 4322
4322#ifdef QLA_64BIT_PTR 4323#ifdef QLA_64BIT_PTR
4323 if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) { 4324 if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) {
4324 if (pci_set_dma_mask(ha->pdev, 0xffffffff)) { 4325 if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) {
4325 printk(KERN_WARNING "scsi(%li): Unable to set a " 4326 printk(KERN_WARNING "scsi(%li): Unable to set a "
4326 "suitable DMA mask - aborting\n", ha->host_no); 4327 "suitable DMA mask - aborting\n", ha->host_no);
4327 error = -ENODEV; 4328 error = -ENODEV;
@@ -4331,7 +4332,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4331 dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n", 4332 dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n",
4332 ha->host_no); 4333 ha->host_no);
4333#else 4334#else
4334 if (pci_set_dma_mask(ha->pdev, 0xffffffff)) { 4335 if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) {
4335 printk(KERN_WARNING "scsi(%li): Unable to set a " 4336 printk(KERN_WARNING "scsi(%li): Unable to set a "
4336 "suitable DMA mask - aborting\n", ha->host_no); 4337 "suitable DMA mask - aborting\n", ha->host_no);
4337 error = -ENODEV; 4338 error = -ENODEV;
diff --git a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c
index 94ef3f08d378..52b224a5d6fd 100644
--- a/drivers/scsi/qlogicfc.c
+++ b/drivers/scsi/qlogicfc.c
@@ -61,6 +61,8 @@
61#include <linux/unistd.h> 61#include <linux/unistd.h>
62#include <linux/spinlock.h> 62#include <linux/spinlock.h>
63#include <linux/interrupt.h> 63#include <linux/interrupt.h>
64#include <linux/dma-mapping.h>
65#include <linux/jiffies.h>
64#include <asm/io.h> 66#include <asm/io.h>
65#include <asm/irq.h> 67#include <asm/irq.h>
66#include "scsi.h" 68#include "scsi.h"
@@ -737,8 +739,8 @@ static int isp2x00_detect(struct scsi_host_template * tmpt)
737 continue; 739 continue;
738 740
739 /* Try to configure DMA attributes. */ 741 /* Try to configure DMA attributes. */
740 if (pci_set_dma_mask(pdev, 0xffffffffffffffffULL) && 742 if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) &&
741 pci_set_dma_mask(pdev, 0xffffffffULL)) 743 pci_set_dma_mask(pdev, DMA_32BIT_MASK))
742 continue; 744 continue;
743 745
744 host = scsi_register(tmpt, sizeof(struct isp2x00_hostdata)); 746 host = scsi_register(tmpt, sizeof(struct isp2x00_hostdata));
@@ -1325,7 +1327,7 @@ static int isp2x00_queuecommand(Scsi_Cmnd * Cmnd, void (*done) (Scsi_Cmnd *))
1325 cmd->control_flags = cpu_to_le16(CFLAG_READ); 1327 cmd->control_flags = cpu_to_le16(CFLAG_READ);
1326 1328
1327 if (Cmnd->device->tagged_supported) { 1329 if (Cmnd->device->tagged_supported) {
1328 if ((jiffies - hostdata->tag_ages[Cmnd->device->id]) > (2 * ISP_TIMEOUT)) { 1330 if (time_after(jiffies, hostdata->tag_ages[Cmnd->device->id] + (2 * ISP_TIMEOUT))) {
1329 cmd->control_flags |= cpu_to_le16(CFLAG_ORDERED_TAG); 1331 cmd->control_flags |= cpu_to_le16(CFLAG_ORDERED_TAG);
1330 hostdata->tag_ages[Cmnd->device->id] = jiffies; 1332 hostdata->tag_ages[Cmnd->device->id] = jiffies;
1331 } else 1333 } else
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index 1fd5fc6d0fe3..c7e78dcf09df 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -24,6 +24,7 @@
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/jiffies.h>
27 28
28#include <asm/byteorder.h> 29#include <asm/byteorder.h>
29 30
@@ -1017,7 +1018,7 @@ static inline void cmd_frob(struct Command_Entry *cmd, struct scsi_cmnd *Cmnd,
1017 if (Cmnd->device->tagged_supported) { 1018 if (Cmnd->device->tagged_supported) {
1018 if (qpti->cmd_count[Cmnd->device->id] == 0) 1019 if (qpti->cmd_count[Cmnd->device->id] == 0)
1019 qpti->tag_ages[Cmnd->device->id] = jiffies; 1020 qpti->tag_ages[Cmnd->device->id] = jiffies;
1020 if ((jiffies - qpti->tag_ages[Cmnd->device->id]) > (5*HZ)) { 1021 if (time_after(jiffies, qpti->tag_ages[Cmnd->device->id] + (5*HZ))) {
1021 cmd->control_flags = CFLAG_ORDERED_TAG; 1022 cmd->control_flags = CFLAG_ORDERED_TAG;
1022 qpti->tag_ages[Cmnd->device->id] = jiffies; 1023 qpti->tag_ages[Cmnd->device->id] = jiffies;
1023 } else 1024 } else