aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-03-29 17:24:55 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-29 17:24:55 -0500
commit74d89c16735d83349ea74232031819e989a49156 (patch)
tree1d8ded9c76b6ebe97c3841bbb986aacd63a801e5 /drivers/scsi
parent52a3220599647ba429fcbca2388ec35b850fa72f (diff)
parent05c8e0ac5c37e9739a852b526afeecae97607cbb (diff)
Merge branch 'upstream'
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/arm/cumana_2.c2
-rw-r--r--drivers/scsi/arm/eesox.c2
-rw-r--r--drivers/scsi/arm/powertec.c2
-rw-r--r--drivers/scsi/atari_scsi.c10
-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/iscsi_tcp.c4
-rw-r--r--drivers/scsi/libata-core.c13
-rw-r--r--drivers/scsi/lpfc/lpfc_mem.c22
-rw-r--r--drivers/scsi/megaraid.c7
-rw-r--r--drivers/scsi/mesh.c2
-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/qla2xxx/qla_os.c3
-rw-r--r--drivers/scsi/qlogicfc.c8
-rw-r--r--drivers/scsi/qlogicpti.c3
-rw-r--r--drivers/scsi/scsi_lib.c5
-rw-r--r--drivers/scsi/sd.c2
29 files changed, 83 insertions, 74 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/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index 583d2d8c8335..fad2109268bb 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -550,6 +550,6 @@ module_exit(cumanascsi2_exit);
550 550
551MODULE_AUTHOR("Russell King"); 551MODULE_AUTHOR("Russell King");
552MODULE_DESCRIPTION("Cumana SCSI-2 driver for Acorn machines"); 552MODULE_DESCRIPTION("Cumana SCSI-2 driver for Acorn machines");
553MODULE_PARM(term, "1-8i"); 553module_param_array(term, int, NULL, 0);
554MODULE_PARM_DESC(term, "SCSI bus termination"); 554MODULE_PARM_DESC(term, "SCSI bus termination");
555MODULE_LICENSE("GPL"); 555MODULE_LICENSE("GPL");
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index 3ffec7efc9d5..dcbb4b2b3fe0 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -674,6 +674,6 @@ module_exit(eesox_exit);
674 674
675MODULE_AUTHOR("Russell King"); 675MODULE_AUTHOR("Russell King");
676MODULE_DESCRIPTION("EESOX 'Fast' SCSI driver for Acorn machines"); 676MODULE_DESCRIPTION("EESOX 'Fast' SCSI driver for Acorn machines");
677MODULE_PARM(term, "1-8i"); 677module_param_array(term, int, NULL, 0);
678MODULE_PARM_DESC(term, "SCSI bus termination"); 678MODULE_PARM_DESC(term, "SCSI bus termination");
679MODULE_LICENSE("GPL"); 679MODULE_LICENSE("GPL");
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index 3113bdcedb13..3d69f6c45a6b 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -466,6 +466,6 @@ module_exit(powertecscsi_exit);
466 466
467MODULE_AUTHOR("Russell King"); 467MODULE_AUTHOR("Russell King");
468MODULE_DESCRIPTION("Powertec SCSI driver"); 468MODULE_DESCRIPTION("Powertec SCSI driver");
469MODULE_PARM(term, "1-8i"); 469module_param_array(term, int, NULL, 0);
470MODULE_PARM_DESC(term, "SCSI bus termination"); 470MODULE_PARM_DESC(term, "SCSI bus termination");
471MODULE_LICENSE("GPL"); 471MODULE_LICENSE("GPL");
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index f4c1ca7c1572..f677c5a32a68 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -239,17 +239,17 @@ static int atari_read_overruns = 0;
239#endif 239#endif
240 240
241static int setup_can_queue = -1; 241static int setup_can_queue = -1;
242MODULE_PARM(setup_can_queue, "i"); 242module_param(setup_can_queue, int, 0);
243static int setup_cmd_per_lun = -1; 243static int setup_cmd_per_lun = -1;
244MODULE_PARM(setup_cmd_per_lun, "i"); 244module_param(setup_cmd_per_lun, int, 0);
245static int setup_sg_tablesize = -1; 245static int setup_sg_tablesize = -1;
246MODULE_PARM(setup_sg_tablesize, "i"); 246module_param(setup_sg_tablesize, int, 0);
247#ifdef SUPPORT_TAGS 247#ifdef SUPPORT_TAGS
248static int setup_use_tagged_queuing = -1; 248static int setup_use_tagged_queuing = -1;
249MODULE_PARM(setup_use_tagged_queuing, "i"); 249module_param(setup_use_tagged_queuing, int, 0);
250#endif 250#endif
251static int setup_hostid = -1; 251static int setup_hostid = -1;
252MODULE_PARM(setup_hostid, "i"); 252module_param(setup_hostid, int, 0);
253 253
254 254
255#if defined(CONFIG_TT_DMA_EMUL) 255#if defined(CONFIG_TT_DMA_EMUL)
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/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 7b82ff090d42..2068b66822b7 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -3200,8 +3200,8 @@ iscsi_r2tpool_alloc(struct iscsi_session *session)
3200 * Data-Out PDU's within R2T-sequence can be quite big; 3200 * Data-Out PDU's within R2T-sequence can be quite big;
3201 * using mempool 3201 * using mempool
3202 */ 3202 */
3203 ctask->datapool = mempool_create(ISCSI_DTASK_DEFAULT_MAX, 3203 ctask->datapool = mempool_create_slab_pool(ISCSI_DTASK_DEFAULT_MAX,
3204 mempool_alloc_slab, mempool_free_slab, taskcache); 3204 taskcache);
3205 if (ctask->datapool == NULL) { 3205 if (ctask->datapool == NULL) {
3206 kfifo_free(ctask->r2tqueue); 3206 kfifo_free(ctask->r2tqueue);
3207 iscsi_pool_free(&ctask->r2tpool, (void**)ctask->r2ts); 3207 iscsi_pool_free(&ctask->r2tpool, (void**)ctask->r2ts);
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 5fdc3143ed15..83c92b19e7f4 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2017,13 +2017,12 @@ static unsigned int ata_bus_softreset(struct ata_port *ap,
2017 */ 2017 */
2018 msleep(150); 2018 msleep(150);
2019 2019
2020
2021 /* Before we perform post reset processing we want to see if 2020 /* Before we perform post reset processing we want to see if
2022 the bus shows 0xFF because the odd clown forgets the D7 pulldown 2021 * the bus shows 0xFF because the odd clown forgets the D7
2023 resistor */ 2022 * pulldown resistor.
2024 2023 */
2025 if (ata_check_status(ap) == 0xFF) 2024 if (ata_check_status(ap) == 0xFF)
2026 return 1; /* Positive is failure for some reason */ 2025 return AC_ERR_OTHER;
2027 2026
2028 ata_bus_post_reset(ap, devmask); 2027 ata_bus_post_reset(ap, devmask);
2029 2028
@@ -2643,6 +2642,10 @@ static int ata_dma_blacklisted(const struct ata_device *dev)
2643 * known limits including host controller limits, device 2642 * known limits including host controller limits, device
2644 * blacklist, etc... 2643 * blacklist, etc...
2645 * 2644 *
2645 * FIXME: The current implementation limits all transfer modes to
2646 * the fastest of the lowested device on the port. This is not
2647 * required on most controllers.
2648 *
2646 * LOCKING: 2649 * LOCKING:
2647 * None. 2650 * None.
2648 */ 2651 */
diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c
index 352df47bcaca..07017658ac56 100644
--- a/drivers/scsi/lpfc/lpfc_mem.c
+++ b/drivers/scsi/lpfc/lpfc_mem.c
@@ -38,18 +38,6 @@
38#define LPFC_MBUF_POOL_SIZE 64 /* max elements in MBUF safety pool */ 38#define LPFC_MBUF_POOL_SIZE 64 /* max elements in MBUF safety pool */
39#define LPFC_MEM_POOL_SIZE 64 /* max elem in non-DMA safety pool */ 39#define LPFC_MEM_POOL_SIZE 64 /* max elem in non-DMA safety pool */
40 40
41static void *
42lpfc_pool_kmalloc(gfp_t gfp_flags, void *data)
43{
44 return kmalloc((unsigned long)data, gfp_flags);
45}
46
47static void
48lpfc_pool_kfree(void *obj, void *data)
49{
50 kfree(obj);
51}
52
53int 41int
54lpfc_mem_alloc(struct lpfc_hba * phba) 42lpfc_mem_alloc(struct lpfc_hba * phba)
55{ 43{
@@ -79,15 +67,13 @@ lpfc_mem_alloc(struct lpfc_hba * phba)
79 pool->current_count++; 67 pool->current_count++;
80 } 68 }
81 69
82 phba->mbox_mem_pool = mempool_create(LPFC_MEM_POOL_SIZE, 70 phba->mbox_mem_pool = mempool_create_kmalloc_pool(LPFC_MEM_POOL_SIZE,
83 lpfc_pool_kmalloc, lpfc_pool_kfree, 71 sizeof(LPFC_MBOXQ_t));
84 (void *)(unsigned long)sizeof(LPFC_MBOXQ_t));
85 if (!phba->mbox_mem_pool) 72 if (!phba->mbox_mem_pool)
86 goto fail_free_mbuf_pool; 73 goto fail_free_mbuf_pool;
87 74
88 phba->nlp_mem_pool = mempool_create(LPFC_MEM_POOL_SIZE, 75 phba->nlp_mem_pool = mempool_create_kmalloc_pool(LPFC_MEM_POOL_SIZE,
89 lpfc_pool_kmalloc, lpfc_pool_kfree, 76 sizeof(struct lpfc_nodelist));
90 (void *)(unsigned long)sizeof(struct lpfc_nodelist));
91 if (!phba->nlp_mem_pool) 77 if (!phba->nlp_mem_pool)
92 goto fail_free_mbox_pool; 78 goto fail_free_mbox_pool;
93 79
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/mesh.c b/drivers/scsi/mesh.c
index d6d2125f9044..f852421002ef 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1748,7 +1748,7 @@ static int mesh_host_reset(struct scsi_cmnd *cmd)
1748 1748
1749static void set_mesh_power(struct mesh_state *ms, int state) 1749static void set_mesh_power(struct mesh_state *ms, int state)
1750{ 1750{
1751 if (_machine != _MACH_Pmac) 1751 if (!machine_is(powermac))
1752 return; 1752 return;
1753 if (state) { 1753 if (state) {
1754 pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 1); 1754 pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 1);
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/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 029bbf461bb2..017729c59a49 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2154,8 +2154,7 @@ qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
2154 int rval; 2154 int rval;
2155 2155
2156 rval = QLA_SUCCESS; 2156 rval = QLA_SUCCESS;
2157 ha->srb_mempool = mempool_create(SRB_MIN_REQ, mempool_alloc_slab, 2157 ha->srb_mempool = mempool_create_slab_pool(SRB_MIN_REQ, srb_cachep);
2158 mempool_free_slab, srb_cachep);
2159 if (ha->srb_mempool == NULL) { 2158 if (ha->srb_mempool == NULL) {
2160 qla_printk(KERN_INFO, ha, "Unable to allocate SRB mempool.\n"); 2159 qla_printk(KERN_INFO, ha, "Unable to allocate SRB mempool.\n");
2161 rval = QLA_FUNCTION_FAILED; 2160 rval = QLA_FUNCTION_FAILED;
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
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index ede158d08d9d..8f010a314a3d 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1787,9 +1787,8 @@ int __init scsi_init_queue(void)
1787 sgp->name); 1787 sgp->name);
1788 } 1788 }
1789 1789
1790 sgp->pool = mempool_create(SG_MEMPOOL_SIZE, 1790 sgp->pool = mempool_create_slab_pool(SG_MEMPOOL_SIZE,
1791 mempool_alloc_slab, mempool_free_slab, 1791 sgp->slab);
1792 sgp->slab);
1793 if (!sgp->pool) { 1792 if (!sgp->pool) {
1794 printk(KERN_ERR "SCSI: can't init sg mempool %s\n", 1793 printk(KERN_ERR "SCSI: can't init sg mempool %s\n",
1795 sgp->name); 1794 sgp->name);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 024ef86c5242..c647d85d97d1 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -190,7 +190,7 @@ static ssize_t sd_store_cache_type(struct class_device *cdev, const char *buf,
190 if (scsi_mode_sense(sdp, 0x08, 8, buffer, sizeof(buffer), SD_TIMEOUT, 190 if (scsi_mode_sense(sdp, 0x08, 8, buffer, sizeof(buffer), SD_TIMEOUT,
191 SD_MAX_RETRIES, &data, NULL)) 191 SD_MAX_RETRIES, &data, NULL))
192 return -EINVAL; 192 return -EINVAL;
193 len = min(sizeof(buffer), data.length - data.header_length - 193 len = min_t(size_t, sizeof(buffer), data.length - data.header_length -
194 data.block_descriptor_length); 194 data.block_descriptor_length);
195 buffer_data = buffer + data.header_length + 195 buffer_data = buffer + data.header_length +
196 data.block_descriptor_length; 196 data.block_descriptor_length;