pm80xx: Update For Thermal Page Code
authorViswas G <Viswas.G@pmcs.com>
Tue, 11 Aug 2015 09:36:27 +0000 (15:06 +0530)
committerJames Bottomley <JBottomley@Odin.com>
Thu, 27 Aug 2015 00:10:48 +0000 (17:10 -0700)
Thermal page code has been changed to 7 for the 12G controllers.

Signed-off-by: Viswas G <Viswas.G@pmcs.com>
Reviewed-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Jack Wang <jinpu.wang@profitbricks.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/pm8001/pm80xx_hwi.c
drivers/scsi/pm8001/pm80xx_hwi.h

index 05cce463ab01c033c2bca41da41a64e5ac274180..dced9f7755e72ca78f49465eba5423a8f97b7f77 100644 (file)
@@ -843,6 +843,7 @@ pm80xx_set_thermal_config(struct pm8001_hba_info *pm8001_ha)
        int rc;
        u32 tag;
        u32 opc = OPC_INB_SET_CONTROLLER_CONFIG;
+       u32 page_code;
 
        memset(&payload, 0, sizeof(struct set_ctrl_cfg_req));
        rc = pm8001_tag_alloc(pm8001_ha, &tag);
@@ -851,8 +852,14 @@ pm80xx_set_thermal_config(struct pm8001_hba_info *pm8001_ha)
 
        circularQ = &pm8001_ha->inbnd_q_tbl[0];
        payload.tag = cpu_to_le32(tag);
+
+       if (IS_SPCV_12G(pm8001_ha->pdev))
+               page_code = THERMAL_PAGE_CODE_7H;
+       else
+               page_code = THERMAL_PAGE_CODE_8H;
+
        payload.cfg_pg[0] = (THERMAL_LOG_ENABLE << 9) |
-                       (THERMAL_ENABLE << 8) | THERMAL_OP_CODE;
+                               (THERMAL_ENABLE << 8) | page_code;
        payload.cfg_pg[1] = (LTEMPHIL << 24) | (RTEMPHIL << 8);
 
        rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
index 9970a385795d16c5328ca6c7711ebf146e02c63c..a083cc68d937721b95601658a7c9d0ed1c37e487 100644 (file)
 /* Thermal related */
 #define        THERMAL_ENABLE                  0x1
 #define        THERMAL_LOG_ENABLE              0x1
-#define THERMAL_OP_CODE                        0x6
+#define THERMAL_PAGE_CODE_7H           0x6
+#define THERMAL_PAGE_CODE_8H           0x7
 #define LTEMPHIL                        70
 #define RTEMPHIL                       100