From patchwork Mon Oct 19 16:43:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 7438581 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 E176D9F52D for ; Mon, 19 Oct 2015 16:44:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A0B7207A9 for ; Mon, 19 Oct 2015 16:44:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A2EC207A2 for ; Mon, 19 Oct 2015 16:44:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753545AbbJSQof (ORCPT ); Mon, 19 Oct 2015 12:44:35 -0400 Received: from mga03.intel.com ([134.134.136.65]:51921 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753507AbbJSQoe (ORCPT ); Mon, 19 Oct 2015 12:44:34 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 19 Oct 2015 09:44:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,702,1437462000"; d="scan'208";a="830469123" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by fmsmga002.fm.intel.com with ESMTP; 19 Oct 2015 09:44:31 -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 t9JGiURg001407; Mon, 19 Oct 2015 12:44:30 -0400 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id t9JGiTRn001403; Mon, 19 Oct 2015 12:44:29 -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 11/23] staging/rdma/hfi1: Reset firmware instead of reloading Sbus Date: Mon, 19 Oct 2015 12:43:35 -0400 Message-Id: <1445273027-29634-12-git-send-email-ira.weiny@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1445273027-29634-1-git-send-email-ira.weiny@intel.com> References: <1445273027-29634-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)