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

+55 -37
+4 -4
drivers/scsi/aha152x.c
··· 3830 iounmap(p); 3831 } 3832 if (!ok && setup_count == 0) 3833 - return 0; 3834 3835 printk(KERN_INFO "aha152x: BIOS test: passed, "); 3836 #else ··· 3909 #endif 3910 } 3911 3912 - return 1; 3913 } 3914 3915 static void __exit aha152x_exit(void) 3916 { 3917 - struct aha152x_hostdata *hd; 3918 3919 - list_for_each_entry(hd, &aha152x_host_list, host_list) { 3920 struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata); 3921 3922 aha152x_release(shost);
··· 3830 iounmap(p); 3831 } 3832 if (!ok && setup_count == 0) 3833 + return -ENODEV; 3834 3835 printk(KERN_INFO "aha152x: BIOS test: passed, "); 3836 #else ··· 3909 #endif 3910 } 3911 3912 + return 0; 3913 } 3914 3915 static void __exit aha152x_exit(void) 3916 { 3917 + struct aha152x_hostdata *hd, *tmp; 3918 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); 3921 3922 aha152x_release(shost);
+34 -17
drivers/scsi/gdth.c
··· 550 #endif /* CONFIG_ISA */ 551 552 #ifdef CONFIG_PCI 553 - static bool gdth_pci_registered; 554 555 static bool gdth_search_vortex(ushort device) 556 { ··· 3723 } 3724 3725 #ifdef GDTH_STATISTICS 3726 static void gdth_timeout(ulong data) 3727 { 3728 ulong32 i; ··· 3732 gdth_ha_str *ha; 3733 ulong flags; 3734 3735 - BUG_ON(list_empty(&gdth_instances)); 3736 3737 ha = list_first_entry(&gdth_instances, gdth_ha_str, list); 3738 spin_lock_irqsave(&ha->smp_lock, flags); ··· 3754 gdth_timer.expires = jiffies + 30 * HZ; 3755 add_timer(&gdth_timer); 3756 spin_unlock_irqrestore(&ha->smp_lock, flags); 3757 } 3758 #endif 3759 ··· 4755 if (error) 4756 goto out_free_coal_stat; 4757 list_add_tail(&ha->list, &gdth_instances); 4758 4759 scsi_scan_host(shp); 4760 ··· 4886 if (error) 4887 goto out_free_coal_stat; 4888 list_add_tail(&ha->list, &gdth_instances); 4889 4890 scsi_scan_host(shp); 4891 ··· 5033 list_add_tail(&ha->list, &gdth_instances); 5034 5035 pci_set_drvdata(ha->pdev, ha); 5036 5037 scsi_scan_host(shp); 5038 ··· 5133 /* initializations */ 5134 gdth_polling = TRUE; 5135 gdth_clear_events(); 5136 5137 /* As default we do not probe for EISA or ISA controllers */ 5138 if (probe_eisa_isa) { ··· 5156 5157 #ifdef CONFIG_PCI 5158 /* scanning for PCI controllers */ 5159 - if (pci_register_driver(&gdth_pci_driver) == 0) 5160 - gdth_pci_registered = true; 5161 #endif /* CONFIG_PCI */ 5162 5163 TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count)); 5164 5165 - if (list_empty(&gdth_instances)) 5166 - return -ENODEV; 5167 - 5168 - #ifdef GDTH_STATISTICS 5169 - TRACE2(("gdth_detect(): Initializing timer !\n")); 5170 - init_timer(&gdth_timer); 5171 - gdth_timer.expires = jiffies + HZ; 5172 - gdth_timer.data = 0L; 5173 - gdth_timer.function = gdth_timeout; 5174 - add_timer(&gdth_timer); 5175 - #endif 5176 major = register_chrdev(0,"gdth", &gdth_fops); 5177 register_reboot_notifier(&gdth_notifier); 5178 gdth_polling = FALSE; ··· 5185 #endif 5186 5187 #ifdef CONFIG_PCI 5188 - if (gdth_pci_registered) 5189 - pci_unregister_driver(&gdth_pci_driver); 5190 #endif 5191 5192 list_for_each_entry(ha, &gdth_instances, list)
··· 550 #endif /* CONFIG_ISA */ 551 552 #ifdef CONFIG_PCI 553 554 static bool gdth_search_vortex(ushort device) 555 { ··· 3724 } 3725 3726 #ifdef GDTH_STATISTICS 3727 + static unchar gdth_timer_running; 3728 + 3729 static void gdth_timeout(ulong data) 3730 { 3731 ulong32 i; ··· 3731 gdth_ha_str *ha; 3732 ulong flags; 3733 3734 + if(unlikely(list_empty(&gdth_instances))) { 3735 + gdth_timer_running = 0; 3736 + return; 3737 + } 3738 3739 ha = list_first_entry(&gdth_instances, gdth_ha_str, list); 3740 spin_lock_irqsave(&ha->smp_lock, flags); ··· 3750 gdth_timer.expires = jiffies + 30 * HZ; 3751 add_timer(&gdth_timer); 3752 spin_unlock_irqrestore(&ha->smp_lock, flags); 3753 + } 3754 + 3755 + static void gdth_timer_init(void) 3756 + { 3757 + if (gdth_timer_running) 3758 + return; 3759 + gdth_timer_running = 1; 3760 + TRACE2(("gdth_detect(): Initializing timer !\n")); 3761 + gdth_timer.expires = jiffies + HZ; 3762 + gdth_timer.data = 0L; 3763 + gdth_timer.function = gdth_timeout; 3764 + add_timer(&gdth_timer); 3765 + } 3766 + #else 3767 + static inline void gdth_timer_init(void) 3768 + { 3769 } 3770 #endif 3771 ··· 4735 if (error) 4736 goto out_free_coal_stat; 4737 list_add_tail(&ha->list, &gdth_instances); 4738 + gdth_timer_init(); 4739 4740 scsi_scan_host(shp); 4741 ··· 4865 if (error) 4866 goto out_free_coal_stat; 4867 list_add_tail(&ha->list, &gdth_instances); 4868 + gdth_timer_init(); 4869 4870 scsi_scan_host(shp); 4871 ··· 5011 list_add_tail(&ha->list, &gdth_instances); 5012 5013 pci_set_drvdata(ha->pdev, ha); 5014 + gdth_timer_init(); 5015 5016 scsi_scan_host(shp); 5017 ··· 5110 /* initializations */ 5111 gdth_polling = TRUE; 5112 gdth_clear_events(); 5113 + init_timer(&gdth_timer); 5114 5115 /* As default we do not probe for EISA or ISA controllers */ 5116 if (probe_eisa_isa) { ··· 5132 5133 #ifdef CONFIG_PCI 5134 /* scanning for PCI controllers */ 5135 + if (pci_register_driver(&gdth_pci_driver)) { 5136 + gdth_ha_str *ha; 5137 + 5138 + list_for_each_entry(ha, &gdth_instances, list) 5139 + gdth_remove_one(ha); 5140 + return -ENODEV; 5141 + } 5142 #endif /* CONFIG_PCI */ 5143 5144 TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count)); 5145 5146 major = register_chrdev(0,"gdth", &gdth_fops); 5147 register_reboot_notifier(&gdth_notifier); 5148 gdth_polling = FALSE; ··· 5167 #endif 5168 5169 #ifdef CONFIG_PCI 5170 + pci_unregister_driver(&gdth_pci_driver); 5171 #endif 5172 5173 list_for_each_entry(ha, &gdth_instances, list)
+15 -14
drivers/scsi/libiscsi.c
··· 730 if (iscsi_recv_pdu(conn->cls_conn, hdr, data, 731 datalen)) 732 rc = ISCSI_ERR_CONN_FAILED; 733 - } 734 iscsi_free_mgmt_task(conn, mtask); 735 break; 736 default: ··· 1455 { 1456 struct iscsi_conn *conn = (struct iscsi_conn *)data; 1457 struct iscsi_session *session = conn->session; 1458 - unsigned long timeout, next_timeout = 0, last_recv; 1459 1460 spin_lock(&session->lock); 1461 if (session->state != ISCSI_STATE_LOGGED_IN) 1462 goto done; 1463 1464 - timeout = conn->recv_timeout; 1465 - if (!timeout) 1466 goto done; 1467 1468 - timeout *= HZ; 1469 last_recv = conn->last_recv; 1470 - if (time_before_eq(last_recv + timeout + (conn->ping_timeout * HZ), 1471 jiffies)) { 1472 iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs " 1473 "expired, last rx %lu, last ping %lu, " ··· 1479 return; 1480 } 1481 1482 - if (time_before_eq(last_recv + timeout, jiffies)) { 1483 - if (time_before_eq(conn->last_ping, last_recv)) { 1484 - /* send a ping to try to provoke some traffic */ 1485 - debug_scsi("Sending nopout as ping on conn %p\n", conn); 1486 - iscsi_send_nopout(conn, NULL); 1487 - } 1488 - next_timeout = last_recv + timeout + (conn->ping_timeout * HZ); 1489 } else 1490 - next_timeout = last_recv + timeout; 1491 1492 debug_scsi("Setting next tmo %lu\n", next_timeout); 1493 mod_timer(&conn->transport_timer, next_timeout);
··· 730 if (iscsi_recv_pdu(conn->cls_conn, hdr, data, 731 datalen)) 732 rc = ISCSI_ERR_CONN_FAILED; 733 + } else 734 + mod_timer(&conn->transport_timer, 735 + jiffies + conn->recv_timeout); 736 iscsi_free_mgmt_task(conn, mtask); 737 break; 738 default: ··· 1453 { 1454 struct iscsi_conn *conn = (struct iscsi_conn *)data; 1455 struct iscsi_session *session = conn->session; 1456 + unsigned long recv_timeout, next_timeout = 0, last_recv; 1457 1458 spin_lock(&session->lock); 1459 if (session->state != ISCSI_STATE_LOGGED_IN) 1460 goto done; 1461 1462 + recv_timeout = conn->recv_timeout; 1463 + if (!recv_timeout) 1464 goto done; 1465 1466 + recv_timeout *= HZ; 1467 last_recv = conn->last_recv; 1468 + if (conn->ping_mtask && 1469 + time_before_eq(conn->last_ping + (conn->ping_timeout * HZ), 1470 jiffies)) { 1471 iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs " 1472 "expired, last rx %lu, last ping %lu, " ··· 1476 return; 1477 } 1478 1479 + if (time_before_eq(last_recv + recv_timeout, jiffies)) { 1480 + /* send a ping to try to provoke some traffic */ 1481 + debug_scsi("Sending nopout as ping on conn %p\n", conn); 1482 + iscsi_send_nopout(conn, NULL); 1483 + next_timeout = conn->last_ping + (conn->ping_timeout * HZ); 1484 } else 1485 + next_timeout = last_recv + recv_timeout; 1486 1487 debug_scsi("Setting next tmo %lu\n", next_timeout); 1488 mod_timer(&conn->transport_timer, next_timeout);
+2 -2
drivers/scsi/qla1280.c
··· 2007 nv->bus[bus].config_2.req_ack_active_negation = 1; 2008 nv->bus[bus].config_2.data_line_active_negation = 1; 2009 nv->bus[bus].selection_timeout = 250; 2010 - nv->bus[bus].max_queue_depth = 256; 2011 2012 if (IS_ISP1040(ha)) { 2013 nv->bus[bus].bus_reset_delay = 3; ··· 2051 status = qla1280_mailbox_command(ha, 0x0f, mb); 2052 2053 /* Save Tag queuing enable flag. */ 2054 - flag = (BIT_0 << target) & mb[0]; 2055 if (nv->bus[bus].target[target].parameter.tag_queuing) 2056 ha->bus_settings[bus].qtag_enables |= flag; 2057
··· 2007 nv->bus[bus].config_2.req_ack_active_negation = 1; 2008 nv->bus[bus].config_2.data_line_active_negation = 1; 2009 nv->bus[bus].selection_timeout = 250; 2010 + nv->bus[bus].max_queue_depth = 32; 2011 2012 if (IS_ISP1040(ha)) { 2013 nv->bus[bus].bus_reset_delay = 3; ··· 2051 status = qla1280_mailbox_command(ha, 0x0f, mb); 2052 2053 /* Save Tag queuing enable flag. */ 2054 + flag = (BIT_0 << target); 2055 if (nv->bus[bus].target[target].parameter.tag_queuing) 2056 ha->bus_settings[bus].qtag_enables |= flag; 2057