aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-06-15 17:06:48 -0400
committerTony Luck <tony.luck@intel.com>2005-06-15 17:06:48 -0400
commitf2cbb4f01936a3e4225692e03b084b78c56d386d (patch)
treef89f3d8baa250589a38a4dd2df56f84cddae3c76 /drivers/scsi/qla2xxx
parent325a479c4c110db278ef3361460a48c4093252cc (diff)
parent1016888fb69662936b32ab767c7419a3be9a69d3 (diff)
Auto merge with /home/aegl/GIT/linus
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c8
-rw-r--r--drivers/scsi/qla2xxx/qla_gbl.h4
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c27
3 files changed, 18 insertions, 21 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 2240a0cde583..9bc1f153f7ea 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -300,7 +300,7 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
300 rport->dev_loss_tmo = ha->port_down_retry_count + 5; 300 rport->dev_loss_tmo = ha->port_down_retry_count + 5;
301} 301}
302 302
303static struct fc_function_template qla2xxx_transport_functions = { 303struct fc_function_template qla2xxx_transport_functions = {
304 304
305 .show_host_node_name = 1, 305 .show_host_node_name = 1,
306 .show_host_port_name = 1, 306 .show_host_port_name = 1,
@@ -322,12 +322,6 @@ static struct fc_function_template qla2xxx_transport_functions = {
322 322
323}; 323};
324 324
325struct scsi_transport_template *
326qla2x00_alloc_transport_tmpl(void)
327{
328 return (fc_attach_transport(&qla2xxx_transport_functions));
329}
330
331void 325void
332qla2x00_init_host_attr(scsi_qla_host_t *ha) 326qla2x00_init_host_attr(scsi_qla_host_t *ha)
333{ 327{
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index e4bfe4d5bbe4..2efec6c24d60 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -24,7 +24,6 @@
24#define __QLA_GBL_H 24#define __QLA_GBL_H
25 25
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <scsi/scsi_transport.h>
28 27
29extern void qla2x00_remove_one(struct pci_dev *); 28extern void qla2x00_remove_one(struct pci_dev *);
30extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *); 29extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *);
@@ -248,9 +247,10 @@ extern void qla2x00_cancel_io_descriptors(scsi_qla_host_t *);
248/* 247/*
249 * Global Function Prototypes in qla_attr.c source file. 248 * Global Function Prototypes in qla_attr.c source file.
250 */ 249 */
250struct fc_function_template;
251extern struct fc_function_template qla2xxx_transport_functions;
251extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); 252extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
252extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); 253extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
253extern struct scsi_transport_template *qla2x00_alloc_transport_tmpl(void);
254extern void qla2x00_init_host_attr(scsi_qla_host_t *); 254extern void qla2x00_init_host_attr(scsi_qla_host_t *);
255extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); 255extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
256extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); 256extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 84db911318c6..3c97aa45772d 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -507,6 +507,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
507 int ret, i; 507 int ret, i;
508 unsigned int id, lun; 508 unsigned int id, lun;
509 unsigned long serial; 509 unsigned long serial;
510 unsigned long flags;
510 511
511 if (!CMD_SP(cmd)) 512 if (!CMD_SP(cmd))
512 return FAILED; 513 return FAILED;
@@ -519,7 +520,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
519 520
520 /* Check active list for command command. */ 521 /* Check active list for command command. */
521 spin_unlock_irq(ha->host->host_lock); 522 spin_unlock_irq(ha->host->host_lock);
522 spin_lock(&ha->hardware_lock); 523 spin_lock_irqsave(&ha->hardware_lock, flags);
523 for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) { 524 for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
524 sp = ha->outstanding_cmds[i]; 525 sp = ha->outstanding_cmds[i];
525 526
@@ -534,7 +535,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
534 sp->state)); 535 sp->state));
535 DEBUG3(qla2x00_print_scsi_cmd(cmd);) 536 DEBUG3(qla2x00_print_scsi_cmd(cmd);)
536 537
537 spin_unlock(&ha->hardware_lock); 538 spin_unlock_irqrestore(&ha->hardware_lock, flags);
538 if (qla2x00_abort_command(ha, sp)) { 539 if (qla2x00_abort_command(ha, sp)) {
539 DEBUG2(printk("%s(%ld): abort_command " 540 DEBUG2(printk("%s(%ld): abort_command "
540 "mbx failed.\n", __func__, ha->host_no)); 541 "mbx failed.\n", __func__, ha->host_no));
@@ -543,20 +544,19 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
543 "mbx success.\n", __func__, ha->host_no)); 544 "mbx success.\n", __func__, ha->host_no));
544 ret = SUCCESS; 545 ret = SUCCESS;
545 } 546 }
546 spin_lock(&ha->hardware_lock); 547 spin_lock_irqsave(&ha->hardware_lock, flags);
547 548
548 break; 549 break;
549 } 550 }
551 spin_unlock_irqrestore(&ha->hardware_lock, flags);
550 552
551 /* Wait for the command to be returned. */ 553 /* Wait for the command to be returned. */
552 if (ret == SUCCESS) { 554 if (ret == SUCCESS) {
553 spin_unlock(&ha->hardware_lock);
554 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 555 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
555 qla_printk(KERN_ERR, ha, 556 qla_printk(KERN_ERR, ha,
556 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 557 "scsi(%ld:%d:%d): Abort handler timed out -- %lx "
557 "%x.\n", ha->host_no, id, lun, serial, ret); 558 "%x.\n", ha->host_no, id, lun, serial, ret);
558 } 559 }
559 spin_lock(&ha->hardware_lock);
560 } 560 }
561 spin_lock_irq(ha->host->host_lock); 561 spin_lock_irq(ha->host->host_lock);
562 562
@@ -588,6 +588,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
588 int status; 588 int status;
589 srb_t *sp; 589 srb_t *sp;
590 struct scsi_cmnd *cmd; 590 struct scsi_cmnd *cmd;
591 unsigned long flags;
591 592
592 status = 0; 593 status = 0;
593 594
@@ -596,11 +597,11 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
596 * array 597 * array
597 */ 598 */
598 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { 599 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
599 spin_lock(&ha->hardware_lock); 600 spin_lock_irqsave(&ha->hardware_lock, flags);
600 sp = ha->outstanding_cmds[cnt]; 601 sp = ha->outstanding_cmds[cnt];
601 if (sp) { 602 if (sp) {
602 cmd = sp->cmd; 603 cmd = sp->cmd;
603 spin_unlock(&ha->hardware_lock); 604 spin_unlock_irqrestore(&ha->hardware_lock, flags);
604 if (cmd->device->id == t) { 605 if (cmd->device->id == t) {
605 if (!qla2x00_eh_wait_on_command(ha, cmd)) { 606 if (!qla2x00_eh_wait_on_command(ha, cmd)) {
606 status = 1; 607 status = 1;
@@ -608,7 +609,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
608 } 609 }
609 } 610 }
610 } else { 611 } else {
611 spin_unlock(&ha->hardware_lock); 612 spin_unlock_irqrestore(&ha->hardware_lock, flags);
612 } 613 }
613 } 614 }
614 return (status); 615 return (status);
@@ -740,6 +741,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
740 int status; 741 int status;
741 srb_t *sp; 742 srb_t *sp;
742 struct scsi_cmnd *cmd; 743 struct scsi_cmnd *cmd;
744 unsigned long flags;
743 745
744 status = 1; 746 status = 1;
745 747
@@ -748,17 +750,17 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
748 * array 750 * array
749 */ 751 */
750 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { 752 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
751 spin_lock(&ha->hardware_lock); 753 spin_lock_irqsave(&ha->hardware_lock, flags);
752 sp = ha->outstanding_cmds[cnt]; 754 sp = ha->outstanding_cmds[cnt];
753 if (sp) { 755 if (sp) {
754 cmd = sp->cmd; 756 cmd = sp->cmd;
755 spin_unlock(&ha->hardware_lock); 757 spin_unlock_irqrestore(&ha->hardware_lock, flags);
756 status = qla2x00_eh_wait_on_command(ha, cmd); 758 status = qla2x00_eh_wait_on_command(ha, cmd);
757 if (status == 0) 759 if (status == 0)
758 break; 760 break;
759 } 761 }
760 else { 762 else {
761 spin_unlock(&ha->hardware_lock); 763 spin_unlock_irqrestore(&ha->hardware_lock, flags);
762 } 764 }
763 } 765 }
764 return (status); 766 return (status);
@@ -2350,7 +2352,8 @@ qla2x00_module_init(void)
2350#if DEBUG_QLA2100 2352#if DEBUG_QLA2100
2351 strcat(qla2x00_version_str, "-debug"); 2353 strcat(qla2x00_version_str, "-debug");
2352#endif 2354#endif
2353 qla2xxx_transport_template = qla2x00_alloc_transport_tmpl(); 2355 qla2xxx_transport_template =
2356 fc_attach_transport(&qla2xxx_transport_functions);
2354 if (!qla2xxx_transport_template) 2357 if (!qla2xxx_transport_template)
2355 return -ENODEV; 2358 return -ENODEV;
2356 2359