From patchwork Thu Oct 19 09:49:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10016289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EC0FD60215 for ; Thu, 19 Oct 2017 09:50:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC23928BD0 for ; Thu, 19 Oct 2017 09:50:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C10C728CB4; Thu, 19 Oct 2017 09:50:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E6D828BD0 for ; Thu, 19 Oct 2017 09:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbdJSJud (ORCPT ); Thu, 19 Oct 2017 05:50:33 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:51540 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626AbdJSJuc (ORCPT ); Thu, 19 Oct 2017 05:50:32 -0400 Received: by mail-pg0-f65.google.com with SMTP id p9so6755482pgc.8 for ; Thu, 19 Oct 2017 02:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xt6+1jiAwWuhEhqknq2Q+6h1suH5haB80WVfffbPMXc=; b=aSWFWdHSNKE5LGQa3hGIA0NnBv2QqH05/rxSnBed4cU/1OXyewWiBg3FEuAS43233r 7wiRAKv6mdnELxU6ljMv5CMrvYcyBtfe1J9FdviEW9MJz9cdgn5rZjV5eaEarCosSaQF lhWYMdT/GEdnKXdmAx6ygI2jOA8QbRYGBziUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Xt6+1jiAwWuhEhqknq2Q+6h1suH5haB80WVfffbPMXc=; b=mfqc6HpLZGi2WWKZ8wcB+D46UUPiuVXyO5rew4ygT9u2dC5ogFufEGvmNn5PR7WH3k mxeaA/nJ6fLC9VDHdwXn+YzynNNue9uaekMSPk/oWtZtaqCyW9ppaDNgbUP7ikVT77WO 6p2LEw4omG42FJbyVrOMGs+6Oo3jBHDghuxFGaNyf7J4lmlZ2q1LjlNsTvFKbe5ZQ6+a 0bw9lwctxKEaMxx/x4A8zJdpqlcZV6f+PHw+5zr8v31hT2TIRpE9sSFOAhhhxq0I0WSC 7g23v4dCzNjh7XR+R+o4uBKDGDLSSFE5E7twvVvEj4mqMYK6swWeGBI6k7OlYH+hSE9d N4iw== X-Gm-Message-State: AMCzsaWJlaf/rrL72Np/zaiG/lbXw4jvppgSw7qzmOoATMqvu9RCWQGF 5juZOtUNUNkyja5tnUXk3O/44Lmm X-Google-Smtp-Source: ABhQp+QdYwsj4Vi18s4dObiDj/e5KwrnKpuxS8t6N7e+eKH84VtjWROGo2Q7Z7kjrgSkz87JmKmRsQ== X-Received: by 10.84.140.129 with SMTP id 1mr1066834plt.281.1508406631972; Thu, 19 Oct 2017 02:50:31 -0700 (PDT) Received: from dhcp-135-24-192-142.localdomain ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id e84sm27202885pfd.1.2017.10.19.02.50.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 02:50:31 -0700 (PDT) From: Shivasharan S To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Shivasharan S Subject: [PATCH 13/19] megaraid_sas: Update current host time to FW during IOC Init Date: Thu, 19 Oct 2017 02:49:00 -0700 Message-Id: <1508406546-25944-14-git-send-email-shivasharan.srikanteshwara@broadcom.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1508406546-25944-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> References: <1508406546-25944-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Driver needs to send current host time to firmware during init. Signed-off-by: Kashyap Desai Signed-off-by: Shivasharan S --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index a630a31aecf8..277fd16305ee 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -773,6 +773,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; @@ -821,6 +822,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);