From patchwork Mon Oct 26 14:28:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 7490301 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 C06C89F37F for ; Mon, 26 Oct 2015 14:29:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E63C72062A for ; Mon, 26 Oct 2015 14:29:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D44A3206F3 for ; Mon, 26 Oct 2015 14:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754486AbbJZO3v (ORCPT ); Mon, 26 Oct 2015 10:29:51 -0400 Received: from mga01.intel.com ([192.55.52.88]:42137 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754156AbbJZO3n (ORCPT ); Mon, 26 Oct 2015 10:29:43 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 26 Oct 2015 07:29:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,201,1444719600"; d="scan'208";a="671933239" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by orsmga003.jf.intel.com with ESMTP; 26 Oct 2015 07:29:21 -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 t9QETKOK008113; Mon, 26 Oct 2015 10:29:20 -0400 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id t9QETK0h008110; Mon, 26 Oct 2015 10:29:20 -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 v3 08/23] staging/rdma/hfi1: Reset firmware instead of reloading Sbus Date: Mon, 26 Oct 2015 10:28:34 -0400 Message-Id: <1445869729-7507-9-git-send-email-ira.weiny@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1445869729-7507-1-git-send-email-ira.weiny@intel.com> References: <1445869729-7507-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)