linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pci, msi: Remove unused/obsolete macros and definitions
@ 2009-04-20  1:54 Hidetoshi Seto
  2009-04-20 11:06 ` Matthew Wilcox
  2009-05-05 18:37 ` Jesse Barnes
  0 siblings, 2 replies; 3+ messages in thread
From: Hidetoshi Seto @ 2009-04-20  1:54 UTC (permalink / raw)
  To: linux-kernel, linux-pci; +Cc: Jesse Barnes

Impact: cleanup, spec compliance

This patch does:

 - Remove unused msi/msix_enable/disable macros.
   User should use msi/msix_set_enable() functions instead.

 - Remove unused msix_mask/unmask/pending macros.
   These macros are useless because they are not based on any of
   the PCI Local Bus Specifications properly.
   It seems that they were written based on a draft of PCI spec,
   and that the draft was the MSI-X ECN that underwent membership
   review in September 2002.
   (* In the draft, the size of a entry in MSI-X table was 64bit,
      containing 32bit message data and DWORD aligned lower address
      plus a pending bit and a mask bit.(30+1+1bit)  The higher
      address was placed in MSI-X capability structure and shared
      by all entries.)

 - Remove PCI_MSIX_FLAGS_BITMASK.
   This definition also come from the draft ECN.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/pci/msi.h        |    8 +-------
 include/linux/pci_regs.h |    1 -
 2 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h
index 71f4df2..4fed592 100644
--- a/drivers/pci/msi.h
+++ b/drivers/pci/msi.h
@@ -19,18 +19,12 @@
 	( (is64bit == 1) ? base+PCI_MSI_DATA_64 : base+PCI_MSI_DATA_32 )
 #define msi_mask_bits_reg(base, is64bit) \
 	( (is64bit == 1) ? base+PCI_MSI_MASK_BIT : base+PCI_MSI_MASK_BIT-4)
-#define msi_disable(control)		control &= ~PCI_MSI_FLAGS_ENABLE
 #define is_64bit_address(control)	(!!(control & PCI_MSI_FLAGS_64BIT))
 #define is_mask_bit_support(control)	(!!(control & PCI_MSI_FLAGS_MASKBIT))
 
 #define msix_table_offset_reg(base)	(base + 0x04)
 #define msix_pba_offset_reg(base)	(base + 0x08)
-#define msix_enable(control)	 	control |= PCI_MSIX_FLAGS_ENABLE
-#define msix_disable(control)	 	control &= ~PCI_MSIX_FLAGS_ENABLE
 #define msix_table_size(control) 	((control & PCI_MSIX_FLAGS_QSIZE)+1)
-#define multi_msix_capable		msix_table_size
-#define msix_unmask(address)	 	(address & ~PCI_MSIX_FLAGS_BITMASK)
-#define msix_mask(address)		(address | PCI_MSIX_FLAGS_BITMASK)
-#define msix_is_pending(address) 	(address & PCI_MSIX_FLAGS_PENDMASK)
+#define multi_msix_capable(control)	msix_table_size((control))
 
 #endif /* MSI_H */
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index e4d08c1..ad57aa8 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -304,7 +304,6 @@
 #define  PCI_MSIX_FLAGS_ENABLE	(1 << 15)
 #define  PCI_MSIX_FLAGS_MASKALL	(1 << 14)
 #define PCI_MSIX_FLAGS_BIRMASK	(7 << 0)
-#define PCI_MSIX_FLAGS_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */
 
-- 
1.6.2.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] pci, msi: Remove unused/obsolete macros and definitions
  2009-04-20  1:54 [PATCH 1/2] pci, msi: Remove unused/obsolete macros and definitions Hidetoshi Seto
@ 2009-04-20 11:06 ` Matthew Wilcox
  2009-05-05 18:37 ` Jesse Barnes
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2009-04-20 11:06 UTC (permalink / raw)
  To: Hidetoshi Seto; +Cc: linux-kernel, linux-pci, Jesse Barnes

On Mon, Apr 20, 2009 at 10:54:52AM +0900, Hidetoshi Seto wrote:
>  - Remove unused msi/msix_enable/disable macros.
>    User should use msi/msix_set_enable() functions instead.

I don't think they were ever intended for drivers; I think they were
supposed to be helper macros for msi.c.  Regardless, deleting them is
the right thing to do.

>  - Remove unused msix_mask/unmask/pending macros.
>    These macros are useless because they are not based on any of
>    the PCI Local Bus Specifications properly.
>    It seems that they were written based on a draft of PCI spec,
>    and that the draft was the MSI-X ECN that underwent membership
>    review in September 2002.
>    (* In the draft, the size of a entry in MSI-X table was 64bit,
>       containing 32bit message data and DWORD aligned lower address
>       plus a pending bit and a mask bit.(30+1+1bit)  The higher
>       address was placed in MSI-X capability structure and shared
>       by all entries.)

I think you're right.  Unfortunately, the old MSI-X ECN was actually
incorporated into a version of the PCI 3.0 spec -- I have a document
here named pci3.0-081202.pdf which has exactly the layout you describe.
So it probably gained wider currency than it should have.

>  - Remove PCI_MSIX_FLAGS_BITMASK.
>    This definition also come from the draft ECN.

Yep.

> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] pci, msi: Remove unused/obsolete macros and definitions
  2009-04-20  1:54 [PATCH 1/2] pci, msi: Remove unused/obsolete macros and definitions Hidetoshi Seto
  2009-04-20 11:06 ` Matthew Wilcox
@ 2009-05-05 18:37 ` Jesse Barnes
  1 sibling, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2009-05-05 18:37 UTC (permalink / raw)
  To: Hidetoshi Seto; +Cc: linux-kernel, linux-pci, Jesse Barnes

On Mon, 20 Apr 2009 10:54:52 +0900
Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> wrote:

> Impact: cleanup, spec compliance
> 
> This patch does:
> 
>  - Remove unused msi/msix_enable/disable macros.
>    User should use msi/msix_set_enable() functions instead.
> 
>  - Remove unused msix_mask/unmask/pending macros.
>    These macros are useless because they are not based on any of
>    the PCI Local Bus Specifications properly.
>    It seems that they were written based on a draft of PCI spec,
>    and that the draft was the MSI-X ECN that underwent membership
>    review in September 2002.
>    (* In the draft, the size of a entry in MSI-X table was 64bit,
>       containing 32bit message data and DWORD aligned lower address
>       plus a pending bit and a mask bit.(30+1+1bit)  The higher
>       address was placed in MSI-X capability structure and shared
>       by all entries.)
> 
>  - Remove PCI_MSIX_FLAGS_BITMASK.
>    This definition also come from the draft ECN.
> 
> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>

Applied to my linux-next branch, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-05 18:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20  1:54 [PATCH 1/2] pci, msi: Remove unused/obsolete macros and definitions Hidetoshi Seto
2009-04-20 11:06 ` Matthew Wilcox
2009-05-05 18:37 ` Jesse Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).