diff options
author | Joe Lawrence <joe.lawrence@stratus.com> | 2014-08-26 17:12:01 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-09-16 12:10:00 -0400 |
commit | 232792b6b43b1420324e432a0498602b9c8d5a8c (patch) | |
tree | 8d1b0a950b5a903205202c1212ccece8aa0e62d5 /drivers/scsi/qla2xxx | |
parent | c821e0d5b20006acdaca7aa378097a084986e37b (diff) |
qla2xxx: Schedule board_disable only once
There are various callers of qla2x00_check_reg{32,16}_for_disconnect
that may schedule board removal on PCI-disconnect. Test-and-set a
dedicated flag before scheduling board_disable so it is invoked only
once.
Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 14 |
2 files changed, 11 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index b64399153135..4267ec6f3258 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -3402,6 +3402,9 @@ typedef struct scsi_qla_host { | |||
3402 | #define FX00_CRITEMP_RECOVERY 25 | 3402 | #define FX00_CRITEMP_RECOVERY 25 |
3403 | #define FX00_HOST_INFO_RESEND 26 | 3403 | #define FX00_HOST_INFO_RESEND 26 |
3404 | 3404 | ||
3405 | unsigned long pci_flags; | ||
3406 | #define PFLG_DISCONNECTED 0 /* PCI device removed */ | ||
3407 | |||
3405 | uint32_t device_flags; | 3408 | uint32_t device_flags; |
3406 | #define SWITCH_FOUND BIT_0 | 3409 | #define SWITCH_FOUND BIT_0 |
3407 | #define DFLG_NO_CABLE BIT_1 | 3410 | #define DFLG_NO_CABLE BIT_1 |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 016ebed880f5..fd75b9139693 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -117,12 +117,14 @@ qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, uint32_t reg) | |||
117 | { | 117 | { |
118 | /* Check for PCI disconnection */ | 118 | /* Check for PCI disconnection */ |
119 | if (reg == 0xffffffff) { | 119 | if (reg == 0xffffffff) { |
120 | /* | 120 | if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags)) { |
121 | * Schedule this on the default system workqueue so that all the | 121 | /* |
122 | * adapter workqueues and the DPC thread can be shutdown | 122 | * Schedule this (only once) on the default system |
123 | * cleanly. | 123 | * workqueue so that all the adapter workqueues and the |
124 | */ | 124 | * DPC thread can be shutdown cleanly. |
125 | schedule_work(&vha->hw->board_disable); | 125 | */ |
126 | schedule_work(&vha->hw->board_disable); | ||
127 | } | ||
126 | return true; | 128 | return true; |
127 | } else | 129 | } else |
128 | return false; | 130 | return false; |