From patchwork Mon Apr 15 14:41:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wesley Sheng X-Patchwork-Id: 1085453 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=microchip.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44jJpt47d5z9s0W for ; Mon, 15 Apr 2019 16:43:02 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726277AbfDOGm4 (ORCPT ); Mon, 15 Apr 2019 02:42:56 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:59107 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbfDOGmx (ORCPT ); Mon, 15 Apr 2019 02:42:53 -0400 X-IronPort-AV: E=Sophos;i="5.60,352,1549954800"; d="scan'208";a="31501915" Received: from unknown (HELO smtp.microsemi.com) ([208.19.99.222]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Apr 2019 23:42:52 -0700 Received: from AUSMBX2.microsemi.net (10.201.34.32) 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, 15 Apr 2019 01:42:51 -0500 Received: from server1.microsemi.net (10.188.116.154) by ausmbx2.microsemi.net (10.201.34.32) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 15 Apr 2019 01:42:48 -0500 From: Wesley Sheng To: , , , , CC: , Subject: [PATCH v2 2/2] switchtec: Fix unintended mask of MRPC event Date: Mon, 15 Apr 2019 22:41:42 +0800 Message-ID: <1555339302-31829-3-git-send-email-wesley.sheng@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555339302-31829-1-git-send-email-wesley.sheng@microchip.com> References: <1555339302-31829-1-git-send-email-wesley.sheng@microchip.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When running application tool switchtec-user's `firmware update` and `event wait` commands concurrently, sometimes the firmware update speed reduced evidently. It is because when the MRPC event happened right after MRPC event occurrence check but before event mask loop reach to its header register in event ISR, the MRPC event would be masked unintentionally. Since there's no chance to enable it again except for a module reload, all the following MRPC execution completion check will be deferred to timeout. Fix this bug by skipping the mask operation for MRPC event in event ISR, same as what we already do for LINK event. Fixes: 52eabba5bcdb ("switchtec: Add IOCTLs to the Switchtec driver") Signed-off-by: Wesley Sheng --- drivers/pci/switch/switchtec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 7df9a69..30f6e08 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -1177,7 +1177,8 @@ static int mask_event(struct switchtec_dev *stdev, int eid, int idx) if (!(hdr & SWITCHTEC_EVENT_OCCURRED && hdr & SWITCHTEC_EVENT_EN_IRQ)) return 0; - if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE) + if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE || + eid == SWITCHTEC_IOCTL_EVENT_MRPC_COMP) return 0; dev_dbg(&stdev->dev, "%s: %d %d %x\n", __func__, eid, idx, hdr);