aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_sup.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_sup.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_sup.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index ff1dd4175a7..206bda093da 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -466,6 +466,7 @@ qla24xx_read_flash_dword(scsi_qla_host_t *ha, uint32_t addr)
466 udelay(10); 466 udelay(10);
467 else 467 else
468 rval = QLA_FUNCTION_TIMEOUT; 468 rval = QLA_FUNCTION_TIMEOUT;
469 cond_resched();
469 } 470 }
470 471
471 /* TODO: What happens if we time out? */ 472 /* TODO: What happens if we time out? */
@@ -508,6 +509,7 @@ qla24xx_write_flash_dword(scsi_qla_host_t *ha, uint32_t addr, uint32_t data)
508 udelay(10); 509 udelay(10);
509 else 510 else
510 rval = QLA_FUNCTION_TIMEOUT; 511 rval = QLA_FUNCTION_TIMEOUT;
512 cond_resched();
511 } 513 }
512 return rval; 514 return rval;
513} 515}
@@ -1255,6 +1257,7 @@ qla2x00_poll_flash(scsi_qla_host_t *ha, uint32_t addr, uint8_t poll_data,
1255 } 1257 }
1256 udelay(10); 1258 udelay(10);
1257 barrier(); 1259 barrier();
1260 cond_resched();
1258 } 1261 }
1259 return status; 1262 return status;
1260} 1263}
@@ -1403,6 +1406,7 @@ qla2x00_read_flash_data(scsi_qla_host_t *ha, uint8_t *tmp_buf, uint32_t saddr,
1403 if (saddr % 100) 1406 if (saddr % 100)
1404 udelay(10); 1407 udelay(10);
1405 *tmp_buf = data; 1408 *tmp_buf = data;
1409 cond_resched();
1406 } 1410 }
1407} 1411}
1408 1412
@@ -1449,7 +1453,6 @@ uint8_t *
1449qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf, 1453qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
1450 uint32_t offset, uint32_t length) 1454 uint32_t offset, uint32_t length)
1451{ 1455{
1452 unsigned long flags;
1453 uint32_t addr, midpoint; 1456 uint32_t addr, midpoint;
1454 uint8_t *data; 1457 uint8_t *data;
1455 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 1458 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
@@ -1458,7 +1461,6 @@ qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
1458 qla2x00_suspend_hba(ha); 1461 qla2x00_suspend_hba(ha);
1459 1462
1460 /* Go with read. */ 1463 /* Go with read. */
1461 spin_lock_irqsave(&ha->hardware_lock, flags);
1462 midpoint = ha->optrom_size / 2; 1464 midpoint = ha->optrom_size / 2;
1463 1465
1464 qla2x00_flash_enable(ha); 1466 qla2x00_flash_enable(ha);
@@ -1473,7 +1475,6 @@ qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
1473 *data = qla2x00_read_flash_byte(ha, addr); 1475 *data = qla2x00_read_flash_byte(ha, addr);
1474 } 1476 }
1475 qla2x00_flash_disable(ha); 1477 qla2x00_flash_disable(ha);
1476 spin_unlock_irqrestore(&ha->hardware_lock, flags);
1477 1478
1478 /* Resume HBA. */ 1479 /* Resume HBA. */
1479 qla2x00_resume_hba(ha); 1480 qla2x00_resume_hba(ha);
@@ -1487,7 +1488,6 @@ qla2x00_write_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
1487{ 1488{
1488 1489
1489 int rval; 1490 int rval;
1490 unsigned long flags;
1491 uint8_t man_id, flash_id, sec_number, data; 1491 uint8_t man_id, flash_id, sec_number, data;
1492 uint16_t wd; 1492 uint16_t wd;
1493 uint32_t addr, liter, sec_mask, rest_addr; 1493 uint32_t addr, liter, sec_mask, rest_addr;
@@ -1500,7 +1500,6 @@ qla2x00_write_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
1500 sec_number = 0; 1500 sec_number = 0;
1501 1501
1502 /* Reset ISP chip. */ 1502 /* Reset ISP chip. */
1503 spin_lock_irqsave(&ha->hardware_lock, flags);
1504 WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET); 1503 WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
1505 pci_read_config_word(ha->pdev, PCI_COMMAND, &wd); 1504 pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
1506 1505
@@ -1689,10 +1688,10 @@ update_flash:
1689 rval = QLA_FUNCTION_FAILED; 1688 rval = QLA_FUNCTION_FAILED;
1690 break; 1689 break;
1691 } 1690 }
1691 cond_resched();
1692 } 1692 }
1693 } while (0); 1693 } while (0);
1694 qla2x00_flash_disable(ha); 1694 qla2x00_flash_disable(ha);
1695 spin_unlock_irqrestore(&ha->hardware_lock, flags);
1696 1695
1697 /* Resume HBA. */ 1696 /* Resume HBA. */
1698 qla2x00_resume_hba(ha); 1697 qla2x00_resume_hba(ha);