Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2103974yba; Sun, 21 Apr 2019 23:58:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcDo7FsaVjHhN9APsTDGTK4OzKdhkKEdsdvVKlFYqmMYYgBWHELvRrPmiJttBTPyZu/Ywp X-Received: by 2002:a63:4644:: with SMTP id v4mr17597283pgk.422.1555916289823; Sun, 21 Apr 2019 23:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555916289; cv=none; d=google.com; s=arc-20160816; b=qoasWZHt5w1Bm/w1348hE8xpYUODA8UXcQaXHNr3gWTj0i0szwrA1TRegt8LoCrmcG wbGbClMnZV6jASZR1I2xbyFExsUH0pc4GKLlIT6onfIJIgEyr0nFOHvbLb0U6N20nk0Y oT512dPKdlxTbLMjjTv2oLhGeDI4As/qr5PkpumDMDs68A89okjQyGxmrQoIk5bk2vHS oERZi9513oO63hzL4Uoa0hcZZAVhMR8ps+jgCDKQbEqJKj+bjYJsSZS3oIqaJBCxB2B8 +bKLIINKjaiOJC98E2dx0dh+/DfXoOXMHuFVhn30UESJU0h765be9g+3aQuUp/2wzACF DMNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=m69FZZN5KYt61dbIldU5rNcOzfekT4rZ48WwQcrhgqg=; b=pKo6xHvKTDCnmtcOWtYqn3A/x1Dqu1IqOQxJDpIP9gWBJ6n2AbXnDK4vRiPQs73BGi 3OizTgCru02m5XMGs4DIc8xMMRJd7ic3QPUX+nHdDKjkMVjW+2lnjSOT0LoyH5eSvTaG zdTwDxsieJFFVT2XymAjkusxoCYl4YETboUzg6MgUf+zWmFv4vFPgOF0WostfuBzZl5Y ZPFWg/GJRCKCRROYyvqtphKtwtcx/Dp6mYIsBgmdHBeQXJ3UquFP0yRi5QYUG4c4lvUG mocTgmhmBOvYSmP2xW5pCWADmuUWVXIDQNxDNCrtvaCrSCLWCdz2Dcyek4yFhKIzBBYn v31Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k14si11921174pll.126.2019.04.21.23.57.52; Sun, 21 Apr 2019 23:58:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbfDVGo1 (ORCPT + 99 others); Mon, 22 Apr 2019 02:44:27 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:3655 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfDVGo0 (ORCPT ); Mon, 22 Apr 2019 02:44:26 -0400 X-IronPort-AV: E=Sophos;i="5.60,380,1549954800"; d="scan'208";a="30574989" Received: from unknown (HELO smtp.microsemi.com) ([208.19.99.222]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Apr 2019 23:44:04 -0700 Received: from AUSMBX1.microsemi.net (10.201.34.31) by AUSMBX2.microsemi.net (10.201.34.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 22 Apr 2019 01:44:03 -0500 Received: from AUSMBX3.microsemi.net (10.201.34.33) by AUSMBX1.microsemi.net (10.201.34.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 22 Apr 2019 01:44:02 -0500 Received: from server1.microsemi.net (10.188.116.203) by ausmbx3.microsemi.net (10.201.34.33) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 22 Apr 2019 01:43:59 -0500 From: Wesley Sheng To: , , , , , , , CC: , , Subject: [PATCH 1/3] ntb_hw_switchtec: Remove redundant steps of switchtec_ntb_reinit_peer() function Date: Mon, 22 Apr 2019 22:42:56 +0800 Message-ID: <1555944178-1957-2-git-send-email-wesley.sheng@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555944178-1957-1-git-send-email-wesley.sheng@microchip.com> References: <1555944178-1957-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 From: Joey Zhang When a re-initialization is caused by a link event, the driver will re-setup the shared memory window. But at that time, the shared memory is still valid, and it's unnecessary to free, reallocate and then initialize it again. We only need to reconfigure the hardware registers. Remove the redundant steps from switchtec_ntb_reinit_peer() function. Signed-off-by: Joey Zhang Signed-off-by: Wesley Sheng Reviewed-by: Logan Gunthorpe --- drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c index d905d36..947ed0b 100644 --- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c +++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c @@ -1457,10 +1457,13 @@ static void switchtec_ntb_deinit_db_msg_irq(struct switchtec_ntb *sndev) static int switchtec_ntb_reinit_peer(struct switchtec_ntb *sndev) { - dev_info(&sndev->stdev->dev, "peer reinitialized\n"); - switchtec_ntb_deinit_shared_mw(sndev); - switchtec_ntb_init_mw(sndev); - return switchtec_ntb_init_shared_mw(sndev); + int rc; + + dev_info(&sndev->stdev->dev, "reinitialize shared memory window\n"); + rc = config_rsvd_lut_win(sndev, sndev->mmio_peer_ctrl, 0, + sndev->self_partition, + sndev->self_shared_dma); + return rc; } static int switchtec_ntb_add(struct device *dev, -- 2.7.4