diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-13 14:24:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-13 14:24:51 -0400 |
commit | 9604006d283fb67dda5ee9e0e15b7cc6c62e1557 (patch) | |
tree | 8e9ddc101dc9e167f1b21c3a7f7a4ffdd4dea04a /drivers/scsi | |
parent | 25c55d97209090db1a5f601815433f085bd1af78 (diff) | |
parent | af5741c6de4f4a1d8608b0f00867c77cb7123635 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
[SCSI] qla1280: Fix queue depth problem
[SCSI] aha152x: Fix oops on module removal
[SCSI] aha152x: fix init suspiciously returned 1, it should follow 0/-E convention
[SCSI] libiscsi regression in 2.6.25: fix setting of recv timer
[SCSI] libiscsi regression in 2.6.25: fix nop timer handling
[SCSI] gdth: fix Error: Driver 'gdth' is already registered, aborting...
[SCSI] gdth: fix timer handling
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aha152x.c | 8 | ||||
-rw-r--r-- | drivers/scsi/gdth.c | 51 | ||||
-rw-r--r-- | drivers/scsi/libiscsi.c | 29 | ||||
-rw-r--r-- | drivers/scsi/qla1280.c | 4 |
4 files changed, 55 insertions, 37 deletions
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index f5215fd4b73d..1dca1775f4b1 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c | |||
@@ -3830,7 +3830,7 @@ static int __init aha152x_init(void) | |||
3830 | iounmap(p); | 3830 | iounmap(p); |
3831 | } | 3831 | } |
3832 | if (!ok && setup_count == 0) | 3832 | if (!ok && setup_count == 0) |
3833 | return 0; | 3833 | return -ENODEV; |
3834 | 3834 | ||
3835 | printk(KERN_INFO "aha152x: BIOS test: passed, "); | 3835 | printk(KERN_INFO "aha152x: BIOS test: passed, "); |
3836 | #else | 3836 | #else |
@@ -3909,14 +3909,14 @@ static int __init aha152x_init(void) | |||
3909 | #endif | 3909 | #endif |
3910 | } | 3910 | } |
3911 | 3911 | ||
3912 | return 1; | 3912 | return 0; |
3913 | } | 3913 | } |
3914 | 3914 | ||
3915 | static void __exit aha152x_exit(void) | 3915 | static void __exit aha152x_exit(void) |
3916 | { | 3916 | { |
3917 | struct aha152x_hostdata *hd; | 3917 | struct aha152x_hostdata *hd, *tmp; |
3918 | 3918 | ||
3919 | list_for_each_entry(hd, &aha152x_host_list, host_list) { | 3919 | list_for_each_entry_safe(hd, tmp, &aha152x_host_list, host_list) { |
3920 | struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata); | 3920 | struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata); |
3921 | 3921 | ||
3922 | aha152x_release(shost); | 3922 | aha152x_release(shost); |
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 8e2e964af668..46771d4c81bd 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -550,7 +550,6 @@ static int __init gdth_search_isa(ulong32 bios_adr) | |||
550 | #endif /* CONFIG_ISA */ | 550 | #endif /* CONFIG_ISA */ |
551 | 551 | ||
552 | #ifdef CONFIG_PCI | 552 | #ifdef CONFIG_PCI |
553 | static bool gdth_pci_registered; | ||
554 | 553 | ||
555 | static bool gdth_search_vortex(ushort device) | 554 | static bool gdth_search_vortex(ushort device) |
556 | { | 555 | { |
@@ -3724,6 +3723,8 @@ static void gdth_log_event(gdth_evt_data *dvr, char *buffer) | |||
3724 | } | 3723 | } |
3725 | 3724 | ||
3726 | #ifdef GDTH_STATISTICS | 3725 | #ifdef GDTH_STATISTICS |
3726 | static unchar gdth_timer_running; | ||
3727 | |||
3727 | static void gdth_timeout(ulong data) | 3728 | static void gdth_timeout(ulong data) |
3728 | { | 3729 | { |
3729 | ulong32 i; | 3730 | ulong32 i; |
@@ -3731,7 +3732,10 @@ static void gdth_timeout(ulong data) | |||
3731 | gdth_ha_str *ha; | 3732 | gdth_ha_str *ha; |
3732 | ulong flags; | 3733 | ulong flags; |
3733 | 3734 | ||
3734 | BUG_ON(list_empty(&gdth_instances)); | 3735 | if(unlikely(list_empty(&gdth_instances))) { |
3736 | gdth_timer_running = 0; | ||
3737 | return; | ||
3738 | } | ||
3735 | 3739 | ||
3736 | ha = list_first_entry(&gdth_instances, gdth_ha_str, list); | 3740 | ha = list_first_entry(&gdth_instances, gdth_ha_str, list); |
3737 | spin_lock_irqsave(&ha->smp_lock, flags); | 3741 | spin_lock_irqsave(&ha->smp_lock, flags); |
@@ -3751,6 +3755,22 @@ static void gdth_timeout(ulong data) | |||
3751 | add_timer(&gdth_timer); | 3755 | add_timer(&gdth_timer); |
3752 | spin_unlock_irqrestore(&ha->smp_lock, flags); | 3756 | spin_unlock_irqrestore(&ha->smp_lock, flags); |
3753 | } | 3757 | } |
3758 | |||
3759 | static void gdth_timer_init(void) | ||
3760 | { | ||
3761 | if (gdth_timer_running) | ||
3762 | return; | ||
3763 | gdth_timer_running = 1; | ||
3764 | TRACE2(("gdth_detect(): Initializing timer !\n")); | ||
3765 | gdth_timer.expires = jiffies + HZ; | ||
3766 | gdth_timer.data = 0L; | ||
3767 | gdth_timer.function = gdth_timeout; | ||
3768 | add_timer(&gdth_timer); | ||
3769 | } | ||
3770 | #else | ||
3771 | static inline void gdth_timer_init(void) | ||
3772 | { | ||
3773 | } | ||
3754 | #endif | 3774 | #endif |
3755 | 3775 | ||
3756 | static void __init internal_setup(char *str,int *ints) | 3776 | static void __init internal_setup(char *str,int *ints) |
@@ -4735,6 +4755,7 @@ static int __init gdth_isa_probe_one(ulong32 isa_bios) | |||
4735 | if (error) | 4755 | if (error) |
4736 | goto out_free_coal_stat; | 4756 | goto out_free_coal_stat; |
4737 | list_add_tail(&ha->list, &gdth_instances); | 4757 | list_add_tail(&ha->list, &gdth_instances); |
4758 | gdth_timer_init(); | ||
4738 | 4759 | ||
4739 | scsi_scan_host(shp); | 4760 | scsi_scan_host(shp); |
4740 | 4761 | ||
@@ -4865,6 +4886,7 @@ static int __init gdth_eisa_probe_one(ushort eisa_slot) | |||
4865 | if (error) | 4886 | if (error) |
4866 | goto out_free_coal_stat; | 4887 | goto out_free_coal_stat; |
4867 | list_add_tail(&ha->list, &gdth_instances); | 4888 | list_add_tail(&ha->list, &gdth_instances); |
4889 | gdth_timer_init(); | ||
4868 | 4890 | ||
4869 | scsi_scan_host(shp); | 4891 | scsi_scan_host(shp); |
4870 | 4892 | ||
@@ -5011,6 +5033,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, | |||
5011 | list_add_tail(&ha->list, &gdth_instances); | 5033 | list_add_tail(&ha->list, &gdth_instances); |
5012 | 5034 | ||
5013 | pci_set_drvdata(ha->pdev, ha); | 5035 | pci_set_drvdata(ha->pdev, ha); |
5036 | gdth_timer_init(); | ||
5014 | 5037 | ||
5015 | scsi_scan_host(shp); | 5038 | scsi_scan_host(shp); |
5016 | 5039 | ||
@@ -5110,6 +5133,7 @@ static int __init gdth_init(void) | |||
5110 | /* initializations */ | 5133 | /* initializations */ |
5111 | gdth_polling = TRUE; | 5134 | gdth_polling = TRUE; |
5112 | gdth_clear_events(); | 5135 | gdth_clear_events(); |
5136 | init_timer(&gdth_timer); | ||
5113 | 5137 | ||
5114 | /* As default we do not probe for EISA or ISA controllers */ | 5138 | /* As default we do not probe for EISA or ISA controllers */ |
5115 | if (probe_eisa_isa) { | 5139 | if (probe_eisa_isa) { |
@@ -5132,23 +5156,17 @@ static int __init gdth_init(void) | |||
5132 | 5156 | ||
5133 | #ifdef CONFIG_PCI | 5157 | #ifdef CONFIG_PCI |
5134 | /* scanning for PCI controllers */ | 5158 | /* scanning for PCI controllers */ |
5135 | if (pci_register_driver(&gdth_pci_driver) == 0) | 5159 | if (pci_register_driver(&gdth_pci_driver)) { |
5136 | gdth_pci_registered = true; | 5160 | gdth_ha_str *ha; |
5161 | |||
5162 | list_for_each_entry(ha, &gdth_instances, list) | ||
5163 | gdth_remove_one(ha); | ||
5164 | return -ENODEV; | ||
5165 | } | ||
5137 | #endif /* CONFIG_PCI */ | 5166 | #endif /* CONFIG_PCI */ |
5138 | 5167 | ||
5139 | TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count)); | 5168 | TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count)); |
5140 | 5169 | ||
5141 | if (list_empty(&gdth_instances)) | ||
5142 | return -ENODEV; | ||
5143 | |||
5144 | #ifdef GDTH_STATISTICS | ||
5145 | TRACE2(("gdth_detect(): Initializing timer !\n")); | ||
5146 | init_timer(&gdth_timer); | ||
5147 | gdth_timer.expires = jiffies + HZ; | ||
5148 | gdth_timer.data = 0L; | ||
5149 | gdth_timer.function = gdth_timeout; | ||
5150 | add_timer(&gdth_timer); | ||
5151 | #endif | ||
5152 | major = register_chrdev(0,"gdth", &gdth_fops); | 5170 | major = register_chrdev(0,"gdth", &gdth_fops); |
5153 | register_reboot_notifier(&gdth_notifier); | 5171 | register_reboot_notifier(&gdth_notifier); |
5154 | gdth_polling = FALSE; | 5172 | gdth_polling = FALSE; |
@@ -5167,8 +5185,7 @@ static void __exit gdth_exit(void) | |||
5167 | #endif | 5185 | #endif |
5168 | 5186 | ||
5169 | #ifdef CONFIG_PCI | 5187 | #ifdef CONFIG_PCI |
5170 | if (gdth_pci_registered) | 5188 | pci_unregister_driver(&gdth_pci_driver); |
5171 | pci_unregister_driver(&gdth_pci_driver); | ||
5172 | #endif | 5189 | #endif |
5173 | 5190 | ||
5174 | list_for_each_entry(ha, &gdth_instances, list) | 5191 | list_for_each_entry(ha, &gdth_instances, list) |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 010c1b9b178c..b43bf1d60dac 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -730,7 +730,9 @@ static int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, | |||
730 | if (iscsi_recv_pdu(conn->cls_conn, hdr, data, | 730 | if (iscsi_recv_pdu(conn->cls_conn, hdr, data, |
731 | datalen)) | 731 | datalen)) |
732 | rc = ISCSI_ERR_CONN_FAILED; | 732 | rc = ISCSI_ERR_CONN_FAILED; |
733 | } | 733 | } else |
734 | mod_timer(&conn->transport_timer, | ||
735 | jiffies + conn->recv_timeout); | ||
734 | iscsi_free_mgmt_task(conn, mtask); | 736 | iscsi_free_mgmt_task(conn, mtask); |
735 | break; | 737 | break; |
736 | default: | 738 | default: |
@@ -1453,19 +1455,20 @@ static void iscsi_check_transport_timeouts(unsigned long data) | |||
1453 | { | 1455 | { |
1454 | struct iscsi_conn *conn = (struct iscsi_conn *)data; | 1456 | struct iscsi_conn *conn = (struct iscsi_conn *)data; |
1455 | struct iscsi_session *session = conn->session; | 1457 | struct iscsi_session *session = conn->session; |
1456 | unsigned long timeout, next_timeout = 0, last_recv; | 1458 | unsigned long recv_timeout, next_timeout = 0, last_recv; |
1457 | 1459 | ||
1458 | spin_lock(&session->lock); | 1460 | spin_lock(&session->lock); |
1459 | if (session->state != ISCSI_STATE_LOGGED_IN) | 1461 | if (session->state != ISCSI_STATE_LOGGED_IN) |
1460 | goto done; | 1462 | goto done; |
1461 | 1463 | ||
1462 | timeout = conn->recv_timeout; | 1464 | recv_timeout = conn->recv_timeout; |
1463 | if (!timeout) | 1465 | if (!recv_timeout) |
1464 | goto done; | 1466 | goto done; |
1465 | 1467 | ||
1466 | timeout *= HZ; | 1468 | recv_timeout *= HZ; |
1467 | last_recv = conn->last_recv; | 1469 | last_recv = conn->last_recv; |
1468 | if (time_before_eq(last_recv + timeout + (conn->ping_timeout * HZ), | 1470 | if (conn->ping_mtask && |
1471 | time_before_eq(conn->last_ping + (conn->ping_timeout * HZ), | ||
1469 | jiffies)) { | 1472 | jiffies)) { |
1470 | iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs " | 1473 | iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs " |
1471 | "expired, last rx %lu, last ping %lu, " | 1474 | "expired, last rx %lu, last ping %lu, " |
@@ -1476,15 +1479,13 @@ static void iscsi_check_transport_timeouts(unsigned long data) | |||
1476 | return; | 1479 | return; |
1477 | } | 1480 | } |
1478 | 1481 | ||
1479 | if (time_before_eq(last_recv + timeout, jiffies)) { | 1482 | if (time_before_eq(last_recv + recv_timeout, jiffies)) { |
1480 | if (time_before_eq(conn->last_ping, last_recv)) { | 1483 | /* send a ping to try to provoke some traffic */ |
1481 | /* send a ping to try to provoke some traffic */ | 1484 | debug_scsi("Sending nopout as ping on conn %p\n", conn); |
1482 | debug_scsi("Sending nopout as ping on conn %p\n", conn); | 1485 | iscsi_send_nopout(conn, NULL); |
1483 | iscsi_send_nopout(conn, NULL); | 1486 | next_timeout = conn->last_ping + (conn->ping_timeout * HZ); |
1484 | } | ||
1485 | next_timeout = last_recv + timeout + (conn->ping_timeout * HZ); | ||
1486 | } else | 1487 | } else |
1487 | next_timeout = last_recv + timeout; | 1488 | next_timeout = last_recv + recv_timeout; |
1488 | 1489 | ||
1489 | debug_scsi("Setting next tmo %lu\n", next_timeout); | 1490 | debug_scsi("Setting next tmo %lu\n", next_timeout); |
1490 | mod_timer(&conn->transport_timer, next_timeout); | 1491 | mod_timer(&conn->transport_timer, next_timeout); |
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index fa060932d2b4..51e2f299dbbb 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c | |||
@@ -2007,7 +2007,7 @@ qla1280_set_defaults(struct scsi_qla_host *ha) | |||
2007 | nv->bus[bus].config_2.req_ack_active_negation = 1; | 2007 | nv->bus[bus].config_2.req_ack_active_negation = 1; |
2008 | nv->bus[bus].config_2.data_line_active_negation = 1; | 2008 | nv->bus[bus].config_2.data_line_active_negation = 1; |
2009 | nv->bus[bus].selection_timeout = 250; | 2009 | nv->bus[bus].selection_timeout = 250; |
2010 | nv->bus[bus].max_queue_depth = 256; | 2010 | nv->bus[bus].max_queue_depth = 32; |
2011 | 2011 | ||
2012 | if (IS_ISP1040(ha)) { | 2012 | if (IS_ISP1040(ha)) { |
2013 | nv->bus[bus].bus_reset_delay = 3; | 2013 | nv->bus[bus].bus_reset_delay = 3; |
@@ -2051,7 +2051,7 @@ qla1280_config_target(struct scsi_qla_host *ha, int bus, int target) | |||
2051 | status = qla1280_mailbox_command(ha, 0x0f, mb); | 2051 | status = qla1280_mailbox_command(ha, 0x0f, mb); |
2052 | 2052 | ||
2053 | /* Save Tag queuing enable flag. */ | 2053 | /* Save Tag queuing enable flag. */ |
2054 | flag = (BIT_0 << target) & mb[0]; | 2054 | flag = (BIT_0 << target); |
2055 | if (nv->bus[bus].target[target].parameter.tag_queuing) | 2055 | if (nv->bus[bus].target[target].parameter.tag_queuing) |
2056 | ha->bus_settings[bus].qtag_enables |= flag; | 2056 | ha->bus_settings[bus].qtag_enables |= flag; |
2057 | 2057 | ||