Commit 232792b6 authored by Joe Lawrence's avatar Joe Lawrence Committed by Christoph Hellwig

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: default avatarJoe Lawrence <joe.lawrence@stratus.com>
Acked-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent c821e0d5
...@@ -3402,6 +3402,9 @@ typedef struct scsi_qla_host { ...@@ -3402,6 +3402,9 @@ typedef struct scsi_qla_host {
#define FX00_CRITEMP_RECOVERY 25 #define FX00_CRITEMP_RECOVERY 25
#define FX00_HOST_INFO_RESEND 26 #define FX00_HOST_INFO_RESEND 26
unsigned long pci_flags;
#define PFLG_DISCONNECTED 0 /* PCI device removed */
uint32_t device_flags; uint32_t device_flags;
#define SWITCH_FOUND BIT_0 #define SWITCH_FOUND BIT_0
#define DFLG_NO_CABLE BIT_1 #define DFLG_NO_CABLE BIT_1
......
...@@ -117,12 +117,14 @@ qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, uint32_t reg) ...@@ -117,12 +117,14 @@ qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, uint32_t reg)
{ {
/* Check for PCI disconnection */ /* Check for PCI disconnection */
if (reg == 0xffffffff) { if (reg == 0xffffffff) {
/* if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags)) {
* Schedule this on the default system workqueue so that all the /*
* adapter workqueues and the DPC thread can be shutdown * Schedule this (only once) on the default system
* cleanly. * workqueue so that all the adapter workqueues and the
*/ * DPC thread can be shutdown cleanly.
schedule_work(&vha->hw->board_disable); */
schedule_work(&vha->hw->board_disable);
}
return true; return true;
} else } else
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment