Michael Chan says: ==================== bnxt_en: Error recovery bug fixes. Two error recovery related bug fixes for 2 corner cases. Please queue patch #2 for -stable. Thanks. ====================
Unified · Split
| @@ -8556,10 +8556,18 @@ static void bnxt_setup_inta(struct bnxt *bp) · 8555 unmodified lines | ||
| 8556 | 8556 | bp->irq_tbl[0].handler = bnxt_inta; |
| 8557 | 8557 | } |
| 8558 | 8558 | |
| 8559 | +static int bnxt_init_int_mode(struct bnxt *bp); | |
| 8560 | + | |
| 8559 | 8561 | static int bnxt_setup_int_mode(struct bnxt *bp) |
| 8560 | 8562 | { |
| 8561 | 8563 | int rc; |
| 8562 | 8564 | |
| 8565 | + if (!bp->irq_tbl) { | |
| 8566 | + rc = bnxt_init_int_mode(bp); | |
| 8567 | + if (rc || !bp->irq_tbl) | |
| 8568 | + return rc ?: -ENODEV; | |
| 8569 | + } | |
| 8570 | + | |
| 8563 | 8571 | if (bp->flags & BNXT_FLAG_USING_MSIX) |
| 8564 | 8572 | bnxt_setup_msix(bp); |
| 8565 | 8573 | else |
| @@ -8744,7 +8752,7 @@ static int bnxt_init_inta(struct bnxt *bp) · 178 unmodified lines | ||
| 8744 | 8752 | |
| 8745 | 8753 | static int bnxt_init_int_mode(struct bnxt *bp) |
| 8746 | 8754 | { |
| 8747 | − int rc = 0; | |
| 8755 | + int rc = -ENODEV; | |
| 8748 | 8756 | |
| 8749 | 8757 | if (bp->flags & BNXT_FLAG_MSIX_CAP) |
| 8750 | 8758 | rc = bnxt_init_msix(bp); |
| @@ -9514,7 +9522,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up) · 763 unmodified lines | ||
| 9514 | 9522 | { |
| 9515 | 9523 | struct hwrm_func_drv_if_change_output *resp = bp->hwrm_cmd_resp_addr; |
| 9516 | 9524 | struct hwrm_func_drv_if_change_input req = {0}; |
| 9517 | − bool resc_reinit = false, fw_reset = false; | |
| 9525 | + bool fw_reset = !bp->irq_tbl; | |
| 9526 | + bool resc_reinit = false; | |
| 9518 | 9527 | int rc, retry = 0; |
| 9519 | 9528 | u32 flags = 0; |
| 9520 | 9529 | |
| @@ -9557,6 +9566,7 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up) · 36 unmodified lines | ||
| 9557 | 9566 | |
| 9558 | 9567 | if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) { |
| 9559 | 9568 | netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n"); |
| 9569 | + set_bit(BNXT_STATE_ABORT_ERR, &bp->state); | |
| 9560 | 9570 | return -ENODEV; |
| 9561 | 9571 | } |
| 9562 | 9572 | if (resc_reinit || fw_reset) { |
| @@ -9890,6 +9900,9 @@ static int bnxt_reinit_after_abort(struct bnxt *bp) · 327 unmodified lines | ||
| 9890 | 9900 | if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) |
| 9891 | 9901 | return -EBUSY; |
| 9892 | 9902 | |
| 9903 | + if (bp->dev->reg_state == NETREG_UNREGISTERED) | |
| 9904 | + return -ENODEV; | |
| 9905 | + | |
| 9893 | 9906 | rc = bnxt_fw_init_one(bp); |
| 9894 | 9907 | if (!rc) { |
| 9895 | 9908 | bnxt_clear_int_mode(bp); |