Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2096138yba; Sun, 21 Apr 2019 23:45:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqziCbjAbS/MIU3noYLP+BcQDcMOfw4IZemnR0mdDY63pWtY7mPL1p3ifmF0gH6hQW7M8XDM X-Received: by 2002:a17:902:e391:: with SMTP id ch17mr18212586plb.196.1555915513264; Sun, 21 Apr 2019 23:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555915513; cv=none; d=google.com; s=arc-20160816; b=jhEEcceYyodMgXZznqXinhmUMiFJuM6fj72gbToqgkxMEB4RU7j1j/Wk8cKY/3KTjw +ozdh54ilcpJ5ZTDt6oRKdp1lM66ORHHTdc2AWW7R083Rk/5mN0lWk7sqGXgua9ZUKCV 4LZrSRs7jthk0y4N57t/fXezFG0omKPhDqtO9QS2jH6vXI3dNkz4k//aECaXBW+iBfV0 R2zMUalVl3XV8D7QWDVSDLPA0WF59Dn0eyA0t8PPWWTIOgvZGO9aDak9MD1bejxHItlf UzwFBJA3iNIVkakFo3S6VqDimcfrI5SzV9RNuyvZDsDNiF05bt06NR7bEfE/yrjGIxjG obuw== 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=u8huCwL146XOvblFfCENMRXJOgnDROpR0VHUYGBb0gQ=; b=NZMJwDSoQEOrTzepQejAy+CmRUXfYNJdjlXrNryPyXUt1TPsg42m86IrDRV4uX6xJQ qSGRl2fytQCzR8glMS+OLRbePiS+MYxVAeIYM7EJTs0o/+ESAoTmq9/5GkvCCqPT6HAP 1vq0ONxdeFEQAbklNaXMT7uiKdvouUKOGL7c91iaWx7wPS/D3ilcjyG+uE6fT24qKcQU qV1jBm7OEjJ+9hjXwgPJ9UqdsR5e4Lyztswr6cUg/PPDaVa8Kfh8Ua1OzaZd1FTHX/SE IJ2NDVs1YsNCKbGmaYo7HtEBaqYEoFR8BQLT/+2coHoN7eduu4dkvqPO/6cnckLAdxDK x2Og== 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 z8si11711961pgh.82.2019.04.21.23.44.57; Sun, 21 Apr 2019 23:45:13 -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 S1726622AbfDVGoB (ORCPT + 99 others); Mon, 22 Apr 2019 02:44:01 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:37736 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbfDVGoB (ORCPT ); Mon, 22 Apr 2019 02:44:01 -0400 X-IronPort-AV: E=Sophos;i="5.60,380,1549954800"; d="scan'208";a="31972696" Received: from unknown (HELO smtp.microsemi.com) ([208.19.99.222]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Apr 2019 23:43:59 -0700 Received: from AUSMBX3.microsemi.net (10.201.34.33) 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:43:59 -0500 Received: from AUSMBX3.microsemi.net (10.201.34.33) by AUSMBX3.microsemi.net (10.201.34.33) 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:43:58 -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:55 -0500 From: Wesley Sheng To: , , , , , , , CC: , , Subject: [PATCH 0/3] Redundant steps removal and bug fix of ntb_hw_switchtec Date: Mon, 22 Apr 2019 22:42:55 +0800 Message-ID: <1555944178-1957-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 -- Changed since v1: - It's a 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