[SCSI] qla2xxx: Stall mid-layer error handlers while rport is blocked.

Stall error handler if attempting recovery while an rport is
blocked. This avoids device offline scenarios due to errors in
the error handler.

Reference implementation from lpfc/mptfc.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by Andrew Vasquez and committed by James Bottomley 07db5183 bb8ee499

+25
+25
drivers/scsi/qla2xxx/qla_os.c
··· 589 return (return_status); 590 } 591 592 /************************************************************************** 593 * qla2xxx_eh_abort 594 * ··· 631 unsigned long serial; 632 unsigned long flags; 633 int wait = 0; 634 635 if (!CMD_SP(cmd)) 636 return SUCCESS; ··· 767 unsigned int id, lun; 768 unsigned long serial; 769 770 ret = FAILED; 771 772 id = cmd->device->id; ··· 898 unsigned int id, lun; 899 unsigned long serial; 900 901 ret = FAILED; 902 903 id = cmd->device->id; ··· 958 int ret; 959 unsigned int id, lun; 960 unsigned long serial; 961 962 ret = FAILED; 963
··· 589 return (return_status); 590 } 591 592 + static void 593 + qla2x00_block_error_handler(struct scsi_cmnd *cmnd) 594 + { 595 + struct Scsi_Host *shost = cmnd->device->host; 596 + struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device)); 597 + unsigned long flags; 598 + 599 + spin_lock_irqsave(shost->host_lock, flags); 600 + while (rport->port_state == FC_PORTSTATE_BLOCKED) { 601 + spin_unlock_irqrestore(shost->host_lock, flags); 602 + msleep(1000); 603 + spin_lock_irqsave(shost->host_lock, flags); 604 + } 605 + spin_unlock_irqrestore(shost->host_lock, flags); 606 + return; 607 + } 608 + 609 /************************************************************************** 610 * qla2xxx_eh_abort 611 * ··· 614 unsigned long serial; 615 unsigned long flags; 616 int wait = 0; 617 + 618 + qla2x00_block_error_handler(cmd); 619 620 if (!CMD_SP(cmd)) 621 return SUCCESS; ··· 748 unsigned int id, lun; 749 unsigned long serial; 750 751 + qla2x00_block_error_handler(cmd); 752 + 753 ret = FAILED; 754 755 id = cmd->device->id; ··· 877 unsigned int id, lun; 878 unsigned long serial; 879 880 + qla2x00_block_error_handler(cmd); 881 + 882 ret = FAILED; 883 884 id = cmd->device->id; ··· 935 int ret; 936 unsigned int id, lun; 937 unsigned long serial; 938 + 939 + qla2x00_block_error_handler(cmd); 940 941 ret = FAILED; 942