From patchwork Tue Oct 20 02:11:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 7441521 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D143A9F443 for ; Tue, 20 Oct 2015 02:12:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 00C7920785 for ; Tue, 20 Oct 2015 02:12:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F16172078B for ; Tue, 20 Oct 2015 02:12:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbbJTCMF (ORCPT ); Mon, 19 Oct 2015 22:12:05 -0400 Received: from mga03.intel.com ([134.134.136.65]:15091 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752037AbbJTCMD (ORCPT ); Mon, 19 Oct 2015 22:12:03 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 19 Oct 2015 19:12:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,705,1437462000"; d="scan'208";a="667687825" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by orsmga003.jf.intel.com with ESMTP; 19 Oct 2015 19:12:01 -0700 Received: from phlsvsds.ph.intel.com (localhost.localdomain [127.0.0.1]) by phlsvsds.ph.intel.com (8.13.8/8.13.8) with ESMTP id t9K2C0B9008707; Mon, 19 Oct 2015 22:12:00 -0400 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id t9K2BxxM008704; Mon, 19 Oct 2015 22:11:59 -0400 X-Authentication-Warning: phlsvsds.ph.intel.com: iweiny set sender to ira.weiny@intel.com using -f From: ira.weiny@intel.com To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org Cc: dledford@redhat.com, linux-rdma@vger.kernel.org, dennis.dalessandro@intel.com, mike.marciniszyn@intel.com, Caz Yokoyama , Ira Weiny Subject: [PATCH v2 09/22] staging/rdma/hfi1: Reset firmware instead of reloading Sbus Date: Mon, 19 Oct 2015 22:11:24 -0400 Message-Id: <1445307097-8244-10-git-send-email-ira.weiny@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1445307097-8244-1-git-send-email-ira.weiny@intel.com> References: <1445307097-8244-1-git-send-email-ira.weiny@intel.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Caz Yokoyama Reset firmware instead of reloading Sbus firmware if it's already done for this ASIC. To work around thermal polling problem in firmware, don't reload Sbus firmware, instead, reset the firmware on the initialization of the second HFI. Reviewed-by: Easwar Hariharan Reviewed-by: Dennis Dalessandro Reviewed-by: Dean Luick Signed-off-by: Caz Yokoyama Signed-off-by: Ira Weiny --- drivers/staging/rdma/hfi1/chip.h | 1 + drivers/staging/rdma/hfi1/firmware.c | 4 +--- drivers/staging/rdma/hfi1/pcie.c | 13 ++++++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rdma/hfi1/chip.h b/drivers/staging/rdma/hfi1/chip.h index f89a432c7334..497c5de23d53 100644 --- a/drivers/staging/rdma/hfi1/chip.h +++ b/drivers/staging/rdma/hfi1/chip.h @@ -609,6 +609,7 @@ static inline void write_uctxt_csr(struct hfi1_devdata *dd, int ctxt, u64 create_pbc(struct hfi1_pportdata *ppd, u64, int, u32, u32); /* firmware.c */ +#define SBUS_MASTER_BROADCAST 0xfd #define NUM_PCIE_SERDES 16 /* number of PCIe serdes on the SBus */ extern const u8 pcie_serdes_broadcast[]; extern const u8 pcie_pcs_addrs[2][NUM_PCIE_SERDES]; diff --git a/drivers/staging/rdma/hfi1/firmware.c b/drivers/staging/rdma/hfi1/firmware.c index 15c9cb7a3150..ace75ce3da3f 100644 --- a/drivers/staging/rdma/hfi1/firmware.c +++ b/drivers/staging/rdma/hfi1/firmware.c @@ -924,9 +924,6 @@ static int load_8051_firmware(struct hfi1_devdata *dd, return 0; } -/* SBus Master broadcast address */ -#define SBUS_MASTER_BROADCAST 0xfd - /* * Write the SBus request register * @@ -1255,6 +1252,7 @@ int load_firmware(struct hfi1_devdata *dd) ret = load_sbus_firmware(dd, &fw_sbus); if (ret) goto clear; + fw_sbus_load = 0; } if (fw_fabric_serdes_load) { diff --git a/drivers/staging/rdma/hfi1/pcie.c b/drivers/staging/rdma/hfi1/pcie.c index ac5653c0f65e..3b50cdda1c0a 100644 --- a/drivers/staging/rdma/hfi1/pcie.c +++ b/drivers/staging/rdma/hfi1/pcie.c @@ -946,9 +946,20 @@ int do_pcie_gen3_transition(struct hfi1_devdata *dd) __func__); } +retry: + if (therm) { + /* toggle SPICO_ENABLE to get back to the state + just after the firmware load */ + sbus_request(dd, SBUS_MASTER_BROADCAST, 0x01, + WRITE_SBUS_RECEIVER, 0x00000040); + sbus_request(dd, SBUS_MASTER_BROADCAST, 0x01, + WRITE_SBUS_RECEIVER, 0x00000140); + dd_dev_info(dd, "%s: toggle SPICO_ENABLE to reset the bus\n", + __func__); + } + /* step 3: download SBus Master firmware */ /* step 4: download PCIe Gen3 SerDes firmware */ -retry: dd_dev_info(dd, "%s: downloading firmware\n", __func__); ret = load_pcie_firmware(dd); if (ret)