diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 103 |
1 files changed, 10 insertions, 93 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 804987397b7..1692a883f4d 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
| @@ -811,78 +811,6 @@ skip_rio: | |||
| 811 | qla2x00_alert_all_vps(rsp, mb); | 811 | qla2x00_alert_all_vps(rsp, mb); |
| 812 | } | 812 | } |
| 813 | 813 | ||
| 814 | static void | ||
| 815 | qla2x00_adjust_sdev_qdepth_up(struct scsi_device *sdev, void *data) | ||
| 816 | { | ||
| 817 | fc_port_t *fcport = data; | ||
| 818 | struct scsi_qla_host *vha = fcport->vha; | ||
| 819 | struct qla_hw_data *ha = vha->hw; | ||
| 820 | struct req_que *req = NULL; | ||
| 821 | |||
| 822 | if (!ql2xqfulltracking) | ||
| 823 | return; | ||
| 824 | |||
| 825 | req = vha->req; | ||
| 826 | if (!req) | ||
| 827 | return; | ||
| 828 | if (req->max_q_depth <= sdev->queue_depth) | ||
| 829 | return; | ||
| 830 | |||
| 831 | if (sdev->ordered_tags) | ||
| 832 | scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, | ||
| 833 | sdev->queue_depth + 1); | ||
| 834 | else | ||
| 835 | scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, | ||
| 836 | sdev->queue_depth + 1); | ||
| 837 | |||
| 838 | fcport->last_ramp_up = jiffies; | ||
| 839 | |||
| 840 | DEBUG2(qla_printk(KERN_INFO, ha, | ||
| 841 | "scsi(%ld:%d:%d:%d): Queue depth adjusted-up to %d.\n", | ||
| 842 | fcport->vha->host_no, sdev->channel, sdev->id, sdev->lun, | ||
| 843 | sdev->queue_depth)); | ||
| 844 | } | ||
| 845 | |||
| 846 | static void | ||
| 847 | qla2x00_adjust_sdev_qdepth_down(struct scsi_device *sdev, void *data) | ||
| 848 | { | ||
| 849 | fc_port_t *fcport = data; | ||
| 850 | |||
| 851 | if (!scsi_track_queue_full(sdev, sdev->queue_depth - 1)) | ||
| 852 | return; | ||
| 853 | |||
| 854 | DEBUG2(qla_printk(KERN_INFO, fcport->vha->hw, | ||
| 855 | "scsi(%ld:%d:%d:%d): Queue depth adjusted-down to %d.\n", | ||
| 856 | fcport->vha->host_no, sdev->channel, sdev->id, sdev->lun, | ||
| 857 | sdev->queue_depth)); | ||
| 858 | } | ||
| 859 | |||
| 860 | static inline void | ||
| 861 | qla2x00_ramp_up_queue_depth(scsi_qla_host_t *vha, struct req_que *req, | ||
| 862 | srb_t *sp) | ||
| 863 | { | ||
| 864 | fc_port_t *fcport; | ||
| 865 | struct scsi_device *sdev; | ||
| 866 | |||
| 867 | if (!ql2xqfulltracking) | ||
| 868 | return; | ||
| 869 | |||
| 870 | sdev = sp->cmd->device; | ||
| 871 | if (sdev->queue_depth >= req->max_q_depth) | ||
| 872 | return; | ||
| 873 | |||
| 874 | fcport = sp->fcport; | ||
| 875 | if (time_before(jiffies, | ||
| 876 | fcport->last_ramp_up + ql2xqfullrampup * HZ)) | ||
| 877 | return; | ||
| 878 | if (time_before(jiffies, | ||
| 879 | fcport->last_queue_full + ql2xqfullrampup * HZ)) | ||
| 880 | return; | ||
| 881 | |||
| 882 | starget_for_each_device(sdev->sdev_target, fcport, | ||
| 883 | qla2x00_adjust_sdev_qdepth_up); | ||
| 884 | } | ||
| 885 | |||
| 886 | /** | 814 | /** |
| 887 | * qla2x00_process_completed_request() - Process a Fast Post response. | 815 | * qla2x00_process_completed_request() - Process a Fast Post response. |
| 888 | * @ha: SCSI driver HA context | 816 | * @ha: SCSI driver HA context |
| @@ -913,8 +841,6 @@ qla2x00_process_completed_request(struct scsi_qla_host *vha, | |||
| 913 | 841 | ||
| 914 | /* Save ISP completion status */ | 842 | /* Save ISP completion status */ |
| 915 | sp->cmd->result = DID_OK << 16; | 843 | sp->cmd->result = DID_OK << 16; |
| 916 | |||
| 917 | qla2x00_ramp_up_queue_depth(vha, req, sp); | ||
| 918 | qla2x00_sp_compl(ha, sp); | 844 | qla2x00_sp_compl(ha, sp); |
| 919 | } else { | 845 | } else { |
| 920 | DEBUG2(printk("scsi(%ld) Req:%d: Invalid ISP SCSI completion" | 846 | DEBUG2(printk("scsi(%ld) Req:%d: Invalid ISP SCSI completion" |
| @@ -1435,13 +1361,6 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
| 1435 | "scsi(%ld): QUEUE FULL status detected " | 1361 | "scsi(%ld): QUEUE FULL status detected " |
| 1436 | "0x%x-0x%x.\n", vha->host_no, comp_status, | 1362 | "0x%x-0x%x.\n", vha->host_no, comp_status, |
| 1437 | scsi_status)); | 1363 | scsi_status)); |
| 1438 | |||
| 1439 | /* Adjust queue depth for all luns on the port. */ | ||
| 1440 | if (!ql2xqfulltracking) | ||
| 1441 | break; | ||
| 1442 | fcport->last_queue_full = jiffies; | ||
| 1443 | starget_for_each_device(cp->device->sdev_target, | ||
| 1444 | fcport, qla2x00_adjust_sdev_qdepth_down); | ||
| 1445 | break; | 1364 | break; |
| 1446 | } | 1365 | } |
| 1447 | if (lscsi_status != SS_CHECK_CONDITION) | 1366 | if (lscsi_status != SS_CHECK_CONDITION) |
| @@ -1516,17 +1435,6 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
| 1516 | "scsi(%ld): QUEUE FULL status detected " | 1435 | "scsi(%ld): QUEUE FULL status detected " |
| 1517 | "0x%x-0x%x.\n", vha->host_no, comp_status, | 1436 | "0x%x-0x%x.\n", vha->host_no, comp_status, |
| 1518 | scsi_status)); | 1437 | scsi_status)); |
| 1519 | |||
| 1520 | /* | ||
| 1521 | * Adjust queue depth for all luns on the | ||
| 1522 | * port. | ||
| 1523 | */ | ||
| 1524 | if (!ql2xqfulltracking) | ||
| 1525 | break; | ||
| 1526 | fcport->last_queue_full = jiffies; | ||
| 1527 | starget_for_each_device( | ||
| 1528 | cp->device->sdev_target, fcport, | ||
| 1529 | qla2x00_adjust_sdev_qdepth_down); | ||
| 1530 | break; | 1438 | break; |
| 1531 | } | 1439 | } |
| 1532 | if (lscsi_status != SS_CHECK_CONDITION) | 1440 | if (lscsi_status != SS_CHECK_CONDITION) |
| @@ -2020,7 +1928,7 @@ qla24xx_msix_rsp_q(int irq, void *dev_id) | |||
| 2020 | 1928 | ||
| 2021 | vha = qla25xx_get_host(rsp); | 1929 | vha = qla25xx_get_host(rsp); |
| 2022 | qla24xx_process_response_queue(vha, rsp); | 1930 | qla24xx_process_response_queue(vha, rsp); |
| 2023 | if (!ha->mqenable) { | 1931 | if (!ha->flags.disable_msix_handshake) { |
| 2024 | WRT_REG_DWORD(®->hccr, HCCRX_CLR_RISC_INT); | 1932 | WRT_REG_DWORD(®->hccr, HCCRX_CLR_RISC_INT); |
| 2025 | RD_REG_DWORD_RELAXED(®->hccr); | 1933 | RD_REG_DWORD_RELAXED(®->hccr); |
| 2026 | } | 1934 | } |
| @@ -2034,6 +1942,7 @@ qla25xx_msix_rsp_q(int irq, void *dev_id) | |||
| 2034 | { | 1942 | { |
| 2035 | struct qla_hw_data *ha; | 1943 | struct qla_hw_data *ha; |
| 2036 | struct rsp_que *rsp; | 1944 | struct rsp_que *rsp; |
| 1945 | struct device_reg_24xx __iomem *reg; | ||
| 2037 | 1946 | ||
| 2038 | rsp = (struct rsp_que *) dev_id; | 1947 | rsp = (struct rsp_que *) dev_id; |
| 2039 | if (!rsp) { | 1948 | if (!rsp) { |
| @@ -2043,6 +1952,14 @@ qla25xx_msix_rsp_q(int irq, void *dev_id) | |||
| 2043 | } | 1952 | } |
| 2044 | ha = rsp->hw; | 1953 | ha = rsp->hw; |
| 2045 | 1954 | ||
| 1955 | /* Clear the interrupt, if enabled, for this response queue */ | ||
| 1956 | if (rsp->options & ~BIT_6) { | ||
| 1957 | reg = &ha->iobase->isp24; | ||
| 1958 | spin_lock_irq(&ha->hardware_lock); | ||
| 1959 | WRT_REG_DWORD(®->hccr, HCCRX_CLR_RISC_INT); | ||
| 1960 | RD_REG_DWORD_RELAXED(®->hccr); | ||
| 1961 | spin_unlock_irq(&ha->hardware_lock); | ||
| 1962 | } | ||
| 2046 | queue_work_on((int) (rsp->id - 1), ha->wq, &rsp->q_work); | 1963 | queue_work_on((int) (rsp->id - 1), ha->wq, &rsp->q_work); |
| 2047 | 1964 | ||
| 2048 | return IRQ_HANDLED; | 1965 | return IRQ_HANDLED; |
