Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2589340yba; Sun, 7 Apr 2019 23:47:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFs7cRWDSpE5mzbHyLJRSerNURcGgLF4MjjhxQfuyQdjwd2sS1Yd64gsrBPxYEdrizMki6 X-Received: by 2002:a63:1912:: with SMTP id z18mr26985630pgl.115.1554706047311; Sun, 07 Apr 2019 23:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554706047; cv=none; d=google.com; s=arc-20160816; b=zJAFE3M8NW326EKP7ixdJx84siPrf2G9WxFWDkfEnpWnJYxIf3GjwzQ+fryEN8O8gY mQiM/d9gLVa8FyUudC6faxZsHemA4Z25jZL/36qes7n2u7o8mFu0NbMBRjB3h3UCbLRW misZiRAYt0OGdztBhNe43D0udU7ZGImfbE9Atkv5ao2+G3Ku4Ox9zRfa0q/zmuQXFY4T MSRVIF4zbCyQdtT86HeV/6UMFC7gxUD/7J2vYvvYUtBS69tKVMwF3e1Vr/zNkc7Tlufb qynaCg9Yk8loP8SXmp0jONxo2qCKiy4HKsIpk1diJgHYSM4wHORR5ifDg5z+2g2dsMSV J0gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=mMlSW2ESzX82t7HoKZCE6OBnY3J5VvJwvLhOOzoRBxU=; b=WGTBizJHbTDz5U8d30DofEbn1JlNnt9OSYN7TqN0902IMhr8wBt+vaf5Qt/rDd3wFC ThMnPQgLI5Gj8Y5B4i6PfZbjE0H6ebZNls+/e/UO5tjbJ/o4fDZqRmdxuwPZJVLB4snf BHxuS/G5KX5VmD0qUJEToyyjUmNTm5vog6ClZZkvGDl7h7Cm6XiQllr1bqfQ/ez/GRE2 LxwVjxGM73jtq+RmFpPiAaKpgJhTcNpWcw+3iILpeeWYtjgrafiS9ctQezxj+nb1BkT+ Ts+rHXelPbBjOKUXrau+EFnWO6UD2zVHf2yEvAKAlQSO2X/4Q1uRt9la+Wd/KuIZQtI+ 2b7g== 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 60si26720845plf.122.2019.04.07.23.47.12; Sun, 07 Apr 2019 23:47:27 -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 S1726494AbfDHGqa (ORCPT + 99 others); Mon, 8 Apr 2019 02:46:30 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:38894 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbfDHGqa (ORCPT ); Mon, 8 Apr 2019 02:46:30 -0400 X-IronPort-AV: E=Sophos;i="5.60,324,1549954800"; d="scan'208";a="29649650" 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:29 -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:28 -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:27 -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:25 -0700 From: Wesley Sheng To: , , , , , , , CC: , , Subject: [PATCH 0/3] Redundant steps removal and bug fix of ntb_hw_switchtec Date: Mon, 8 Apr 2019 22:45:19 +0800 Message-ID: <1554734722-7833-1-git-send-email-wesley.sheng@microchip.com> X-Mailer: git-send-email 2.7.4 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 Hi, Everyone, This patch series remove redundant steps and fix one bug of the ntb_hw_switchtec module. When a re-initialization is caused by a link event, the driver will re-setup the shared memory windows. But at that time, the shared memory is still valid, and it's unnecessary to free, reallocate and then initialize it again. Remove these redundant steps. 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 re-setup of shared memory window for that case. Switchtec does not support setting multiple MWs simultaneously. However, there's a race condition when a re-initialization is caused by a link event, the driver will re-setup the shared memory window asynchronously and this races with the client setting up its memory windows on the link up event. Fix this by ensure do the entire initialization in a work queue and signal the client once it's done. Regard, Wesley Joey Zhang (2): ntb_hw_switchtec: Remove redundant steps of switchtec_ntb_reinit_peer() function ntb_hw_switchtec: Fix setup MW with failure bug Wesley Sheng (1): ntb_hw_switchtec: Skip unnecessary re-setup of shared memory window for crosslink case drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 80 +++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 31 deletions(-) -- 2.7.4