Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33589
b: refs/heads/master
c: a90f568
h: refs/heads/master
i:
  33587: 01b51d9
v: v3
  • Loading branch information
James Smart authored and James Bottomley committed Aug 19, 2006
1 parent 7fde0a9 commit bc8bea6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33ccf8d1080bdccb4751a92f6da361a6e01b7cc0
refs/heads/master: a90f56847e8df9034c1c05d1157e1b0cd96987fb
19 changes: 19 additions & 0 deletions trunk/drivers/scsi/lpfc/lpfc_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/delay.h>

#include <scsi/scsi.h>
#include <scsi/scsi_device.h>
Expand Down Expand Up @@ -841,6 +842,21 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
return 0;
}

static void
lpfc_block_error_handler(struct scsi_cmnd *cmnd)
{
struct Scsi_Host *shost = cmnd->device->host;
struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));

spin_lock_irq(shost->host_lock);
while (rport->port_state == FC_PORTSTATE_BLOCKED) {
spin_unlock_irq(shost->host_lock);
msleep(1000);
spin_lock_irq(shost->host_lock);
}
spin_unlock_irq(shost->host_lock);
return;
}

static int
lpfc_abort_handler(struct scsi_cmnd *cmnd)
Expand All @@ -855,6 +871,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
unsigned int loop_count = 0;
int ret = SUCCESS;

lpfc_block_error_handler(cmnd);
spin_lock_irq(shost->host_lock);

lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble;
Expand Down Expand Up @@ -957,6 +974,7 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
int ret = FAILED;
int cnt, loopcnt;

lpfc_block_error_handler(cmnd);
spin_lock_irq(shost->host_lock);
/*
* If target is not in a MAPPED state, delay the reset until
Expand Down Expand Up @@ -1073,6 +1091,7 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
int cnt, loopcnt;
struct lpfc_scsi_buf * lpfc_cmd;

lpfc_block_error_handler(cmnd);
spin_lock_irq(shost->host_lock);

lpfc_cmd = lpfc_get_scsi_buf(phba);
Expand Down

0 comments on commit bc8bea6

Please sign in to comment.