Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7730902ybi; Thu, 6 Jun 2019 00:11:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/1ecXhLcENRSAurUyffl5mNOQEvLlm/ZEZZFJi0vaQkQfAMUxF/IrXc1lTas0pCdhHFPj X-Received: by 2002:a62:6d41:: with SMTP id i62mr51444429pfc.227.1559805085614; Thu, 06 Jun 2019 00:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559805085; cv=none; d=google.com; s=arc-20160816; b=pkDJOSaGAI6mfskQcIw5zLdF8/4ezaa7fXunWabeavIBW6GAXYDubfrA2z/jS5FWrv /Qav6fMZzfMx4Vk/rD+jSCbIzr+89Ij4T+11rqU0SZDAjLCKO6OhML2XTab3I1WQPWZ8 uIP0D3LwfCedkxfMY6WJ7oHv56YZIcYyCYa0Rt2klAr2MKVIcXJNsjS/viJhSL86sCzm a6xmMwzQz6KFnaOinLSNxrZ+uFzJCVTh7D3YQZ+xlZPsjwR5E6K19qcIULTnlA6XOgOC GGf7vVAxqTpdQ8IPQetwi7MCumziw4V7BtoQrOLF6sLmAIbbVlUEuw++s4fMuWmoALWF pucQ== 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=qTG0lPFsGL5aAv45RiRgIusBQvooy6xDaF7WcfwuoEM=; b=oetUnvfqpfnCSqRf09VztLShLm06rYOl0RbdwlkaBtYRrGPUrdATOtfwlGRoIZsnqB 8CYpH1VpoAhpKLMDF7Wd8M947z/RQN7YCKRn+8JRFbWT3vXooACf3atVkmSJsxGh11xZ cLw1OGv2ZUEzk/PLOvpdSomttB/E7lfwttDJPpumvUjoz6RxwTQe/Et441OX/mlF8N9E gZqFLOe28VlsMFZQKSGvtjcB1cVjmyxaa12VZacUCrbt38A2mEFBMiDpXuU7alZavLGf ST8pb9KBC+nrU6r55JnsHHl30fSqKk/clEAokk8gA+Md1erpvAYrZRkz2iNmA5t+ax+G HXhQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13si1163821pjr.102.2019.06.06.00.11.08; Thu, 06 Jun 2019 00:11:25 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbfFFHJu (ORCPT + 99 others); Thu, 6 Jun 2019 03:09:50 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:25138 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfFFHJu (ORCPT ); Thu, 6 Jun 2019 03:09:50 -0400 Received-SPF: SoftFail (esa6.microchip.iphmx.com: domain of kelvin.cao@microchip.com is inclined to not designate 208.19.100.22 as permitted sender) identity=mailfrom; client-ip=208.19.100.22; receiver=esa6.microchip.iphmx.com; envelope-from="kelvin.cao@microchip.com"; x-sender="kelvin.cao@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@smtp.microsemi.com) identity=helo; client-ip=208.19.100.22; receiver=esa6.microchip.iphmx.com; envelope-from="kelvin.cao@microchip.com"; x-sender="postmaster@smtp.microsemi.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=kelvin.cao@microchip.com; spf=None smtp.helo=postmaster@smtp.microsemi.com; dmarc=fail (p=none dis=none) d=microchip.com X-IronPort-AV: E=Sophos;i="5.63,558,1557212400"; d="scan'208";a="33318213" Received: from unknown (HELO smtp.microsemi.com) ([208.19.100.22]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Jun 2019 00:09:49 -0700 Received: from AVMBX3.microsemi.net (10.100.34.33) 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; Thu, 6 Jun 2019 00:09:48 -0700 Received: from AVMBX3.microsemi.net (10.100.34.33) by AVMBX3.microsemi.net (10.100.34.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 6 Jun 2019 00:09:48 -0700 Received: from NTB-Peer.microsemi.net (10.188.116.183) by avmbx3.microsemi.net (10.100.34.33) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Thu, 6 Jun 2019 00:09:45 -0700 From: Kelvin Cao To: , , , , , , , CC: , Subject: [PATCH 0/3] Redundant steps removal and bug fix of ntb_hw_switchtec Date: Thu, 6 Jun 2019 15:09:41 +0800 Message-ID: <1559804984-24698-1-git-send-email-kelvin.cao@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, Kelvin -- Changed since v1: - It's a second resend of v1 -- 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