From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A40AC31E45 for ; Thu, 13 Jun 2019 16:13:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA96420665 for ; Thu, 13 Jun 2019 16:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560442401; bh=0nF0E6OR/0/YkO50J1rU0QWN6hYYNx0848W/umyVxWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GwAjt6QXXJAYvLujRzW72n14K0a+5VBOOxxeknKIx9zIpvpmGpOyO8Ma48woo7m6p EKDyvOktuSAZi2O6UiVKXeddYnuIwKIjL9IltueEVJS7pQXRHXlw5BKfjXB92QoM9K tTXHN65LE1bZ+zj6IYFMfKXM+36Q4OI2CSx5ZbUI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391726AbfFMQNU (ORCPT ); Thu, 13 Jun 2019 12:13:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:59988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731206AbfFMImv (ORCPT ); Thu, 13 Jun 2019 04:42:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C9FDE20851; Thu, 13 Jun 2019 08:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560415370; bh=0nF0E6OR/0/YkO50J1rU0QWN6hYYNx0848W/umyVxWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pOOkmyUzHCYWMDGLhmselmHLtwyYJy81oUip+SPc3gWbcaS6PF1S3xcc0D3zgHbp1 RUs9i5MFzH0aV5dRPGP8KKXtayMnwbBDO/SKP2ekhWyuxkLHDCr8yg/78kb6UgGMTJ Bqjkpt4CRiQ9TWwmSvIhy8xEdCpg+Khxh65BhbHI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wesley Sheng , Bjorn Helgaas , Logan Gunthorpe , Sasha Levin Subject: [PATCH 4.19 071/118] switchtec: Fix unintended mask of MRPC event Date: Thu, 13 Jun 2019 10:33:29 +0200 Message-Id: <20190613075648.043874764@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190613075643.642092651@linuxfoundation.org> References: <20190613075643.642092651@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 083c1b5e50b701899dc32445efa8b153685260d5 ] When running application tool switchtec-user's `firmware update` and `event wait` commands concurrently, sometimes the firmware update speed reduced significantly. It is because when the MRPC event happened after MRPC event occurrence check but before the event mask loop reaches 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 checks time out. 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 Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe Signed-off-by: Sasha Levin --- 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 37d0c15c9eeb..72db2e0ebced 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -1116,7 +1116,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); -- 2.20.1