]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: megaraid_sas: Update current host time to FW during IOC Init
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Thu, 19 Oct 2017 09:49:00 +0000 (02:49 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 8 Mar 2018 02:44:08 +0000 (18:44 -0800)
Driver needs to send current host time to firmware during init.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 27625001
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_fusion.c

index 6cf8fc55be2dba922f73135dc44366ec5735efe7..233c946744c5e4f5502f4c084f439d988d919d39 100644 (file)
@@ -774,6 +774,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
        MFI_CAPABILITIES *drv_ops;
        u32 scratch_pad_2;
        unsigned long flags;
+       struct timeval tv;
 
        fusion = instance->ctrl_context;
 
@@ -822,6 +823,12 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
        IOCInitMessage->SystemRequestFrameBaseAddress = cpu_to_le64(fusion->io_request_frames_phys);
        IOCInitMessage->HostMSIxVectors = instance->msix_vectors;
        IOCInitMessage->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT;
+
+       do_gettimeofday(&tv);
+       /* Convert to milliseconds as per FW requirement */
+       IOCInitMessage->TimeStamp = cpu_to_le64((tv.tv_sec * 1000) +
+                                               (tv.tv_usec / 1000));
+
        init_frame = (struct megasas_init_frame *)cmd->frame;
        memset(init_frame, 0, MEGAMFI_FRAME_SIZE);