From patchwork Thu Nov 4 06:15:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 301062 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA46FVjo026309 for ; Thu, 4 Nov 2010 06:15:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932072Ab0KDGP3 (ORCPT ); Thu, 4 Nov 2010 02:15:29 -0400 Received: from mga01.intel.com ([192.55.52.88]:24589 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932070Ab0KDGP1 (ORCPT ); Thu, 4 Nov 2010 02:15:27 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 03 Nov 2010 23:15:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.58,293,1286175600"; d="scan'208";a="854031221" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.14]) by fmsmga001.fm.intel.com with ESMTP; 03 Nov 2010 23:15:16 -0700 Received: from yasker by syang10-desktop with local (Exim 4.72) (envelope-from ) id 1PDt6f-00012T-QW; Thu, 04 Nov 2010 14:15:29 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: "Michael S. Tsirkin" , kvm@vger.kernel.org, Sheng Yang , Matthew Wilcox , Jesse Barnes , linux-pci@vger.kernel.org Subject: [PATCH 2/5] PCI: Add mask bit definition for MSI-X table Date: Thu, 4 Nov 2010 14:15:18 +0800 Message-Id: <1288851321-3964-3-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1288851321-3964-1-git-send-email-sheng@linux.intel.com> References: <1288851321-3964-1-git-send-email-sheng@linux.intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 04 Nov 2010 06:15:31 +0000 (UTC) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 69b7be3..673e7dc 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -158,7 +158,7 @@ static u32 __msix_mask_irq(struct msi_desc *desc, u32 flag) u32 mask_bits = desc->masked; unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_VECTOR_CTRL; - mask_bits &= ~1; + mask_bits &= ~PCI_MSIX_ENTRY_CTRL_MASKBIT; mask_bits |= flag; writel(mask_bits, desc->mask_base + offset); @@ -185,7 +185,7 @@ static void msi_set_mask_bit(unsigned irq, u32 flag) void mask_msi_irq(unsigned int irq) { - msi_set_mask_bit(irq, 1); + msi_set_mask_bit(irq, PCI_MSIX_ENTRY_CTRL_MASKBIT); } void unmask_msi_irq(unsigned int irq) diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index acfc224..ff51632 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h @@ -313,6 +313,7 @@ #define PCI_MSIX_ENTRY_UPPER_ADDR 4 #define PCI_MSIX_ENTRY_DATA 8 #define PCI_MSIX_ENTRY_VECTOR_CTRL 12 +#define PCI_MSIX_ENTRY_CTRL_MASKBIT 1 /* CompactPCI Hotswap Register */