From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DATE_IN_FUTURE_06_12, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95C55C282CE for ; Mon, 8 Apr 2019 06:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E0DF20883 for ; Mon, 8 Apr 2019 06:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbfDHGqi (ORCPT ); Mon, 8 Apr 2019 02:46:38 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:38905 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbfDHGqg (ORCPT ); Mon, 8 Apr 2019 02:46:36 -0400 X-IronPort-AV: E=Sophos;i="5.60,324,1549954800"; d="scan'208";a="29649659" Received: from unknown (HELO smtp.microsemi.com) ([208.19.100.22]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2019 23:46:35 -0700 Received: from AVMBX1.microsemi.net (10.100.34.31) by AVMBX2.microsemi.net (10.100.34.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 7 Apr 2019 23:46:35 -0700 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX1.microsemi.net (10.100.34.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 7 Apr 2019 23:46:34 -0700 Received: from server1.microsemi.net (10.188.116.154) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Sun, 7 Apr 2019 23:46:32 -0700 From: Wesley Sheng To: , , , , , , , CC: , , Subject: [PATCH 2/3] ntb_hw_switchtec: Skip unnecessary re-setup of shared memory window for crosslink case Date: Mon, 8 Apr 2019 22:45:21 +0800 Message-ID: <1554734722-7833-3-git-send-email-wesley.sheng@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554734722-7833-1-git-send-email-wesley.sheng@microchip.com> References: <1554734722-7833-1-git-send-email-wesley.sheng@microchip.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of NTB crosslink topology, the setting of shared memory window in the virtual partition doesn't reset on peer's reboot. So skip the unnecessary re-setup of shared memory window for that case. Signed-off-by: Wesley Sheng --- drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c index 947ed0b..6cf15c18 100644 --- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c +++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c @@ -1459,6 +1459,9 @@ static int switchtec_ntb_reinit_peer(struct switchtec_ntb *sndev) { int rc; + if (crosslink_is_enabled(sndev)) + return 0; + dev_info(&sndev->stdev->dev, "reinitialize shared memory window\n"); rc = config_rsvd_lut_win(sndev, sndev->mmio_peer_ctrl, 0, sndev->self_partition, -- 2.7.4