diff options
Diffstat (limited to 'drivers/scsi/gdth.c')
-rw-r--r-- | drivers/scsi/gdth.c | 16 |
1 files changed, 10 insertions, 6 deletions
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 = { | |||
671 | static struct notifier_block gdth_notifier = { | 672 | static struct notifier_block gdth_notifier = { |
672 | gdth_halt, NULL, 0 | 673 | gdth_halt, NULL, 0 |
673 | }; | 674 | }; |
674 | 675 | static int notifier_disabled = 0; | |
675 | 676 | ||
676 | static void gdth_delay(int milliseconds) | 677 | static 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 | |||
4605 | static int gdth_release(struct Scsi_Host *shp) | 4606 | static 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 | ||