From patchwork Fri Aug 1 04:54:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 4660301 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 82DE09F36A for ; Fri, 1 Aug 2014 04:54:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD082201BB for ; Fri, 1 Aug 2014 04:54:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F445200F4 for ; Fri, 1 Aug 2014 04:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752944AbaHAEyl (ORCPT ); Fri, 1 Aug 2014 00:54:41 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:40794 "EHLO e28smtp02.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbaHAEyk (ORCPT ); Fri, 1 Aug 2014 00:54:40 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 1 Aug 2014 10:24:38 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 1 Aug 2014 10:24:36 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 66E313940018 for ; Fri, 1 Aug 2014 10:24:35 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s714sd5258589184 for ; Fri, 1 Aug 2014 10:24:40 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s714sXvX008338 for ; Fri, 1 Aug 2014 10:24:34 +0530 Received: from shangw (shangw.cn.ibm.com [9.125.213.157]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id s714sWMu008292; Fri, 1 Aug 2014 10:24:33 +0530 Received: by shangw (Postfix, from userid 1000) id DB6E33E026A; Fri, 1 Aug 2014 14:54:31 +1000 (EST) From: Gavin Shan To: linux-pci@vger.kernel.org Cc: amirv@mellanox.com, alex.williamson@redhat.com, Gavin Shan Subject: [PATCH v2] PCI: Mark broken INTx masking for Mellanox devices Date: Fri, 1 Aug 2014 14:54:31 +1000 Message-Id: <1406868871-350-1-git-send-email-gwshan@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.3.2 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14080104-5816-0000-0000-00000045A163 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The VFIO driver is routing LSI interrupts by capturing, masking, and then delivering. When passing though Mallanox adapters from host to guest, interrupt storm was reported from host and guest. That's because we can't mask the LSI interrupt with help of PCI command register. [root@ncc-1701 ~]# lspci | grep Mellanox 0001:05:00.0 Ethernet controller: Mellanox Technologies MT27500 \ Family [ConnectX-3] 0005:01:00.0 Ethernet controller: Mellanox Technologies MT26448 \ [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0) The patch marks broken INTx masking for Mellanox devices so that the VFIO driver will always mask the interrupt from interrupt controller side to avoid interrupt storm. Cc: Amir Vadai Suggested-by: Benjamin Herrenschmidt Signed-off-by: Gavin Shan --- drivers/pci/quirks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index d0f6926..8c2b96f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2977,6 +2977,10 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030, quirk_broken_intx_masking); DECLARE_PCI_FIXUP_HEADER(0x1814, 0x0601, /* Ralink RT2800 802.11n PCI */ quirk_broken_intx_masking); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0x1003, + quirk_broken_intx_masking); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0x6750, + quirk_broken_intx_masking); /* * Realtek RTL8169 PCI Gigabit Ethernet Controller (rev 10) * Subsystem: Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC