]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: megaraid_sas: 128 MSIX Support
authorSasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Tue, 10 Jan 2017 23:20:44 +0000 (18:20 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 21:05:54 +0000 (14:05 -0700)
Orabug: 26096381

SAS3.5 Generic Megaraid based Controllers will have the support for 128 MSI-X vectors,
resulting in the need to support 128 reply queues

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2493c67e518c772a573c3b1ad02e7ced5b53f6ca)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
drivers/scsi/megaraid/megaraid_sas_base.c

drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/megaraid/megaraid_sas_fusion.c

index 332153c91425807569cb058653b12def4994a117..c21c415436e2f9da33844fc9c71254594e386cdd 100644 (file)
@@ -2149,6 +2149,7 @@ struct megasas_instance {
        bool dev_handle;
        bool fw_sync_cache_support;
        bool is_ventura;
+       bool msix_combined;
 };
 struct MR_LD_VF_MAP {
        u32 size;
index 6fdf565d5b7e6653d5722b9db8ec6ca2a79e27ff..1e40586b7897499309bdb28530fbbb1b37ce9276 100644 (file)
@@ -5088,13 +5088,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
                        goto fail_ready_state;
        }
 
-       /*
-        * MSI-X host index 0 is common for all adapter.
-        * It is used for all MPT based Adapters.
-        */
-       instance->reply_post_host_index_addr[0] =
-               (u32 __iomem *)((u8 __iomem *)instance->reg_set +
-               MPI2_REPLY_POST_HOST_INDEX_OFFSET);
+
 
        /* Check if MSI-X is supported while in ready state */
        msix_enable = (instance->instancet->read_fw_status_reg(reg_set) &
@@ -5112,6 +5106,9 @@ static int megasas_init_fw(struct megasas_instance *instance)
                                instance->msix_vectors = ((scratch_pad_2
                                        & MR_MAX_REPLY_QUEUES_EXT_OFFSET)
                                        >> MR_MAX_REPLY_QUEUES_EXT_OFFSET_SHIFT) + 1;
+                               if (instance->msix_vectors > 16)
+                                       instance->msix_combined = true;
+
                                if (rdpq_enable)
                                        instance->is_rdpq = (scratch_pad_2 & MR_RDPQ_MODE_OFFSET) ?
                                                                1 : 0;
@@ -5145,6 +5142,19 @@ static int megasas_init_fw(struct megasas_instance *instance)
                else
                        instance->msix_vectors = 0;
        }
+       /*
+        * MSI-X host index 0 is common for all adapter.
+        * It is used for all MPT based Adapters.
+        */
+       if (instance->msix_combined) {
+               instance->reply_post_host_index_addr[0] =
+                               (u32 *)((u8 *)instance->reg_set +
+                               MPI2_SUP_REPLY_POST_HOST_INDEX_OFFSET);
+       } else {
+               instance->reply_post_host_index_addr[0] =
+                       (u32 *)((u8 *)instance->reg_set +
+                       MPI2_REPLY_POST_HOST_INDEX_OFFSET);
+       }
 
        dev_info(&instance->pdev->dev,
                "firmware supports msix\t: (%d)", fw_msix_count);
index b8c4fb6151958f80ec265fb7bd19701ec0348e6d..1dd2d77b148a70dc499bc7aadc6b179019294da9 100644 (file)
@@ -2391,7 +2391,7 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex)
                 * pending to be completed
                 */
                if (threshold_reply_count >= THRESHOLD_REPLY_COUNT) {
-                       if (fusion->adapter_type == INVADER_SERIES)
+                       if (instance->msix_combined)
                                writel(((MSIxIndex & 0x7) << 24) |
                                        fusion->last_reply_idx[MSIxIndex],
                                        instance->reply_post_host_index_addr[MSIxIndex/8]);
@@ -2407,7 +2407,7 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex)
                return IRQ_NONE;
 
        wmb();
-       if (fusion->adapter_type == INVADER_SERIES)
+       if (instance->msix_combined)
                writel(((MSIxIndex & 0x7) << 24) |
                        fusion->last_reply_idx[MSIxIndex],
                        instance->reply_post_host_index_addr[MSIxIndex/8]);