aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/qla1280.c99
1 files changed, 10 insertions, 89 deletions
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 5defe5ea5eda..0cbad4982db9 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -435,7 +435,6 @@ static int qla1280_mailbox_command(struct scsi_qla_host *,
435 uint8_t, uint16_t *); 435 uint8_t, uint16_t *);
436static int qla1280_bus_reset(struct scsi_qla_host *, int); 436static int qla1280_bus_reset(struct scsi_qla_host *, int);
437static int qla1280_device_reset(struct scsi_qla_host *, int, int); 437static int qla1280_device_reset(struct scsi_qla_host *, int, int);
438static int qla1280_abort_device(struct scsi_qla_host *, int, int, int);
439static int qla1280_abort_command(struct scsi_qla_host *, struct srb *, int); 438static int qla1280_abort_command(struct scsi_qla_host *, struct srb *, int);
440static int qla1280_abort_isp(struct scsi_qla_host *); 439static int qla1280_abort_isp(struct scsi_qla_host *);
441#ifdef QLA_64BIT_PTR 440#ifdef QLA_64BIT_PTR
@@ -698,7 +697,7 @@ qla1280_info(struct Scsi_Host *host)
698} 697}
699 698
700/************************************************************************** 699/**************************************************************************
701 * qla1200_queuecommand 700 * qla1280_queuecommand
702 * Queue a command to the controller. 701 * Queue a command to the controller.
703 * 702 *
704 * Note: 703 * Note:
@@ -713,7 +712,7 @@ qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
713{ 712{
714 struct Scsi_Host *host = cmd->device->host; 713 struct Scsi_Host *host = cmd->device->host;
715 struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; 714 struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
716 struct srb *sp = (struct srb *)&cmd->SCp; 715 struct srb *sp = (struct srb *)CMD_SP(cmd);
717 int status; 716 int status;
718 717
719 cmd->scsi_done = fn; 718 cmd->scsi_done = fn;
@@ -738,11 +737,9 @@ qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
738 737
739enum action { 738enum action {
740 ABORT_COMMAND, 739 ABORT_COMMAND,
741 ABORT_DEVICE,
742 DEVICE_RESET, 740 DEVICE_RESET,
743 BUS_RESET, 741 BUS_RESET,
744 ADAPTER_RESET, 742 ADAPTER_RESET,
745 FAIL
746}; 743};
747 744
748/* timer action for error action processor */ 745/* timer action for error action processor */
@@ -768,7 +765,7 @@ static void qla1280_mailbox_timeout(unsigned long __data)
768} 765}
769 766
770/************************************************************************** 767/**************************************************************************
771 * qla1200_error_action 768 * qla1280_error_action
772 * The function will attempt to perform a specified error action and 769 * The function will attempt to perform a specified error action and
773 * wait for the results (or time out). 770 * wait for the results (or time out).
774 * 771 *
@@ -798,6 +795,8 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
798 DECLARE_COMPLETION_ONSTACK(wait); 795 DECLARE_COMPLETION_ONSTACK(wait);
799 struct timer_list timer; 796 struct timer_list timer;
800 797
798 ENTER("qla1280_error_action");
799
801 ha = (struct scsi_qla_host *)(CMD_HOST(cmd)->hostdata); 800 ha = (struct scsi_qla_host *)(CMD_HOST(cmd)->hostdata);
802 801
803 dprintk(4, "error_action %i, istatus 0x%04x\n", action, 802 dprintk(4, "error_action %i, istatus 0x%04x\n", action,
@@ -807,20 +806,11 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
807 RD_REG_WORD(&ha->iobase->host_cmd), 806 RD_REG_WORD(&ha->iobase->host_cmd),
808 RD_REG_WORD(&ha->iobase->ictrl), jiffies); 807 RD_REG_WORD(&ha->iobase->ictrl), jiffies);
809 808
810 ENTER("qla1280_error_action");
811 if (qla1280_verbose) 809 if (qla1280_verbose)
812 printk(KERN_INFO "scsi(%li): Resetting Cmnd=0x%p, " 810 printk(KERN_INFO "scsi(%li): Resetting Cmnd=0x%p, "
813 "Handle=0x%p, action=0x%x\n", 811 "Handle=0x%p, action=0x%x\n",
814 ha->host_no, cmd, CMD_HANDLE(cmd), action); 812 ha->host_no, cmd, CMD_HANDLE(cmd), action);
815 813
816 if (cmd == NULL) {
817 printk(KERN_WARNING "(scsi?:?:?:?) Reset called with NULL "
818 "si_Cmnd pointer, failing.\n");
819 LEAVE("qla1280_error_action");
820 return FAILED;
821 }
822
823 ha = (struct scsi_qla_host *)cmd->device->host->hostdata;
824 sp = (struct srb *)CMD_SP(cmd); 814 sp = (struct srb *)CMD_SP(cmd);
825 handle = CMD_HANDLE(cmd); 815 handle = CMD_HANDLE(cmd);
826 816
@@ -857,9 +847,6 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
857 * mean the actual success or fail of the action */ 847 * mean the actual success or fail of the action */
858 result = FAILED; 848 result = FAILED;
859 switch (action) { 849 switch (action) {
860 case FAIL:
861 break;
862
863 case ABORT_COMMAND: 850 case ABORT_COMMAND:
864 if ((sp->flags & SRB_ABORT_PENDING)) { 851 if ((sp->flags & SRB_ABORT_PENDING)) {
865 printk(KERN_WARNING 852 printk(KERN_WARNING
@@ -893,15 +880,6 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
893 } 880 }
894 break; 881 break;
895 882
896 case ABORT_DEVICE:
897 if (qla1280_verbose)
898 printk(KERN_INFO
899 "scsi(%ld:%d:%d:%d): Queueing abort device "
900 "command.\n", ha->host_no, bus, target, lun);
901 if (qla1280_abort_device(ha, bus, target, lun) == 0)
902 result = SUCCESS;
903 break;
904
905 case DEVICE_RESET: 883 case DEVICE_RESET:
906 if (qla1280_verbose) 884 if (qla1280_verbose)
907 printk(KERN_INFO 885 printk(KERN_INFO
@@ -1285,8 +1263,6 @@ qla1280_done(struct scsi_qla_host *ha)
1285 case DID_ABORT: 1263 case DID_ABORT:
1286 sp->flags &= ~SRB_ABORT_PENDING; 1264 sp->flags &= ~SRB_ABORT_PENDING;
1287 sp->flags |= SRB_ABORTED; 1265 sp->flags |= SRB_ABORTED;
1288 if (sp->flags & SRB_TIMEOUT)
1289 CMD_RESULT(sp->cmd) = DID_TIME_OUT << 16;
1290 break; 1266 break;
1291 default: 1267 default:
1292 break; 1268 break;
@@ -2417,9 +2393,6 @@ static int
2417qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb) 2393qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb)
2418{ 2394{
2419 struct device_reg __iomem *reg = ha->iobase; 2395 struct device_reg __iomem *reg = ha->iobase;
2420#if 0
2421 LIST_HEAD(done_q);
2422#endif
2423 int status = 0; 2396 int status = 0;
2424 int cnt; 2397 int cnt;
2425 uint16_t *optr, *iptr; 2398 uint16_t *optr, *iptr;
@@ -2493,19 +2466,9 @@ qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb)
2493 mr = MAILBOX_REGISTER_COUNT; 2466 mr = MAILBOX_REGISTER_COUNT;
2494 memcpy(optr, iptr, MAILBOX_REGISTER_COUNT * sizeof(uint16_t)); 2467 memcpy(optr, iptr, MAILBOX_REGISTER_COUNT * sizeof(uint16_t));
2495 2468
2496#if 0
2497 /* Go check for any response interrupts pending. */
2498 qla1280_isr(ha, &done_q);
2499#endif
2500
2501 if (ha->flags.reset_marker) 2469 if (ha->flags.reset_marker)
2502 qla1280_rst_aen(ha); 2470 qla1280_rst_aen(ha);
2503 2471
2504#if 0
2505 if (!list_empty(&done_q))
2506 qla1280_done(ha, &done_q);
2507#endif
2508
2509 if (status) 2472 if (status)
2510 dprintk(2, "qla1280_mailbox_command: **** FAILED, mailbox0 = " 2473 dprintk(2, "qla1280_mailbox_command: **** FAILED, mailbox0 = "
2511 "0x%x ****\n", mb[0]); 2474 "0x%x ****\n", mb[0]);
@@ -2641,41 +2604,6 @@ qla1280_device_reset(struct scsi_qla_host *ha, int bus, int target)
2641} 2604}
2642 2605
2643/* 2606/*
2644 * qla1280_abort_device
2645 * Issue an abort message to the device
2646 *
2647 * Input:
2648 * ha = adapter block pointer.
2649 * bus = SCSI BUS.
2650 * target = SCSI ID.
2651 * lun = SCSI LUN.
2652 *
2653 * Returns:
2654 * 0 = success
2655 */
2656static int
2657qla1280_abort_device(struct scsi_qla_host *ha, int bus, int target, int lun)
2658{
2659 uint16_t mb[MAILBOX_REGISTER_COUNT];
2660 int status;
2661
2662 ENTER("qla1280_abort_device");
2663
2664 mb[0] = MBC_ABORT_DEVICE;
2665 mb[1] = (bus ? target | BIT_7 : target) << 8 | lun;
2666 status = qla1280_mailbox_command(ha, BIT_1 | BIT_0, &mb[0]);
2667
2668 /* Issue marker command. */
2669 qla1280_marker(ha, bus, target, lun, MK_SYNC_ID_LUN);
2670
2671 if (status)
2672 dprintk(2, "qla1280_abort_device: **** FAILED ****\n");
2673
2674 LEAVE("qla1280_abort_device");
2675 return status;
2676}
2677
2678/*
2679 * qla1280_abort_command 2607 * qla1280_abort_command
2680 * Abort command aborts a specified IOCB. 2608 * Abort command aborts a specified IOCB.
2681 * 2609 *
@@ -2833,7 +2761,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
2833 2761
2834 /* If room for request in request ring. */ 2762 /* If room for request in request ring. */
2835 if ((req_cnt + 2) >= ha->req_q_cnt) { 2763 if ((req_cnt + 2) >= ha->req_q_cnt) {
2836 status = 1; 2764 status = SCSI_MLQUEUE_HOST_BUSY;
2837 dprintk(2, "qla1280_start_scsi: in-ptr=0x%x req_q_cnt=" 2765 dprintk(2, "qla1280_start_scsi: in-ptr=0x%x req_q_cnt="
2838 "0x%xreq_cnt=0x%x", ha->req_ring_index, ha->req_q_cnt, 2766 "0x%xreq_cnt=0x%x", ha->req_ring_index, ha->req_q_cnt,
2839 req_cnt); 2767 req_cnt);
@@ -2845,7 +2773,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
2845 ha->outstanding_cmds[cnt] != NULL; cnt++); 2773 ha->outstanding_cmds[cnt] != NULL; cnt++);
2846 2774
2847 if (cnt >= MAX_OUTSTANDING_COMMANDS) { 2775 if (cnt >= MAX_OUTSTANDING_COMMANDS) {
2848 status = 1; 2776 status = SCSI_MLQUEUE_HOST_BUSY;
2849 dprintk(2, "qla1280_start_scsi: NO ROOM IN " 2777 dprintk(2, "qla1280_start_scsi: NO ROOM IN "
2850 "OUTSTANDING ARRAY, req_q_cnt=0x%x", ha->req_q_cnt); 2778 "OUTSTANDING ARRAY, req_q_cnt=0x%x", ha->req_q_cnt);
2851 goto out; 2779 goto out;
@@ -3108,7 +3036,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
3108 ha->req_q_cnt, seg_cnt); 3036 ha->req_q_cnt, seg_cnt);
3109 /* If room for request in request ring. */ 3037 /* If room for request in request ring. */
3110 if ((req_cnt + 2) >= ha->req_q_cnt) { 3038 if ((req_cnt + 2) >= ha->req_q_cnt) {
3111 status = 1; 3039 status = SCSI_MLQUEUE_HOST_BUSY;
3112 dprintk(2, "qla1280_32bit_start_scsi: in-ptr=0x%x, " 3040 dprintk(2, "qla1280_32bit_start_scsi: in-ptr=0x%x, "
3113 "req_q_cnt=0x%x, req_cnt=0x%x", ha->req_ring_index, 3041 "req_q_cnt=0x%x, req_cnt=0x%x", ha->req_ring_index,
3114 ha->req_q_cnt, req_cnt); 3042 ha->req_q_cnt, req_cnt);
@@ -3120,7 +3048,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
3120 (ha->outstanding_cmds[cnt] != 0); cnt++) ; 3048 (ha->outstanding_cmds[cnt] != 0); cnt++) ;
3121 3049
3122 if (cnt >= MAX_OUTSTANDING_COMMANDS) { 3050 if (cnt >= MAX_OUTSTANDING_COMMANDS) {
3123 status = 1; 3051 status = SCSI_MLQUEUE_HOST_BUSY;
3124 dprintk(2, "qla1280_32bit_start_scsi: NO ROOM IN OUTSTANDING " 3052 dprintk(2, "qla1280_32bit_start_scsi: NO ROOM IN OUTSTANDING "
3125 "ARRAY, req_q_cnt=0x%x\n", ha->req_q_cnt); 3053 "ARRAY, req_q_cnt=0x%x\n", ha->req_q_cnt);
3126 goto out; 3054 goto out;
@@ -3495,7 +3423,7 @@ qla1280_isr(struct scsi_qla_host *ha, struct list_head *done_q)
3495 * If we get here we have a real problem! 3423 * If we get here we have a real problem!
3496 */ 3424 */
3497 printk(KERN_WARNING 3425 printk(KERN_WARNING
3498 "qla1280: ISP invalid handle"); 3426 "qla1280: ISP invalid handle\n");
3499 } 3427 }
3500 } 3428 }
3501 break; 3429 break;
@@ -3955,13 +3883,6 @@ qla1280_check_for_dead_scsi_bus(struct scsi_qla_host *ha, unsigned int bus)
3955 3883
3956 if (scsi_control == SCSI_PHASE_INVALID) { 3884 if (scsi_control == SCSI_PHASE_INVALID) {
3957 ha->bus_settings[bus].scsi_bus_dead = 1; 3885 ha->bus_settings[bus].scsi_bus_dead = 1;
3958#if 0
3959 CMD_RESULT(cp) = DID_NO_CONNECT << 16;
3960 CMD_HANDLE(cp) = INVALID_HANDLE;
3961 /* ha->actthreads--; */
3962
3963 (*(cp)->scsi_done)(cp);
3964#endif
3965 return 1; /* bus is dead */ 3886 return 1; /* bus is dead */
3966 } else { 3887 } else {
3967 ha->bus_settings[bus].scsi_bus_dead = 0; 3888 ha->bus_settings[bus].scsi_bus_dead = 0;