• Joe Lawrence's avatar
    qla2xxx: Prevent removal and board_disable race · beb9e315
    Joe Lawrence authored
    Introduce mutual exclusion between the qla2xxx_remove_one PCI driver
    callback and qla2x00_disable_board_on_pci_error, which is scheduled as
    board_disable work by qla2x00_check_reg{32,16}_for_disconnect:
    
    * Leave the driver-specific data attached to the underlying PCI device
    intact in qla2x00_disable_board_on_pci_error, so that qla2x00_remove_one
    has enough breadcrumbs to determine that any board_disable work has been
    completed.
    
    * In qla2xxx_remove_one, set a bit to prevent any subsequent
    board_disable work from scheduling, then cancel and wait until pending
    work has completed.
    
    * Reuse the PCI device enable count check in qla2x00_remove_one to
    determine if board_disable has occured. The original purpose of this
    check was unnecessary since the driver remove function wasn't called
    when the probe fails.
    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>
    beb9e315
qla_isr.c 83.9 KB