Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2589362yba; Sun, 7 Apr 2019 23:47:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjjrQz13Mj2/Gklfbc5kULJuOjb+kOgxQVAhBZPv4X68MPunOI+o9Rx15Foq8VyuaLAmZr X-Received: by 2002:a17:902:9884:: with SMTP id s4mr28626005plp.179.1554706049448; Sun, 07 Apr 2019 23:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554706049; cv=none; d=google.com; s=arc-20160816; b=wumilYgCjYViPm/tb1D+so90SD18QnwcdH74DlIZO41vCVHnep6fNo7uuEC16Knc00 Xw/JHcTKXbx9cWM9SXmkvBObvXerGrXqsx2QVlT3yFYASkeq8zDWRlebpHbMxH+9TVlo w21G4co7VRnxQZoXEtNMJEmTFiPYaZEBqqE5jNy4jTY8ajwRYyDknR3ZlOf4yMWDlQPi MVk8oqxkgZd/k4gTcN0qU1rJxgVUwdbZURiyuv00tRyWN3UhX/IZJAW2qz5LqmJZTW4x tqemNBfKiBUaQmsPQoRIjTsjKn3YE0m6NfHPrZmzpa76pBx4PUITwKAu6akxspt6tpWZ 2wmA== 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=0jpi0XB/VfbcM1eGQvYzhYm2UQwOZj10WT+3hY30pN8=; b=y+ChgzNuC6yEraKE1yQc192SKIHUvloEPOXhi311rmdWxT/5tfH0C0+1Y2XJjgpKKd IyU6CdFs5oHHNcwujiinrxjohMihJGzPKVWpz9Prp1x9xTuaQU2KBKSa1c4D6sJGXIg8 lqu2Ao7c7me+DFezvM0+ErsRlHzovkcllQ848X4NTvvGv7Vnws8dW90pfvNkI+9Wxpvb K7r+jVleW3xgXk7i/OHdHiKjQa2TwDnqu2NcZ8oyp0i+CYlTsS6dJLta1Bi2qPhvXmhi jeaNZtPJrBy6PrdCP/HSJMfALl4J8TbZ83RZY2MYUiM5hnkdLgNwBQ9TiZJFv3IYL+Be wXRQ== 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 t186si25144670pgd.221.2019.04.07.23.47.14; Sun, 07 Apr 2019 23:47:29 -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 S1726530AbfDHGqe (ORCPT + 99 others); Mon, 8 Apr 2019 02:46:34 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:38606 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbfDHGqd (ORCPT ); Mon, 8 Apr 2019 02:46:33 -0400 X-IronPort-AV: E=Sophos;i="5.60,324,1549954800"; d="scan'208";a="29431582" Received: from unknown (HELO smtp.microsemi.com) ([208.19.100.22]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2019 23:46:32 -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:32 -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:31 -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:28 -0700 From: Wesley Sheng To: , , , , , , , CC: , , Subject: [PATCH 1/3] ntb_hw_switchtec: Remove redundant steps of switchtec_ntb_reinit_peer() function Date: Mon, 8 Apr 2019 22:45:20 +0800 Message-ID: <1554734722-7833-2-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 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 --- 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