From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.microchip.iphmx.com (esa1.microchip.iphmx.com. [68.232.147.91]) by gmr-mx.google.com with ESMTPS id 3si836047itz.0.2019.04.21.23.44.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Apr 2019 23:44:10 -0700 (PDT) From: Wesley Sheng Subject: [PATCH 2/3] ntb_hw_switchtec: Skip unnecessary re-setup of shared memory window for crosslink case Date: Mon, 22 Apr 2019 22:42:57 +0800 Message-ID: <1555944178-1957-3-git-send-email-wesley.sheng@microchip.com> In-Reply-To: <1555944178-1957-1-git-send-email-wesley.sheng@microchip.com> References: <1555944178-1957-1-git-send-email-wesley.sheng@microchip.com> Return-Path: wesley.sheng@microchip.com MIME-Version: 1.0 Content-Type: text/plain To: kurt.schwemmer@microsemi.com, logang@deltatee.com, jdmason@kudzu.us, dave.jiang@intel.com, allenbh@gmail.com, linux-pci@vger.kernel.org, linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org Cc: wesleyshenggit@sina.com, wesley.sheng@microchip.com, kelvin.cao@microchip.com List-ID: 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 Reviewed-by: Logan Gunthorpe --- 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