diff options
author | James Smart <james.smart@emulex.com> | 2013-10-10 12:20:35 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-10-25 04:58:17 -0400 |
commit | 4902b381c6c99e5edaca1e2549f0a5149d90feec (patch) | |
tree | 1d9918123ebea6427bff3b727cb2078b7b9a2f8a | |
parent | f7bc6434e20589596efbc1fc2bde6d0d78d6168c (diff) |
[SCSI] lpfc 8.3.43: Fixed spinlock inversion problem.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 612f48973ff2..5efe12e87a15 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -15098,6 +15098,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15098 | uint16_t max_rpi, rpi_limit; | 15098 | uint16_t max_rpi, rpi_limit; |
15099 | uint16_t rpi_remaining, lrpi = 0; | 15099 | uint16_t rpi_remaining, lrpi = 0; |
15100 | struct lpfc_rpi_hdr *rpi_hdr; | 15100 | struct lpfc_rpi_hdr *rpi_hdr; |
15101 | unsigned long iflag; | ||
15101 | 15102 | ||
15102 | max_rpi = phba->sli4_hba.max_cfg_param.max_rpi; | 15103 | max_rpi = phba->sli4_hba.max_cfg_param.max_rpi; |
15103 | rpi_limit = phba->sli4_hba.next_rpi; | 15104 | rpi_limit = phba->sli4_hba.next_rpi; |
@@ -15106,7 +15107,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15106 | * Fetch the next logical rpi. Because this index is logical, | 15107 | * Fetch the next logical rpi. Because this index is logical, |
15107 | * the driver starts at 0 each time. | 15108 | * the driver starts at 0 each time. |
15108 | */ | 15109 | */ |
15109 | spin_lock_irq(&phba->hbalock); | 15110 | spin_lock_irqsave(&phba->hbalock, iflag); |
15110 | rpi = find_next_zero_bit(phba->sli4_hba.rpi_bmask, rpi_limit, 0); | 15111 | rpi = find_next_zero_bit(phba->sli4_hba.rpi_bmask, rpi_limit, 0); |
15111 | if (rpi >= rpi_limit) | 15112 | if (rpi >= rpi_limit) |
15112 | rpi = LPFC_RPI_ALLOC_ERROR; | 15113 | rpi = LPFC_RPI_ALLOC_ERROR; |
@@ -15122,7 +15123,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15122 | */ | 15123 | */ |
15123 | if ((rpi == LPFC_RPI_ALLOC_ERROR) && | 15124 | if ((rpi == LPFC_RPI_ALLOC_ERROR) && |
15124 | (phba->sli4_hba.rpi_count >= max_rpi)) { | 15125 | (phba->sli4_hba.rpi_count >= max_rpi)) { |
15125 | spin_unlock_irq(&phba->hbalock); | 15126 | spin_unlock_irqrestore(&phba->hbalock, iflag); |
15126 | return rpi; | 15127 | return rpi; |
15127 | } | 15128 | } |
15128 | 15129 | ||
@@ -15131,7 +15132,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15131 | * extents. | 15132 | * extents. |
15132 | */ | 15133 | */ |
15133 | if (!phba->sli4_hba.rpi_hdrs_in_use) { | 15134 | if (!phba->sli4_hba.rpi_hdrs_in_use) { |
15134 | spin_unlock_irq(&phba->hbalock); | 15135 | spin_unlock_irqrestore(&phba->hbalock, iflag); |
15135 | return rpi; | 15136 | return rpi; |
15136 | } | 15137 | } |
15137 | 15138 | ||
@@ -15142,7 +15143,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15142 | * how many are supported max by the device. | 15143 | * how many are supported max by the device. |
15143 | */ | 15144 | */ |
15144 | rpi_remaining = phba->sli4_hba.next_rpi - phba->sli4_hba.rpi_count; | 15145 | rpi_remaining = phba->sli4_hba.next_rpi - phba->sli4_hba.rpi_count; |
15145 | spin_unlock_irq(&phba->hbalock); | 15146 | spin_unlock_irqrestore(&phba->hbalock, iflag); |
15146 | if (rpi_remaining < LPFC_RPI_LOW_WATER_MARK) { | 15147 | if (rpi_remaining < LPFC_RPI_LOW_WATER_MARK) { |
15147 | rpi_hdr = lpfc_sli4_create_rpi_hdr(phba); | 15148 | rpi_hdr = lpfc_sli4_create_rpi_hdr(phba); |
15148 | if (!rpi_hdr) { | 15149 | if (!rpi_hdr) { |