diff options
author | Michael Hernandez <michael.hernandez@cavium.com> | 2017-02-15 18:37:19 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-02-22 19:00:17 -0500 |
commit | f54f2cb540b53d55a81d620e816810d59be5cb1b (patch) | |
tree | 4ae3341d0f8456c8cf44d96e1133cae9b507e54e | |
parent | 75d943f3e4222fdd4f907b71bd9d1730412e7ce9 (diff) |
scsi: qla2xxx: Cleaned up queue configuration code.
This patch cleaned up queue configuration code, such that once
initialized, we should not touch msix_count value. This will prevent
incorrect numbers of MSI-X vectors requested while performing target
mode configuration.
[mkp: fixed Fixes: hash]
Cc: <stable@vger.kernel.org>
Fixes: d74595278f4a ("scsi: qla2xxx: Add multiple queue pair functionality.")
Signed-off-by: Michael Hernandez <michael.hernandez@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index d01c90c7dd04..8174cee8eb53 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1815,6 +1815,7 @@ skip_pio: | |||
1815 | 1815 | ||
1816 | /* Determine queue resources */ | 1816 | /* Determine queue resources */ |
1817 | ha->max_req_queues = ha->max_rsp_queues = 1; | 1817 | ha->max_req_queues = ha->max_rsp_queues = 1; |
1818 | ha->msix_count = QLA_BASE_VECTORS; | ||
1818 | if (!ql2xmqsupport || (!IS_QLA25XX(ha) && !IS_QLA81XX(ha))) | 1819 | if (!ql2xmqsupport || (!IS_QLA25XX(ha) && !IS_QLA81XX(ha))) |
1819 | goto mqiobase_exit; | 1820 | goto mqiobase_exit; |
1820 | 1821 | ||
@@ -1842,9 +1843,8 @@ skip_pio: | |||
1842 | "BAR 3 not enabled.\n"); | 1843 | "BAR 3 not enabled.\n"); |
1843 | 1844 | ||
1844 | mqiobase_exit: | 1845 | mqiobase_exit: |
1845 | ha->msix_count = ha->max_rsp_queues + 1; | ||
1846 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x001c, | 1846 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x001c, |
1847 | "MSIX Count:%d.\n", ha->msix_count); | 1847 | "MSIX Count: %d.\n", ha->msix_count); |
1848 | return (0); | 1848 | return (0); |
1849 | 1849 | ||
1850 | iospace_error_exit: | 1850 | iospace_error_exit: |
@@ -1892,6 +1892,7 @@ qla83xx_iospace_config(struct qla_hw_data *ha) | |||
1892 | /* 83XX 26XX always use MQ type access for queues | 1892 | /* 83XX 26XX always use MQ type access for queues |
1893 | * - mbar 2, a.k.a region 4 */ | 1893 | * - mbar 2, a.k.a region 4 */ |
1894 | ha->max_req_queues = ha->max_rsp_queues = 1; | 1894 | ha->max_req_queues = ha->max_rsp_queues = 1; |
1895 | ha->msix_count = QLA_BASE_VECTORS; | ||
1895 | ha->mqiobase = ioremap(pci_resource_start(ha->pdev, 4), | 1896 | ha->mqiobase = ioremap(pci_resource_start(ha->pdev, 4), |
1896 | pci_resource_len(ha->pdev, 4)); | 1897 | pci_resource_len(ha->pdev, 4)); |
1897 | 1898 | ||
@@ -1934,14 +1935,8 @@ qla83xx_iospace_config(struct qla_hw_data *ha) | |||
1934 | "BAR 1 not enabled.\n"); | 1935 | "BAR 1 not enabled.\n"); |
1935 | 1936 | ||
1936 | mqiobase_exit: | 1937 | mqiobase_exit: |
1937 | ha->msix_count = ha->max_rsp_queues + 1; | ||
1938 | if (QLA_TGT_MODE_ENABLED()) | ||
1939 | ha->msix_count++; | ||
1940 | |||
1941 | qlt_83xx_iospace_config(ha); | ||
1942 | |||
1943 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x011f, | 1938 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x011f, |
1944 | "MSIX Count:%d.\n", ha->msix_count); | 1939 | "MSIX Count: %d.\n", ha->msix_count); |
1945 | return 0; | 1940 | return 0; |
1946 | 1941 | ||
1947 | iospace_error_exit: | 1942 | iospace_error_exit: |