From patchwork Tue Oct 20 02:11: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: 7441621 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 B798F9F443 for ; Tue, 20 Oct 2015 02:12:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C629A2078F for ; Tue, 20 Oct 2015 02:12:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B42242078B for ; Tue, 20 Oct 2015 02:12:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752119AbbJTCMV (ORCPT ); Mon, 19 Oct 2015 22:12:21 -0400 Received: from mga11.intel.com ([192.55.52.93]:10135 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098AbbJTCMV (ORCPT ); Mon, 19 Oct 2015 22:12:21 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 19 Oct 2015 19:12:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,705,1437462000"; d="scan'208";a="797527080" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by orsmga001.jf.intel.com with ESMTP; 19 Oct 2015 19:12:19 -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 t9K2CI7p008776; Mon, 19 Oct 2015 22:12:18 -0400 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id t9K2CHqB008773; Mon, 19 Oct 2015 22:12:17 -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, Easwar Hariharan , Ira Weiny Subject: [PATCH v2 19/22] staging/rdma/hfi1: Load SBus firmware once per ASIC Date: Mon, 19 Oct 2015 22:11:34 -0400 Message-Id: <1445307097-8244-20-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: Easwar Hariharan Using fw_sbus_load to control SBus firmware load doesn't scale across multiple HFI1 cards in a single system. This patch ensures that the SBus firmware is loaded once per ASIC. Reviewed-by: Dean Luick Reviewed-by: Dennis Dalessandro Signed-off-by: Easwar Hariharan Signed-off-by: Ira Weiny --- drivers/staging/rdma/hfi1/firmware.c | 31 ++++++++----------------------- drivers/staging/rdma/hfi1/pcie.c | 10 ++++++---- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/drivers/staging/rdma/hfi1/firmware.c b/drivers/staging/rdma/hfi1/firmware.c index ace75ce3da3f..b4bdcf341aac 100644 --- a/drivers/staging/rdma/hfi1/firmware.c +++ b/drivers/staging/rdma/hfi1/firmware.c @@ -1236,35 +1236,20 @@ int load_firmware(struct hfi1_devdata *dd) { int ret; - if (fw_sbus_load || fw_fabric_serdes_load) { + if (fw_fabric_serdes_load) { ret = acquire_hw_mutex(dd); if (ret) return ret; set_sbus_fast_mode(dd); - /* - * The SBus contains part of the fabric firmware and so must - * also be downloaded. - */ - if (fw_sbus_load) { - turn_off_spicos(dd, SPICO_SBUS); - ret = load_sbus_firmware(dd, &fw_sbus); - if (ret) - goto clear; - fw_sbus_load = 0; - } + set_serdes_broadcast(dd, all_fabric_serdes_broadcast, + fabric_serdes_broadcast[dd->hfi1_id], + fabric_serdes_addrs[dd->hfi1_id], + NUM_FABRIC_SERDES); + turn_off_spicos(dd, SPICO_FABRIC); + ret = load_fabric_serdes_firmware(dd, &fw_fabric); - if (fw_fabric_serdes_load) { - set_serdes_broadcast(dd, all_fabric_serdes_broadcast, - fabric_serdes_broadcast[dd->hfi1_id], - fabric_serdes_addrs[dd->hfi1_id], - NUM_FABRIC_SERDES); - turn_off_spicos(dd, SPICO_FABRIC); - ret = load_fabric_serdes_firmware(dd, &fw_fabric); - } - -clear: clear_sbus_fast_mode(dd); release_hw_mutex(dd); if (ret) @@ -1583,7 +1568,7 @@ int load_pcie_firmware(struct hfi1_devdata *dd) /* both firmware loads below use the SBus */ set_sbus_fast_mode(dd); - if (fw_sbus_load) { + if (fw_sbus_load && (dd->flags & HFI1_DO_INIT_ASIC)) { turn_off_spicos(dd, SPICO_SBUS); ret = load_sbus_firmware(dd, &fw_sbus); if (ret) diff --git a/drivers/staging/rdma/hfi1/pcie.c b/drivers/staging/rdma/hfi1/pcie.c index 3b50cdda1c0a..a956044459a2 100644 --- a/drivers/staging/rdma/hfi1/pcie.c +++ b/drivers/staging/rdma/hfi1/pcie.c @@ -947,15 +947,16 @@ int do_pcie_gen3_transition(struct hfi1_devdata *dd) } retry: + if (therm) { - /* toggle SPICO_ENABLE to get back to the state - just after the firmware load */ + /* + * 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 */ @@ -1198,6 +1199,7 @@ retry: /* clear the DC reset */ write_csr(dd, CCE_DC_CTRL, 0); + /* Set the LED off */ if (is_a0(dd)) setextled(dd, 0);