Commit 4902b381 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.3.43: Fixed spinlock inversion problem.

Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent f7bc6434
...@@ -15098,6 +15098,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) ...@@ -15098,6 +15098,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba)
uint16_t max_rpi, rpi_limit; uint16_t max_rpi, rpi_limit;
uint16_t rpi_remaining, lrpi = 0; uint16_t rpi_remaining, lrpi = 0;
struct lpfc_rpi_hdr *rpi_hdr; struct lpfc_rpi_hdr *rpi_hdr;
unsigned long iflag;
max_rpi = phba->sli4_hba.max_cfg_param.max_rpi; max_rpi = phba->sli4_hba.max_cfg_param.max_rpi;
rpi_limit = phba->sli4_hba.next_rpi; rpi_limit = phba->sli4_hba.next_rpi;
...@@ -15106,7 +15107,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) ...@@ -15106,7 +15107,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba)
* Fetch the next logical rpi. Because this index is logical, * Fetch the next logical rpi. Because this index is logical,
* the driver starts at 0 each time. * the driver starts at 0 each time.
*/ */
spin_lock_irq(&phba->hbalock); spin_lock_irqsave(&phba->hbalock, iflag);
rpi = find_next_zero_bit(phba->sli4_hba.rpi_bmask, rpi_limit, 0); rpi = find_next_zero_bit(phba->sli4_hba.rpi_bmask, rpi_limit, 0);
if (rpi >= rpi_limit) if (rpi >= rpi_limit)
rpi = LPFC_RPI_ALLOC_ERROR; rpi = LPFC_RPI_ALLOC_ERROR;
...@@ -15122,7 +15123,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) ...@@ -15122,7 +15123,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba)
*/ */
if ((rpi == LPFC_RPI_ALLOC_ERROR) && if ((rpi == LPFC_RPI_ALLOC_ERROR) &&
(phba->sli4_hba.rpi_count >= max_rpi)) { (phba->sli4_hba.rpi_count >= max_rpi)) {
spin_unlock_irq(&phba->hbalock); spin_unlock_irqrestore(&phba->hbalock, iflag);
return rpi; return rpi;
} }
...@@ -15131,7 +15132,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) ...@@ -15131,7 +15132,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba)
* extents. * extents.
*/ */
if (!phba->sli4_hba.rpi_hdrs_in_use) { if (!phba->sli4_hba.rpi_hdrs_in_use) {
spin_unlock_irq(&phba->hbalock); spin_unlock_irqrestore(&phba->hbalock, iflag);
return rpi; return rpi;
} }
...@@ -15142,7 +15143,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) ...@@ -15142,7 +15143,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba)
* how many are supported max by the device. * how many are supported max by the device.
*/ */
rpi_remaining = phba->sli4_hba.next_rpi - phba->sli4_hba.rpi_count; rpi_remaining = phba->sli4_hba.next_rpi - phba->sli4_hba.rpi_count;
spin_unlock_irq(&phba->hbalock); spin_unlock_irqrestore(&phba->hbalock, iflag);
if (rpi_remaining < LPFC_RPI_LOW_WATER_MARK) { if (rpi_remaining < LPFC_RPI_LOW_WATER_MARK) {
rpi_hdr = lpfc_sli4_create_rpi_hdr(phba); rpi_hdr = lpfc_sli4_create_rpi_hdr(phba);
if (!rpi_hdr) { if (!rpi_hdr) {
......
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