Commit 9604006d authored by Linus Torvalds's avatar Linus Torvalds

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
parents 25c55d97 af5741c6
...@@ -3830,7 +3830,7 @@ static int __init aha152x_init(void) ...@@ -3830,7 +3830,7 @@ static int __init aha152x_init(void)
iounmap(p); iounmap(p);
} }
if (!ok && setup_count == 0) if (!ok && setup_count == 0)
return 0; return -ENODEV;
printk(KERN_INFO "aha152x: BIOS test: passed, "); printk(KERN_INFO "aha152x: BIOS test: passed, ");
#else #else
...@@ -3909,14 +3909,14 @@ static int __init aha152x_init(void) ...@@ -3909,14 +3909,14 @@ static int __init aha152x_init(void)
#endif #endif
} }
return 1; return 0;
} }
static void __exit aha152x_exit(void) static void __exit aha152x_exit(void)
{ {
struct aha152x_hostdata *hd; struct aha152x_hostdata *hd, *tmp;
list_for_each_entry(hd, &aha152x_host_list, host_list) { list_for_each_entry_safe(hd, tmp, &aha152x_host_list, host_list) {
struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata); struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata);
aha152x_release(shost); aha152x_release(shost);
......
...@@ -550,7 +550,6 @@ static int __init gdth_search_isa(ulong32 bios_adr) ...@@ -550,7 +550,6 @@ static int __init gdth_search_isa(ulong32 bios_adr)
#endif /* CONFIG_ISA */ #endif /* CONFIG_ISA */
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static bool gdth_pci_registered;
static bool gdth_search_vortex(ushort device) static bool gdth_search_vortex(ushort device)
{ {
...@@ -3724,6 +3723,8 @@ static void gdth_log_event(gdth_evt_data *dvr, char *buffer) ...@@ -3724,6 +3723,8 @@ static void gdth_log_event(gdth_evt_data *dvr, char *buffer)
} }
#ifdef GDTH_STATISTICS #ifdef GDTH_STATISTICS
static unchar gdth_timer_running;
static void gdth_timeout(ulong data) static void gdth_timeout(ulong data)
{ {
ulong32 i; ulong32 i;
...@@ -3731,7 +3732,10 @@ static void gdth_timeout(ulong data) ...@@ -3731,7 +3732,10 @@ static void gdth_timeout(ulong data)
gdth_ha_str *ha; gdth_ha_str *ha;
ulong flags; ulong flags;
BUG_ON(list_empty(&gdth_instances)); if(unlikely(list_empty(&gdth_instances))) {
gdth_timer_running = 0;
return;
}
ha = list_first_entry(&gdth_instances, gdth_ha_str, list); ha = list_first_entry(&gdth_instances, gdth_ha_str, list);
spin_lock_irqsave(&ha->smp_lock, flags); spin_lock_irqsave(&ha->smp_lock, flags);
...@@ -3751,6 +3755,22 @@ static void gdth_timeout(ulong data) ...@@ -3751,6 +3755,22 @@ static void gdth_timeout(ulong data)
add_timer(&gdth_timer); add_timer(&gdth_timer);
spin_unlock_irqrestore(&ha->smp_lock, flags); spin_unlock_irqrestore(&ha->smp_lock, flags);
} }
static void gdth_timer_init(void)
{
if (gdth_timer_running)
return;
gdth_timer_running = 1;
TRACE2(("gdth_detect(): Initializing timer !\n"));
gdth_timer.expires = jiffies + HZ;
gdth_timer.data = 0L;
gdth_timer.function = gdth_timeout;
add_timer(&gdth_timer);
}
#else
static inline void gdth_timer_init(void)
{
}
#endif #endif
static void __init internal_setup(char *str,int *ints) static void __init internal_setup(char *str,int *ints)
...@@ -4735,6 +4755,7 @@ static int __init gdth_isa_probe_one(ulong32 isa_bios) ...@@ -4735,6 +4755,7 @@ static int __init gdth_isa_probe_one(ulong32 isa_bios)
if (error) if (error)
goto out_free_coal_stat; goto out_free_coal_stat;
list_add_tail(&ha->list, &gdth_instances); list_add_tail(&ha->list, &gdth_instances);
gdth_timer_init();
scsi_scan_host(shp); scsi_scan_host(shp);
...@@ -4865,6 +4886,7 @@ static int __init gdth_eisa_probe_one(ushort eisa_slot) ...@@ -4865,6 +4886,7 @@ static int __init gdth_eisa_probe_one(ushort eisa_slot)
if (error) if (error)
goto out_free_coal_stat; goto out_free_coal_stat;
list_add_tail(&ha->list, &gdth_instances); list_add_tail(&ha->list, &gdth_instances);
gdth_timer_init();
scsi_scan_host(shp); scsi_scan_host(shp);
...@@ -5011,6 +5033,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, ...@@ -5011,6 +5033,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr,
list_add_tail(&ha->list, &gdth_instances); list_add_tail(&ha->list, &gdth_instances);
pci_set_drvdata(ha->pdev, ha); pci_set_drvdata(ha->pdev, ha);
gdth_timer_init();
scsi_scan_host(shp); scsi_scan_host(shp);
...@@ -5110,6 +5133,7 @@ static int __init gdth_init(void) ...@@ -5110,6 +5133,7 @@ static int __init gdth_init(void)
/* initializations */ /* initializations */
gdth_polling = TRUE; gdth_polling = TRUE;
gdth_clear_events(); gdth_clear_events();
init_timer(&gdth_timer);
/* As default we do not probe for EISA or ISA controllers */ /* As default we do not probe for EISA or ISA controllers */
if (probe_eisa_isa) { if (probe_eisa_isa) {
...@@ -5132,23 +5156,17 @@ static int __init gdth_init(void) ...@@ -5132,23 +5156,17 @@ static int __init gdth_init(void)
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
/* scanning for PCI controllers */ /* scanning for PCI controllers */
if (pci_register_driver(&gdth_pci_driver) == 0) if (pci_register_driver(&gdth_pci_driver)) {
gdth_pci_registered = true; gdth_ha_str *ha;
list_for_each_entry(ha, &gdth_instances, list)
gdth_remove_one(ha);
return -ENODEV;
}
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count)); TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count));
if (list_empty(&gdth_instances))
return -ENODEV;
#ifdef GDTH_STATISTICS
TRACE2(("gdth_detect(): Initializing timer !\n"));
init_timer(&gdth_timer);
gdth_timer.expires = jiffies + HZ;
gdth_timer.data = 0L;
gdth_timer.function = gdth_timeout;
add_timer(&gdth_timer);
#endif
major = register_chrdev(0,"gdth", &gdth_fops); major = register_chrdev(0,"gdth", &gdth_fops);
register_reboot_notifier(&gdth_notifier); register_reboot_notifier(&gdth_notifier);
gdth_polling = FALSE; gdth_polling = FALSE;
...@@ -5167,8 +5185,7 @@ static void __exit gdth_exit(void) ...@@ -5167,8 +5185,7 @@ static void __exit gdth_exit(void)
#endif #endif
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
if (gdth_pci_registered) pci_unregister_driver(&gdth_pci_driver);
pci_unregister_driver(&gdth_pci_driver);
#endif #endif
list_for_each_entry(ha, &gdth_instances, list) list_for_each_entry(ha, &gdth_instances, list)
......
...@@ -730,7 +730,9 @@ static int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, ...@@ -730,7 +730,9 @@ static int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
if (iscsi_recv_pdu(conn->cls_conn, hdr, data, if (iscsi_recv_pdu(conn->cls_conn, hdr, data,
datalen)) datalen))
rc = ISCSI_ERR_CONN_FAILED; rc = ISCSI_ERR_CONN_FAILED;
} } else
mod_timer(&conn->transport_timer,
jiffies + conn->recv_timeout);
iscsi_free_mgmt_task(conn, mtask); iscsi_free_mgmt_task(conn, mtask);
break; break;
default: default:
...@@ -1453,19 +1455,20 @@ static void iscsi_check_transport_timeouts(unsigned long data) ...@@ -1453,19 +1455,20 @@ static void iscsi_check_transport_timeouts(unsigned long data)
{ {
struct iscsi_conn *conn = (struct iscsi_conn *)data; struct iscsi_conn *conn = (struct iscsi_conn *)data;
struct iscsi_session *session = conn->session; struct iscsi_session *session = conn->session;
unsigned long timeout, next_timeout = 0, last_recv; unsigned long recv_timeout, next_timeout = 0, last_recv;
spin_lock(&session->lock); spin_lock(&session->lock);
if (session->state != ISCSI_STATE_LOGGED_IN) if (session->state != ISCSI_STATE_LOGGED_IN)
goto done; goto done;
timeout = conn->recv_timeout; recv_timeout = conn->recv_timeout;
if (!timeout) if (!recv_timeout)
goto done; goto done;
timeout *= HZ; recv_timeout *= HZ;
last_recv = conn->last_recv; last_recv = conn->last_recv;
if (time_before_eq(last_recv + timeout + (conn->ping_timeout * HZ), if (conn->ping_mtask &&
time_before_eq(conn->last_ping + (conn->ping_timeout * HZ),
jiffies)) { jiffies)) {
iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs " iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs "
"expired, last rx %lu, last ping %lu, " "expired, last rx %lu, last ping %lu, "
...@@ -1476,15 +1479,13 @@ static void iscsi_check_transport_timeouts(unsigned long data) ...@@ -1476,15 +1479,13 @@ static void iscsi_check_transport_timeouts(unsigned long data)
return; return;
} }
if (time_before_eq(last_recv + timeout, jiffies)) { if (time_before_eq(last_recv + recv_timeout, jiffies)) {
if (time_before_eq(conn->last_ping, last_recv)) { /* send a ping to try to provoke some traffic */
/* send a ping to try to provoke some traffic */ debug_scsi("Sending nopout as ping on conn %p\n", conn);
debug_scsi("Sending nopout as ping on conn %p\n", conn); iscsi_send_nopout(conn, NULL);
iscsi_send_nopout(conn, NULL); next_timeout = conn->last_ping + (conn->ping_timeout * HZ);
}
next_timeout = last_recv + timeout + (conn->ping_timeout * HZ);
} else } else
next_timeout = last_recv + timeout; next_timeout = last_recv + recv_timeout;
debug_scsi("Setting next tmo %lu\n", next_timeout); debug_scsi("Setting next tmo %lu\n", next_timeout);
mod_timer(&conn->transport_timer, next_timeout); mod_timer(&conn->transport_timer, next_timeout);
......
...@@ -2007,7 +2007,7 @@ qla1280_set_defaults(struct scsi_qla_host *ha) ...@@ -2007,7 +2007,7 @@ qla1280_set_defaults(struct scsi_qla_host *ha)
nv->bus[bus].config_2.req_ack_active_negation = 1; nv->bus[bus].config_2.req_ack_active_negation = 1;
nv->bus[bus].config_2.data_line_active_negation = 1; nv->bus[bus].config_2.data_line_active_negation = 1;
nv->bus[bus].selection_timeout = 250; nv->bus[bus].selection_timeout = 250;
nv->bus[bus].max_queue_depth = 256; nv->bus[bus].max_queue_depth = 32;
if (IS_ISP1040(ha)) { if (IS_ISP1040(ha)) {
nv->bus[bus].bus_reset_delay = 3; nv->bus[bus].bus_reset_delay = 3;
...@@ -2051,7 +2051,7 @@ qla1280_config_target(struct scsi_qla_host *ha, int bus, int target) ...@@ -2051,7 +2051,7 @@ qla1280_config_target(struct scsi_qla_host *ha, int bus, int target)
status = qla1280_mailbox_command(ha, 0x0f, mb); status = qla1280_mailbox_command(ha, 0x0f, mb);
/* Save Tag queuing enable flag. */ /* Save Tag queuing enable flag. */
flag = (BIT_0 << target) & mb[0]; flag = (BIT_0 << target);
if (nv->bus[bus].target[target].parameter.tag_queuing) if (nv->bus[bus].target[target].parameter.tag_queuing)
ha->bus_settings[bus].qtag_enables |= flag; ha->bus_settings[bus].qtag_enables |= flag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment