bk://kernel.bkbits.net/gregkh/linux/pci-2.6
dsaxena@plexity.net|ChangeSet|20040331225752|49305 dsaxena

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/03/31 19:18:44-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/03/31 19:18:41-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/31 14:57:52-08:00 dsaxena@plexity.net 
#   [PATCH] PCI: Allow arch-specific pci_set_dma_mask and friends
#   
#   The patch provides the ability for architectures to have custom
#   implementations of pci_set_dma_mask() and friends (dac_set_dma_mask
#   and set_consistent_dma_mask). The reason I need this is b/c I have
#   a chipset (Intel ARM IXP425) that has a broken PCI interface that
#   only allows PCI dma to/from the bottom 64MB of system memory.  To get
#   around this limitation, I trap a custom dma-mapping implementation that
#   bounces buffers outside the 64MB window. At device discover time, my
#   custom platform_notify() function gets called and it sets the dma_mask
#   to (64MB-1) and in ARM's dma-mapping code, I check for dma_mask != 0xffffffff
#   and if that is true, I call the special bounce helpers. This works great
#   except that certain drivers (e100, ide-pci) call pci_set_dma_mask()
#   with 0xffffffff and the generic implementation only allows for the
#   architecture-defined pci_dma_supported() to return true or false. There
#   is no method for the architecture to tell the PCI layer "I can't set
#   the mask to 0xffffffff, but I can set it to this other value" and there
#   is no way to pass that back to the driver. What this means is that if
#   I have pci_set_dma_supported() return failure on full 32-bit DMA, the
#   driver will not initialize the card; however, if I return true,
#   pci_set_dma_mask() will set the dma mask to full 32-bits and I can no
#   longer trap and will have buffers that are not dma-able and cause
#   PCI master aborts.  Both of those are not acceptable.  IMHO, the
#   driver shouldn't care if the architecture has to bounce DMA outside of
#   64MB and since this is not something most architectures have to worry
#   about, the easiest way to get around the issue is by allowing custom
#   pci_set_dma_mask() for arches that need it but keeping the generic
#   implementation for those that do not.  In my case, it simply returns
#   0 to the driver but keeps the device mask set to 64MB-1 so I can trap.
# 
# drivers/pci/pci.c
#   2004/03/26 08:58:01-08:00 dsaxena@plexity.net +5 -0
#   PCI: Allow arch-specific pci_set_dma_mask and friends
# 
# ChangeSet
#   2004/03/31 14:55:47-08:00 johnrose@austin.ibm.com 
#   [PATCH] PCI Hotplug: RPA PCI Hotplug - redundant free
#   
#   Please commit the following patch, which removes a redundant call to a
#   cleanup function from an error path of the module init code.
# 
# drivers/pci/hotplug/rpaphp_pci.c
#   2004/03/30 10:50:32-08:00 johnrose@austin.ibm.com +0 -1
#   PCI Hotplug: RPA PCI Hotplug - redundant free
# 
# ChangeSet
#   2004/03/31 14:53:59-08:00 rddunlap@osdl.org 
#   [PATCH] PCI: move DMA_nnBIT_MASK to linux/dma-mapping.h
# 
# include/linux/pci.h
#   2004/03/30 17:53:49-08:00 rddunlap@osdl.org +0 -3
#   PCI: move DMA_nnBIT_MASK to linux/dma-mapping.h
# 
# include/linux/dma-mapping.h
#   2004/03/30 17:53:54-08:00 rddunlap@osdl.org +3 -0
#   PCI: move DMA_nnBIT_MASK to linux/dma-mapping.h
# 
# ChangeSet
#   2004/03/31 12:50:28-08:00 akpm@bix.(none) 
#   Merge
# 
# drivers/pci/hotplug/pciehp_hpc.c
#   2004/03/31 12:50:27-08:00 akpm@bix.(none) +0 -0
#   SCCS merged
# 
# ChangeSet
#   2004/03/30 17:26:44-08:00 rddunlap@osdl.org 
#   [PATCH] PCI: add DMA_{64,32}BIT constants
#   
#   On Tue, 23 Mar 2004 00:23:05 -0500 Jeff Garzik <jgarzik@pobox.com> wrote:
#   >>Yeah well...  in the intervening time, somebody on IRC commented
#   >>
#   >>"so what is so PCI-specific about those constants?"
#   >>
#   >>They probably ought to be DMA_{32,64}BIT_MASK or somesuch.
#   
#   Here's an updated patch, applies to 2.6.5-rc2-bk9.
#   I left the DMA_xxBIT_MASK defines in linux/pci.h, although
#   they aren't necessarily PCI-specific.  Would we prefer to
#   have them in linux/dma-mapping.h ?
# 
# include/linux/pci.h
#   2004/03/29 21:57:18-08:00 rddunlap@osdl.org +3 -0
#   PCI: add DMA_{64,32}BIT constants
# 
# drivers/net/ixgb/ixgb_main.c
#   2004/03/29 22:27:20-08:00 rddunlap@osdl.org +2 -2
#   PCI: add DMA_{64,32}BIT constants
# 
# drivers/net/ixgb/ixgb.h
#   2004/03/29 21:57:18-08:00 rddunlap@osdl.org +0 -2
#   PCI: add DMA_{64,32}BIT constants
# 
# drivers/net/e1000/e1000_main.c
#   2004/03/29 22:17:55-08:00 rddunlap@osdl.org +2 -2
#   PCI: add DMA_{64,32}BIT constants
# 
# drivers/net/e1000/e1000.h
#   2004/03/29 21:57:18-08:00 rddunlap@osdl.org +0 -2
#   PCI: add DMA_{64,32}BIT constants
# 
# Documentation/DMA-mapping.txt
#   2004/03/29 21:57:18-08:00 rddunlap@osdl.org +8 -8
#   PCI: add DMA_{64,32}BIT constants
# 
# ChangeSet
#   2004/03/30 17:24:37-08:00 greg@kroah.com 
#   Cset exclude: jgarzik@redhat.com|ChangeSet|20040323051558|61282
# 
# include/linux/pci.h
#   2004/03/30 17:24:11-08:00 greg@kroah.com +0 -0
#   Exclude
# 
# drivers/net/ixgb/ixgb.h
#   2004/03/30 17:24:11-08:00 greg@kroah.com +0 -0
#   Exclude
# 
# drivers/net/e1000/e1000.h
#   2004/03/30 17:24:11-08:00 greg@kroah.com +0 -0
#   Exclude
# 
# Documentation/DMA-mapping.txt
#   2004/03/30 17:24:11-08:00 greg@kroah.com +0 -0
#   Exclude
# 
# ChangeSet
#   2004/03/29 18:01:08-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# arch/arm/Kconfig
#   2004/03/29 18:01:05-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/27 02:23:03-08:00 akpm@bix.(none) 
#   Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6
#   into bix.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/03/27 02:23:00-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/pci/probe.c
#   2004/03/27 02:23:00-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/26 16:32:52-08:00 willy@debian.org 
#   [PATCH] PCI Hotplug: Rewrite acpiphp detect_used_resource
#   
#   There are two unrelated problems in acpiphp that are fixed by this patch.
#   First, acpiphp can be a module, so it is unsafe to probe the BARs of each
#   device while it initialises -- the device may be active at the time.
#   Second, it does not know about PCI-PCI bridge registers and so it reads
#   garbage for the last 4 registers of the PCI-PCI bridge card and doesn't
#   take into account the ranges that are forwarded by the bridge.
#   
#   This patch avoids all that by using the struct resources embedded in
#   the pci_dev.  Note that we no longer need to recurse as all the devices
#   on the other side of a PCI-PCI bridge have their resources entirely
#   contained within the PCI-PCI bridge's ranges.
# 
# drivers/pci/hotplug/acpiphp_pci.c
#   2004/03/22 14:43:00-08:00 willy@debian.org +26 -84
#   PCI Hotplug: Rewrite acpiphp detect_used_resource
# 
# ChangeSet
#   2004/03/26 16:32:21-08:00 willy@debian.org 
#   [PATCH] PCI Hotplug: Don't up() twice in acpiphp
#   
#   On the error path, we currently try to up() a semaphore twice.
#   There was also a typo in an error message.
# 
# drivers/pci/hotplug/acpiphp_glue.c
#   2004/03/22 14:43:10-08:00 willy@debian.org +18 -20
#   PCI Hotplug: Don't up() twice in acpiphp
# 
# ChangeSet
#   2004/03/26 16:31:44-08:00 dlsy@snoqualmie.dp.intel.com 
#   [PATCH] PCI: Updates for PCI Express hot-plug driver
# 
# include/linux/pci_ids.h
#   2004/03/22 11:14:28-08:00 dlsy@snoqualmie.dp.intel.com +1 -0
#   PCI: Updates for PCI Express hot-plug driver
# 
# drivers/pci/quirks.c
#   2004/03/22 11:14:28-08:00 dlsy@snoqualmie.dp.intel.com +11 -0
#   PCI: Updates for PCI Express hot-plug driver
# 
# drivers/pci/pci.h
#   2004/03/22 11:14:28-08:00 dlsy@snoqualmie.dp.intel.com +2 -0
#   PCI: Updates for PCI Express hot-plug driver
# 
# drivers/pci/hotplug/shpchprm_legacy.c
#   2004/03/22 11:14:28-08:00 dlsy@snoqualmie.dp.intel.com +0 -30
#   PCI: Updates for PCI Express hot-plug driver
# 
# drivers/pci/hotplug/shpchprm_acpi.c
#   2004/03/22 11:14:28-08:00 dlsy@snoqualmie.dp.intel.com +2 -1
#   PCI: Updates for PCI Express hot-plug driver
# 
# drivers/pci/hotplug/shpchp_hpc.c
#   2004/03/22 11:14:24-08:00 dlsy@snoqualmie.dp.intel.com +5 -6
#   PCI: Updates for PCI Express hot-plug driver
# 
# drivers/pci/hotplug/pciehp_pci.c
#   2004/03/22 11:16:13-08:00 dlsy@snoqualmie.dp.intel.com +0 -2
#   PCI: Updates for PCI Express hot-plug driver
# 
# drivers/pci/hotplug/pciehp_hpc.c
#   2004/03/22 11:14:14-08:00 dlsy@snoqualmie.dp.intel.com +74 -17
#   PCI: Updates for PCI Express hot-plug driver
# 
# ChangeSet
#   2004/03/26 16:24:34-08:00 greg@kroah.com 
#   Merge bk://kernel.bkbits.net/jgarzik/pci-dma-mask-2.6
#   into kroah.com:/home/greg/linux/BK/pci-2.6
# 
# include/linux/pci.h
#   2004/03/26 16:24:30-08:00 greg@kroah.com +0 -0
#   Auto merged
# 
# Documentation/DMA-mapping.txt
#   2004/03/26 16:24:30-08:00 greg@kroah.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/26 16:11:41-08:00 greg@kroah.com 
#   PCI: add ability to access pci extended config space for PCI Express devices
#   
#   Patch originally written by Intel, cleaned up and made sane by 
#   Matthew Wilcox <willy@debian.org> and then tweaked a bit more by me.
#   
#   From Matt's original email:
#    - Add cfg_size to struct pci_dev.
#    - Use it in sysfs and procfs.
#    - Introduce pci_find_ext_capability() for finding extended capabilities.
#    - Change the PCI_X_STATUS defines to match the spec (mea culpa there).
#    - Add defines for the extended capabilities.
# 
# include/linux/pci.h
#   2004/03/26 08:11:04-08:00 greg@kroah.com +87 -12
#   PCI: add ability to access pci extended config space for PCI Express devices
#   
#   Patch originally written by Intel, cleaned up and made sane by 
#   Matthew Wilcox <willy@debian.org> and then tweaked a bit more by me.
#   
#   From Matt's original email:
#    - Add cfg_size to struct pci_dev.
#    - Use it in sysfs and procfs.
#    - Introduce pci_find_ext_capability() for finding extended capabilities.
#    - Change the PCI_X_STATUS defines to match the spec (mea culpa there).
#    - Add defines for the extended capabilities.
# 
# drivers/pci/proc.c
#   2004/03/26 08:11:04-08:00 greg@kroah.com +13 -13
#   PCI: add ability to access pci extended config space for PCI Express devices
#   
#   Patch originally written by Intel, cleaned up and made sane by 
#   Matthew Wilcox <willy@debian.org> and then tweaked a bit more by me.
#   
#   From Matt's original email:
#    - Add cfg_size to struct pci_dev.
#    - Use it in sysfs and procfs.
#    - Introduce pci_find_ext_capability() for finding extended capabilities.
#    - Change the PCI_X_STATUS defines to match the spec (mea culpa there).
#    - Add defines for the extended capabilities.
# 
# drivers/pci/probe.c
#   2004/03/26 08:11:04-08:00 greg@kroah.com +40 -0
#   PCI: add ability to access pci extended config space for PCI Express devices
#   
#   Patch originally written by Intel, cleaned up and made sane by 
#   Matthew Wilcox <willy@debian.org> and then tweaked a bit more by me.
#   
#   From Matt's original email:
#    - Add cfg_size to struct pci_dev.
#    - Use it in sysfs and procfs.
#    - Introduce pci_find_ext_capability() for finding extended capabilities.
#    - Change the PCI_X_STATUS defines to match the spec (mea culpa there).
#    - Add defines for the extended capabilities.
# 
# drivers/pci/pci.c
#   2004/03/26 08:11:04-08:00 greg@kroah.com +50 -8
#   PCI: add ability to access pci extended config space for PCI Express devices
#   
#   Patch originally written by Intel, cleaned up and made sane by 
#   Matthew Wilcox <willy@debian.org> and then tweaked a bit more by me.
#   
#   From Matt's original email:
#    - Add cfg_size to struct pci_dev.
#    - Use it in sysfs and procfs.
#    - Introduce pci_find_ext_capability() for finding extended capabilities.
#    - Change the PCI_X_STATUS defines to match the spec (mea culpa there).
#    - Add defines for the extended capabilities.
# 
# drivers/pci/pci-sysfs.c
#   2004/03/26 08:11:04-08:00 greg@kroah.com +22 -7
#   PCI: add ability to access pci extended config space for PCI Express devices
#   
#   Patch originally written by Intel, cleaned up and made sane by 
#   Matthew Wilcox <willy@debian.org> and then tweaked a bit more by me.
#   
#   From Matt's original email:
#    - Add cfg_size to struct pci_dev.
#    - Use it in sysfs and procfs.
#    - Introduce pci_find_ext_capability() for finding extended capabilities.
#    - Change the PCI_X_STATUS defines to match the spec (mea culpa there).
#    - Add defines for the extended capabilities.
# 
# ChangeSet
#   2004/03/26 12:19:23-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/03/26 12:19:20-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/ia64/Kconfig
#   2004/03/26 12:19:20-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/arm/Kconfig
#   2004/03/26 12:19:20-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/24 02:42:26-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# arch/i386/Kconfig
#   2004/03/24 02:42:24-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/19 15:25:33-08:00 akpm@bix.(none) 
#   Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6
#   into bix.(none):/usr/src/bk-pci
# 
# drivers/pci/hotplug/rpaphp_core.c
#   2004/03/19 15:25:30-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/19 10:07:30-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# arch/i386/Kconfig
#   2004/03/19 10:07:27-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/arm/Kconfig
#   2004/03/19 10:07:27-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/03/15 22:42:56-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/03/12 00:53:36-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/16 20:23:12-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/03/16 20:22:53-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/16 12:49:12-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# drivers/pci/hotplug/rpaphp_core.c
#   2004/03/16 12:49:00-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/ia64/Kconfig
#   2004/03/16 12:49:00-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/03/16 12:49:00-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/15 22:43:11-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/03/15 22:42:57-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/base/Makefile
#   2004/03/15 22:42:56-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/ia64/Kconfig
#   2004/03/15 22:42:56-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/arm/Kconfig
#   2004/03/15 22:42:56-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/14 14:12:57-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# drivers/pci/probe.c
#   2004/03/14 14:12:50-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/03/14 14:12:50-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/12 10:48:16-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# arch/ia64/Kconfig
#   2004/03/12 10:48:01-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/03/12 10:48:01-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/12 00:53:55-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci
# 
# ChangeSet
#   2004/03/10 21:02:04-08:00 akpm@mnm.(none) 
#   Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6
#   into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/hotplug/rpaphp_core.c
#   2004/03/10 21:01:55-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/pci/hotplug/rpaphp.h
#   2004/03/10 21:01:55-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/06 12:59:56-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# arch/i386/Kconfig
#   2004/03/06 12:59:50-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/05 18:42:06-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/03/05 18:41:59-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/03/02 22:20:54-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/hotplug/rpaphp_core.c
#   2004/03/02 22:20:47-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/pci/hotplug/rpaphp.h
#   2004/03/02 22:20:47-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/pci/hotplug/Kconfig
#   2004/03/02 22:20:47-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/28 17:44:24-08:00 akpm@mnm.(none) 
#   Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6
#   into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/hotplug/rpaphp_core.c
#   2004/02/28 17:44:17-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/pci/hotplug/rpaphp.h
#   2004/02/28 17:44:17-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/pci/hotplug/Kconfig
#   2004/02/28 17:44:17-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/28 17:42:40-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/hotplug/rpaphp_core.c
#   2004/02/28 17:42:34-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/pci/hotplug/rpaphp.h
#   2004/02/28 17:42:33-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/pci/hotplug/Kconfig
#   2004/02/28 17:42:33-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/ia64/Kconfig
#   2004/02/28 17:42:33-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/27 13:07:48-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/02/27 13:07:41-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/pci/hotplug/rpaphp_core.c
#   2004/02/27 13:07:41-08:00 akpm@mnm.(none) +0 -1
#   Auto merged
# 
# drivers/pci/hotplug/rpaphp.h
#   2004/02/27 13:07:41-08:00 akpm@mnm.(none) +0 -1
#   Auto merged
# 
# ChangeSet
#   2004/02/26 12:37:26-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/hotplug/Kconfig
#   2004/02/26 12:37:19-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/arm/Kconfig
#   2004/02/26 12:37:19-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/25 11:57:36-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/02/25 11:57:29-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/02/25 11:57:29-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/02/25 11:57:29-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/24 13:27:08-08:00 akpm@mnm.(none) 
#   Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6
#   into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/probe.c
#   2004/02/24 13:27:01-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/24 13:25:22-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# arch/i386/Kconfig
#   2004/02/24 13:25:16-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/23 20:32:00-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# arch/arm/Kconfig
#   2004/02/23 20:31:53-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/20 18:55:32-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# arch/arm/Kconfig
#   2004/02/20 18:55:26-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/20 13:59:53-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/02/20 13:59:47-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/02/20 13:59:47-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/ia64/Kconfig
#   2004/02/20 13:59:46-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/02/20 13:59:46-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/arm/Kconfig
#   2004/02/20 13:59:46-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/19 23:12:37-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# include/linux/pci_ids.h
#   2004/02/19 23:12:30-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/02/19 23:12:30-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/19 20:56:02-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/probe.c
#   2004/02/19 20:55:56-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/02/19 20:55:56-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/ia64/Kconfig
#   2004/02/19 20:55:55-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/02/19 20:55:55-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# arch/arm/Kconfig
#   2004/02/19 20:55:55-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/18 18:56:37-08:00 akpm@mnm.(none) 
#   Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6
#   into mnm.(none):/usr/src/bk-pci
# 
# arch/x86_64/Kconfig
#   2004/02/18 18:56:30-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/09 18:07:41-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/probe.c
#   2004/02/09 18:07:35-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/base/Makefile
#   2004/02/09 18:07:35-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/04 12:10:06-08:00 akpm@mnm.(none) 
#   Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/probe.c
#   2004/02/04 12:09:59-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# drivers/base/Makefile
#   2004/02/04 12:09:59-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/02/02 22:26:26-08:00 akpm@mnm.(none) 
#   Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6
#   into mnm.(none):/usr/src/bk-pci
# 
# drivers/pci/probe.c
#   2004/02/02 22:26:19-08:00 akpm@mnm.(none) +0 -0
#   Auto merged
# 
diff -Nru a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
--- a/Documentation/DMA-mapping.txt	Fri Apr  2 11:31:03 2004
+++ b/Documentation/DMA-mapping.txt	Fri Apr  2 11:31:03 2004
@@ -132,7 +132,7 @@
 The standard 32-bit addressing PCI device would do something like
 this:
 
-	if (pci_set_dma_mask(pdev, 0xffffffff)) {
+	if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
 		printk(KERN_WARNING
 		       "mydev: No suitable DMA available.\n");
 		goto ignore_this_device;
@@ -151,9 +151,9 @@
 
 	int using_dac;
 
-	if (!pci_set_dma_mask(pdev, 0xffffffffffffffff)) {
+	if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
 		using_dac = 1;
-	} else if (!pci_set_dma_mask(pdev, 0xffffffff)) {
+	} else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
 		using_dac = 0;
 	} else {
 		printk(KERN_WARNING
@@ -166,14 +166,14 @@
 
 	int using_dac, consistent_using_dac;
 
-	if (!pci_set_dma_mask(pdev, 0xffffffffffffffff)) {
+	if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
 		using_dac = 1;
 	   	consistent_using_dac = 1;
-		pci_set_consistent_dma_mask(pdev, 0xffffffffffffffff)
-	} else if (!pci_set_dma_mask(pdev, 0xffffffff)) {
+		pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
+	} else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
 		using_dac = 0;
 		consistent_using_dac = 0;
-		pci_set_consistent_dma_mask(pdev, 0xffffffff)
+		pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
 	} else {
 		printk(KERN_WARNING
 		       "mydev: No suitable DMA available.\n");
@@ -215,7 +215,7 @@
 
 Here is pseudo-code showing how this might be done:
 
-	#define PLAYBACK_ADDRESS_BITS	0xffffffff
+	#define PLAYBACK_ADDRESS_BITS	DMA_32BIT_MASK
 	#define RECORD_ADDRESS_BITS	0x00ffffff
 
 	struct my_sound_card *card;
diff -Nru a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
--- a/drivers/net/e1000/e1000.h	Fri Apr  2 11:31:03 2004
+++ b/drivers/net/e1000/e1000.h	Fri Apr  2 11:31:03 2004
@@ -74,8 +74,6 @@
 #define BAR_0		0
 #define BAR_1		1
 #define BAR_5		5
-#define PCI_DMA_64BIT	0xffffffffffffffffULL
-#define PCI_DMA_32BIT	0x00000000ffffffffULL
 
 
 struct e1000_adapter;
diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/net/e1000/e1000_main.c	Fri Apr  2 11:31:03 2004
@@ -383,10 +383,10 @@
 	if((err = pci_enable_device(pdev)))
 		return err;
 
-	if(!(err = pci_set_dma_mask(pdev, PCI_DMA_64BIT))) {
+	if(!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
 		pci_using_dac = 1;
 	} else {
-		if((err = pci_set_dma_mask(pdev, PCI_DMA_32BIT))) {
+		if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
 			E1000_ERR("No usable DMA configuration, aborting\n");
 			return err;
 		}
diff -Nru a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
--- a/drivers/net/ixgb/ixgb.h	Fri Apr  2 11:31:03 2004
+++ b/drivers/net/ixgb/ixgb.h	Fri Apr  2 11:31:03 2004
@@ -65,8 +65,6 @@
 #define BAR_0           0
 #define BAR_1           1
 #define BAR_5           5
-#define PCI_DMA_64BIT   0xffffffffffffffffULL
-#define PCI_DMA_32BIT   0x00000000ffffffffULL
 
 #include "ixgb_hw.h"
 #include "ixgb_ee.h"
diff -Nru a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
--- a/drivers/net/ixgb/ixgb_main.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/net/ixgb/ixgb_main.c	Fri Apr  2 11:31:03 2004
@@ -308,10 +308,10 @@
 		return i;
 	}
 
-	if (!(i = pci_set_dma_mask(pdev, PCI_DMA_64BIT))) {
+	if (!(i = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
 		pci_using_dac = 1;
 	} else {
-		if ((i = pci_set_dma_mask(pdev, PCI_DMA_32BIT))) {
+		if ((i = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
 			IXGB_ERR("No usable DMA configuration, aborting\n");
 			return i;
 		}
diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
--- a/drivers/pci/hotplug/acpiphp_glue.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/hotplug/acpiphp_glue.c	Fri Apr  2 11:31:03 2004
@@ -1243,40 +1243,38 @@
 
 /**
  * acpiphp_check_bridge - re-enumerate devices
+ *
+ * Iterate over all slots under this bridge and make sure that if a
+ * card is present they are enabled, and if not they are disabled.
  */
 int acpiphp_check_bridge(struct acpiphp_bridge *bridge)
 {
 	struct acpiphp_slot *slot;
-	unsigned int sta;
 	int retval = 0;
 	int enabled, disabled;
 
 	enabled = disabled = 0;
 
 	for (slot = bridge->slots; slot; slot = slot->next) {
-		sta = get_slot_status(slot);
+		unsigned int status = get_slot_status(slot);
 		if (slot->flags & SLOT_ENABLED) {
-			/* if enabled but not present, disable */
-			if (sta != ACPI_STA_ALL) {
-				retval = acpiphp_disable_slot(slot);
-				if (retval) {
-					err("Error occurred in enabling\n");
-					up(&slot->crit_sect);
-					goto err_exit;
-				}
-				disabled++;
+			if (status == ACPI_STA_ALL)
+				continue;
+			retval = acpiphp_disable_slot(slot);
+			if (retval) {
+				err("Error occurred in disabling\n");
+				goto err_exit;
 			}
+			disabled++;
 		} else {
-			/* if disabled but present, enable */
-			if (sta == ACPI_STA_ALL) {
-				retval = acpiphp_enable_slot(slot);
-				if (retval) {
-					err("Error occurred in enabling\n");
-					up(&slot->crit_sect);
-					goto err_exit;
-				}
-				enabled++;
+			if (status != ACPI_STA_ALL)
+				continue;
+			retval = acpiphp_enable_slot(slot);
+			if (retval) {
+				err("Error occurred in enabling\n");
+				goto err_exit;
 			}
+			enabled++;
 		}
 	}
 
diff -Nru a/drivers/pci/hotplug/acpiphp_pci.c b/drivers/pci/hotplug/acpiphp_pci.c
--- a/drivers/pci/hotplug/acpiphp_pci.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/hotplug/acpiphp_pci.c	Fri Apr  2 11:31:03 2004
@@ -198,106 +198,42 @@
 /* detect_used_resource - subtract resource under dev from bridge */
 static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev *dev)
 {
-	u32 bar, len;
-	u64 base;
-	u32 address[] = {
-		PCI_BASE_ADDRESS_0,
-		PCI_BASE_ADDRESS_1,
-		PCI_BASE_ADDRESS_2,
-		PCI_BASE_ADDRESS_3,
-		PCI_BASE_ADDRESS_4,
-		PCI_BASE_ADDRESS_5,
-		0
-	};
 	int count;
-	struct pci_resource *res;
 
 	dbg("Device %s\n", pci_name(dev));
 
-	for (count = 0; address[count]; count++) {	/* for 6 BARs */
-		pci_read_config_dword(dev, address[count], &bar);
+	for (count = 0; count < DEVICE_COUNT_RESOURCE; count++) {
+		struct pci_resource *res;
+		struct pci_resource **head;
+		unsigned long base = dev->resource[count].start;
+		unsigned long len = dev->resource[count].end - base + 1;
+		unsigned long flags = dev->resource[count].flags;
 
-		if (!bar)	/* This BAR is not implemented */
+		if (!flags)
 			continue;
 
-		pci_write_config_dword(dev, address[count], 0xFFFFFFFF);
-		pci_read_config_dword(dev, address[count], &len);
+		dbg("BAR[%d] 0x%lx - 0x%lx (0x%lx)\n", count, base,
+				base + len - 1, flags);
 
-		if (len & PCI_BASE_ADDRESS_SPACE_IO) {
-			/* This is IO */
-			base = bar & 0xFFFFFFFC;
-			len = len & (PCI_BASE_ADDRESS_IO_MASK & 0xFFFF);
-			len = len & ~(len - 1);
-
-			dbg("BAR[%d] %08x - %08x (IO)\n", count, (u32)base, (u32)base + len - 1);
-
-			spin_lock(&bridge->res_lock);
-			res = acpiphp_get_resource_with_base(&bridge->io_head, base, len);
-			spin_unlock(&bridge->res_lock);
-			if (res)
-				kfree(res);
+		if (flags & IORESOURCE_IO) {
+			head = &bridge->io_head;
+		} else if (flags & IORESOURCE_PREFETCH) {
+			head = &bridge->p_mem_head;
 		} else {
-			/* This is Memory */
-			base = bar & 0xFFFFFFF0;
-			if (len & PCI_BASE_ADDRESS_MEM_PREFETCH) {
-				/* pfmem */
-
-				len &= 0xFFFFFFF0;
-				len = ~len + 1;
-
-				if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) {	/* takes up another dword */
-					dbg("prefetch mem 64\n");
-					count += 1;
-				}
-				dbg("BAR[%d] %08x - %08x (PMEM)\n", count, (u32)base, (u32)base + len - 1);
-				spin_lock(&bridge->res_lock);
-				res = acpiphp_get_resource_with_base(&bridge->p_mem_head, base, len);
-				spin_unlock(&bridge->res_lock);
-				if (res)
-					kfree(res);
-			} else {
-				/* regular memory */
-
-				len &= 0xFFFFFFF0;
-				len = ~len + 1;
-
-				if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) {
-					/* takes up another dword */
-					dbg("mem 64\n");
-					count += 1;
-				}
-				dbg("BAR[%d] %08x - %08x (MEM)\n", count, (u32)base, (u32)base + len - 1);
-				spin_lock(&bridge->res_lock);
-				res = acpiphp_get_resource_with_base(&bridge->mem_head, base, len);
-				spin_unlock(&bridge->res_lock);
-				if (res)
-					kfree(res);
-			}
+			head = &bridge->mem_head;
 		}
 
-		pci_write_config_dword(dev, address[count], bar);
+		spin_lock(&bridge->res_lock);
+		res = acpiphp_get_resource_with_base(head, base, len);
+		spin_unlock(&bridge->res_lock);
+		if (res)
+			kfree(res);
 	}
 
 	return 0;
 }
 
 
-/* detect_pci_resource_bus - subtract resource under pci_bus */
-static void detect_used_resource_bus(struct acpiphp_bridge *bridge, struct pci_bus *bus)
-{
-	struct list_head *l;
-	struct pci_dev *dev;
-
-	list_for_each (l, &bus->devices) {
-		dev = pci_dev_b(l);
-		detect_used_resource(bridge, dev);
-		/* XXX recursive call */
-		if (dev->subordinate)
-			detect_used_resource_bus(bridge, dev->subordinate);
-	}
-}
-
-
 /**
  * acpiphp_detect_pci_resource - detect resources under bridge
  * @bridge: detect all resources already used under this bridge
@@ -306,7 +242,13 @@
  */
 int acpiphp_detect_pci_resource (struct acpiphp_bridge *bridge)
 {
-	detect_used_resource_bus(bridge, bridge->pci_bus);
+	struct list_head *l;
+	struct pci_dev *dev;
+
+	list_for_each (l, &bridge->pci_bus->devices) {
+		dev = pci_dev_b(l);
+		detect_used_resource(bridge, dev);
+	}
 
 	return 0;
 }
diff -Nru a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
--- a/drivers/pci/hotplug/pciehp_hpc.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/hotplug/pciehp_hpc.c	Fri Apr  2 11:31:03 2004
@@ -37,6 +37,7 @@
 #include <linux/spinlock.h>
 #include <linux/pci.h>
 #include <asm/system.h>
+#include "../pci.h"
 #include "pciehp.h"
 
 #ifdef DEBUG
@@ -315,12 +316,13 @@
 		dbg("%s : CMD_COMPLETED not clear after 1 sec.\n", __FUNCTION__);
 	}
 
-	retval = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL, cmd);
+	dbg("%s: Before hp_register_write_word SLOT_CTRL %x\n", __FUNCTION__, cmd);
+	retval = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL, cmd | CMD_CMPL_INTR_ENABLE);
 	if (retval) {
 		err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__);
 		return retval;
 	}
-	dbg("%s : hp_register_write_word SLOT_CTRL %x\n", __FUNCTION__, cmd);
+	dbg("%s : hp_register_write_word SLOT_CTRL %x\n", __FUNCTION__, cmd | CMD_CMPL_INTR_ENABLE);
 	dbg("%s : Exit\n", __FUNCTION__);
 
 	DBG_LEAVE_ROUTINE 
@@ -918,13 +920,33 @@
 			return IRQ_NONE;
 		}
 
-		temp_word = (temp_word & ~HP_INTR_ENABLE) | 0x00;
+		dbg("%s: Set Mask Hot-plug Interrupt Enable\n", __FUNCTION__);
+		dbg("%s: hp_register_read_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word);
+		temp_word = (temp_word & ~HP_INTR_ENABLE & ~CMD_CMPL_INTR_ENABLE) | 0x00;
 
 		rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL, temp_word);
 		if (rc) {
 			err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__);
 			return IRQ_NONE;
+			return IRQ_NONE;
+		}
+		dbg("%s: hp_register_write_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word);
+		
+		rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS, slot_status);
+		if (rc) {
+			err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__);
+			return IRQ_NONE;
+		}
+		dbg("%s: hp_register_read_word SLOT_STATUS with value %x\n", __FUNCTION__, slot_status); 
+		
+		/* Clear command complete interrupt caused by this write */
+		temp_word = 0x1f;
+		rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS, temp_word);
+		if (rc) {
+			err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__);
+			return IRQ_NONE;
 		}
+		dbg("%s: hp_register_write_word SLOT_STATUS with value %x\n", __FUNCTION__, temp_word);
 	}
 	
 	if (intr_loc & CMD_COMPLETED) {
@@ -949,7 +971,7 @@
 			hp_slot, php_ctlr->callback_instance_id);
 
 	/* Clear all events after serving them */
-	temp_word = slot_status | 0xff;
+	temp_word = 0x1F;
 	rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS, temp_word);
 	if (rc) {
 		err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__);
@@ -963,6 +985,8 @@
 			return IRQ_NONE;
 		}
 
+		dbg("%s: Unmask Hot-plug Interrupt Enable\n", __FUNCTION__);
+		dbg("%s: hp_register_read_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word);
 		temp_word = (temp_word & ~HP_INTR_ENABLE) | HP_INTR_ENABLE;
 
 		rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL, temp_word);
@@ -970,6 +994,23 @@
 			err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__);
 			return IRQ_NONE;
 		}
+		dbg("%s: hp_register_write_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word); 	
+	
+		rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS, slot_status);
+		if (rc) {
+			err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__);
+			return IRQ_NONE;
+		}
+		dbg("%s: hp_register_read_word SLOT_STATUS with value %x\n", __FUNCTION__, slot_status); 
+		
+		/* Clear command complete interrupt caused by this write */
+		temp_word = 0x1F;
+		rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS, temp_word);
+		if (rc) {
+			err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__);
+			return IRQ_NONE;
+		}
+		dbg("%s: hp_register_write_word SLOT_STATUS with value %x\n", __FUNCTION__, temp_word); 
 	}
 	
 	return IRQ_HANDLED;
@@ -1330,7 +1371,7 @@
 	}
 
 	dbg("%s: SLOT_CTRL %x value read %x\n", __FUNCTION__, SLOT_CTRL, temp_word);
-	temp_word = (temp_word & ~HP_INTR_ENABLE) | 0x00;
+	temp_word = (temp_word & ~HP_INTR_ENABLE & ~CMD_CMPL_INTR_ENABLE) | 0x00;
 
 	rc = hp_register_write_word(pdev, SLOT_CTRL, temp_word);
 	if (rc) {
@@ -1346,12 +1387,13 @@
 	}
 	dbg("%s: Mask HPIE SLOT_STATUS offset %x reads slot_status %x\n", __FUNCTION__, SLOT_STATUS, slot_status);
 
-	rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS, slot_status);
+	temp_word = 0x1F; /* Clear all events */
+	rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS, temp_word);
 	if (rc) {
 		err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__);
 		goto abort_free_ctlr;
 	}
-	dbg("%s: SLOT_STATUS offset %x writes slot_status %x\n", __FUNCTION__, SLOT_STATUS, slot_status);
+	dbg("%s: SLOT_STATUS offset %x writes slot_status %x\n", __FUNCTION__, SLOT_STATUS, temp_word);
 
 	if (pciehp_poll_mode)  {/* Install interrupt polling code */
 		/* Install and start the interrupt polling timer */
@@ -1359,15 +1401,16 @@
 		start_int_poll_timer( php_ctlr, 10 );   /* start with 10 second delay */
 	} else {
 		/* Installs the interrupt handler */
-#ifdef CONFIG_PCI_USE_VECTOR 
-		rc = pci_enable_msi(pdev);
-		if (rc) {
-			err("Can't get msi for the hotplug controller\n");
-			dbg("%s: rc = %x\n", __FUNCTION__, rc);
-			goto abort_free_ctlr;
+		dbg("%s: pciehp_msi_quirk = %x\n", __FUNCTION__, pciehp_msi_quirk);
+		if (!pciehp_msi_quirk) {
+			rc = pci_enable_msi(pdev);
+			if (rc) {
+				info("Can't get msi for the hotplug controller\n");
+				info("Use INTx for the hotplug controller\n");
+				dbg("%s: rc = %x\n", __FUNCTION__, rc);
+			} else 
+				php_ctlr->irq = pdev->irq;
 		}
-		php_ctlr->irq = pdev->irq;
-#endif		
 		rc = request_irq(php_ctlr->irq, pcie_isr, SA_SHIRQ, MY_NAME, (void *) ctrl);
 		dbg("%s: request_irq %d for hpc%d (returns %d)\n", __FUNCTION__, php_ctlr->irq, ctlr_seq_num, rc);
 		if (rc) {
@@ -1384,7 +1427,7 @@
 	dbg("%s: SLOT_CTRL %x value read %x\n", __FUNCTION__, SLOT_CTRL, temp_word);
 
 	intr_enable = ATTN_BUTTN_ENABLE | PWR_FAULT_DETECT_ENABLE | MRL_DETECT_ENABLE |
-					PRSN_DETECT_ENABLE | CMD_CMPL_INTR_ENABLE;
+					PRSN_DETECT_ENABLE;
 
 	temp_word = (temp_word & ~intr_enable) | intr_enable; 
 
@@ -1402,6 +1445,21 @@
 		goto abort_free_ctlr;
 	}
 	dbg("%s : Unmask HPIE hp_register_write_word SLOT_CTRL with %x\n", __FUNCTION__, temp_word);
+	rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS, slot_status);
+	if (rc) {
+		err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__);
+		goto abort_free_ctlr;
+	}
+	dbg("%s: Unmask HPIE SLOT_STATUS offset %x reads slot_status %x\n", __FUNCTION__, 
+		SLOT_STATUS, slot_status);
+	
+	temp_word =  0x1F; /* Clear all events */
+	rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS, temp_word);
+	if (rc) {
+		err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__);
+		goto abort_free_ctlr;
+	}
+	dbg("%s: SLOT_STATUS offset %x writes slot_status %x\n", __FUNCTION__, SLOT_STATUS, temp_word);
 	
 	/*  Add this HPC instance into the HPC list */
 	spin_lock(&list_lock);
diff -Nru a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
--- a/drivers/pci/hotplug/pciehp_pci.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/hotplug/pciehp_pci.c	Fri Apr  2 11:31:03 2004
@@ -192,7 +192,6 @@
 	for (device = FirstSupported; device <= LastSupported; device++) {
 		ID = 0xFFFFFFFF;
 		rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID);
-		dbg("%s: ID = %x\n", __FUNCTION__, ID);
 
 		if (ID != 0xFFFFFFFF) {	  /*  device in slot */
 			dbg("%s: ID = %x\n", __FUNCTION__, ID);
@@ -325,7 +324,6 @@
 			new_slot->presence_save = 0;
 			new_slot->switch_save = 0;
 		}
-		dbg("%s: End of For loop\n", __FUNCTION__);
 	} 			/* End of FOR loop */
 
 	dbg("%s: Exit\n", __FUNCTION__);
diff -Nru a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
--- a/drivers/pci/hotplug/rpaphp_pci.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/hotplug/rpaphp_pci.c	Fri Apr  2 11:31:03 2004
@@ -304,7 +304,6 @@
 	if (slot->hotplug_slot->info->adapter_status == NOT_VALID) {
 		dbg("%s: NOT_VALID: skip dn->full_name=%s\n",
 		    __FUNCTION__, slot->dn->full_name);
-		dealloc_slot_struct(slot);
 		return (-1);
 	}
 	return (0);
diff -Nru a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
--- a/drivers/pci/hotplug/shpchp_hpc.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/hotplug/shpchp_hpc.c	Fri Apr  2 11:31:03 2004
@@ -1441,6 +1441,7 @@
 			err("%s : shpc_cap_offset == 0\n", __FUNCTION__);
 			goto abort_free_ctlr;
 		}
+		dbg("%s: shpc_cap_offset = %x\n", __FUNCTION__, shpc_cap_offset);	
 	
 		rc = pci_write_config_byte(pdev, (u8)shpc_cap_offset + DWORD_SELECT , BASE_OFFSET);
 		if (rc) {
@@ -1547,15 +1548,13 @@
 		start_int_poll_timer( php_ctlr, 10 );   /* start with 10 second delay */
 	} else {
 		/* Installs the interrupt handler */
-#ifdef CONFIG_PCI_USE_VECTOR 
 		rc = pci_enable_msi(pdev);
 		if (rc) {
-			err("Can't get msi for the hotplug controller\n");
+			info("Can't get msi for the hotplug controller\n");
+			info("Use INTx for the hotplug controller\n");
 			dbg("%s: rc = %x\n", __FUNCTION__, rc);
-			goto abort_free_ctlr;
-		}
-		php_ctlr->irq = pdev->irq;
-#endif
+		} else
+			php_ctlr->irq = pdev->irq;
 		
 		rc = request_irq(php_ctlr->irq, shpc_isr, SA_SHIRQ, MY_NAME, (void *) ctrl);
 		dbg("%s: request_irq %d for hpc%d (returns %d)\n", __FUNCTION__, php_ctlr->irq, ctlr_seq_num, rc);
diff -Nru a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c
--- a/drivers/pci/hotplug/shpchprm_acpi.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/hotplug/shpchprm_acpi.c	Fri Apr  2 11:31:03 2004
@@ -1267,7 +1267,8 @@
 int shpchprm_print_pirt(void)
 {
 	dbg("SHPCHPRM ACPI Slots\n");
-	print_acpi_resources (acpi_bridges_head);
+	if (acpi_bridges_head)
+		print_acpi_resources (acpi_bridges_head);
 	return 0;
 }
 
diff -Nru a/drivers/pci/hotplug/shpchprm_legacy.c b/drivers/pci/hotplug/shpchprm_legacy.c
--- a/drivers/pci/hotplug/shpchprm_legacy.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/hotplug/shpchprm_legacy.c	Fri Apr  2 11:31:03 2004
@@ -96,23 +96,6 @@
 	return fp;
 }
 
-#if link_available
-/*
- *  Links available memory, IO, and IRQ resources for programming
- *  devices which may be added to the system
- *
- *  Returns 0 if success
- */
-static int
-link_available_resources (
-	struct controller *ctrl,
-	struct pci_func *func,
-	int index )
-{
-	return shpchp_save_used_resources (ctrl, func, !DISABLE_CARD);
-}
-#endif
-
 /*
  * shpchprm_find_available_resources
  *
@@ -345,19 +328,6 @@
 			}
 		}
 
-#if link_available
-		++index;
-
-		while (index < 8) {
-			if (((func = shpchp_slot_find(primary_bus, dev_func >> 3, index)) != NULL) && populated_slot)
-				rc = link_available_resources(ctrl, func, index);
-			
-			if (rc)
-				break;
-
-			++index;
-		}
-#endif
 		i--;
 		one_slot += sizeof(struct slot_rt);
 	}
diff -Nru a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
--- a/drivers/pci/pci-sysfs.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/pci-sysfs.c	Fri Apr  2 11:31:03 2004
@@ -1,8 +1,8 @@
 /*
  * drivers/pci/pci-sysfs.c
  *
- * (C) Copyright 2002 Greg Kroah-Hartman
- * (C) Copyright 2002 IBM Corp.
+ * (C) Copyright 2002-2004 Greg Kroah-Hartman <greg@kroah.com>
+ * (C) Copyright 2002-2004 IBM Corp.
  * (C) Copyright 2003 Matthew Wilcox
  * (C) Copyright 2003 Hewlett-Packard
  *
@@ -71,7 +71,7 @@
 
 	/* Several chips lock up trying to read undefined config space */
 	if (capable(CAP_SYS_ADMIN)) {
-		size = 256;
+		size = dev->cfg_size;
 	} else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
 		size = 128;
 	}
@@ -123,10 +123,10 @@
 	unsigned int size = count;
 	loff_t init_off = off;
 
-	if (off > 256)
+	if (off > dev->cfg_size)
 		return 0;
-	if (off + count > 256) {
-		size = 256 - off;
+	if (off + count > dev->cfg_size) {
+		size = dev->cfg_size - off;
 		count = size;
 	}
 
@@ -167,6 +167,17 @@
 	.write = pci_write_config,
 };
 
+static struct bin_attribute pcie_config_attr = {
+	.attr =	{
+		.name = "config",
+		.mode = S_IRUGO | S_IWUSR,
+		.owner = THIS_MODULE,
+	},
+	.size = 4096,
+	.read = pci_read_config,
+	.write = pci_write_config,
+};
+
 void pci_create_sysfs_dev_files (struct pci_dev *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -179,7 +190,11 @@
 	device_create_file (dev, &dev_attr_class);
 	device_create_file (dev, &dev_attr_irq);
 	device_create_file (dev, &dev_attr_resource);
-	sysfs_create_bin_file(&dev->kobj, &pci_config_attr);
+
+	if (pdev->cfg_size < 4096)
+		sysfs_create_bin_file(&dev->kobj, &pci_config_attr);
+	else
+		sysfs_create_bin_file(&dev->kobj, &pcie_config_attr);
 
 	/* add platform-specific attributes */
 	pcibios_add_platform_entries(pdev);
diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
--- a/drivers/pci/pci.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/pci.c	Fri Apr  2 11:31:03 2004
@@ -111,21 +111,15 @@
  * support it.  Possible values for @cap:
  *
  *  %PCI_CAP_ID_PM           Power Management 
- *
  *  %PCI_CAP_ID_AGP          Accelerated Graphics Port 
- *
  *  %PCI_CAP_ID_VPD          Vital Product Data 
- *
  *  %PCI_CAP_ID_SLOTID       Slot Identification 
- *
  *  %PCI_CAP_ID_MSI          Message Signalled Interrupts
- *
  *  %PCI_CAP_ID_CHSWP        CompactPCI HotSwap 
- *
  *  %PCI_CAP_ID_PCIX         PCI-X
+ *  %PCI_CAP_ID_EXP          PCI Express
  */
-int
-pci_find_capability(struct pci_dev *dev, int cap)
+int pci_find_capability(struct pci_dev *dev, int cap)
 {
 	return __pci_bus_find_cap(dev->bus, dev->devfn, dev->hdr_type, cap);
 }
@@ -153,6 +147,54 @@
 }
 
 /**
+ * pci_find_ext_capability - Find an extended capability
+ * @dev: PCI device to query
+ * @cap: capability code
+ *
+ * Returns the address of the requested extended capability structure
+ * within the device's PCI configuration space or 0 if the device does
+ * not support it.  Possible values for @cap:
+ *
+ *  %PCI_EXT_CAP_ID_ERR		Advanced Error Reporting
+ *  %PCI_EXT_CAP_ID_VC		Virtual Channel
+ *  %PCI_EXT_CAP_ID_DSN		Device Serial Number
+ *  %PCI_EXT_CAP_ID_PWR		Power Budgeting
+ */
+int pci_find_ext_capability(struct pci_dev *dev, int cap)
+{
+	u32 header;
+	int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
+	int pos = 0x100;
+
+	if (dev->cfg_size <= 256)
+		return 0;
+
+	if (pci_read_config_dword(dev, pos, &header) != PCIBIOS_SUCCESSFUL)
+		return 0;
+
+	/*
+	 * If we have no capabilities, this is indicated by cap ID,
+	 * cap version and next pointer all being 0.
+	 */
+	if (header == 0)
+		return 0;
+
+	while (ttl-- > 0) {
+		if (PCI_EXT_CAP_ID(header) == cap)
+			return pos;
+
+		pos = PCI_EXT_CAP_NEXT(header);
+		if (pos < 0x100)
+			break;
+
+		if (pci_read_config_dword(dev, pos, &header) != PCIBIOS_SUCCESSFUL)
+			break;
+	}
+
+	return 0;
+}
+
+/**
  * pci_find_parent_resource - return resource region of parent bus of given region
  * @dev: PCI device structure contains resources to be searched
  * @res: child resource record for which parent is sought
@@ -658,6 +700,10 @@
 	}
 }
 
+#ifndef HAVE_ARCH_PCI_SET_DMA_MASK
+/*
+ * These can be overridden by arch-specific implementations
+ */
 int
 pci_set_dma_mask(struct pci_dev *dev, u64 mask)
 {
@@ -690,6 +736,7 @@
 
 	return 0;
 }
+#endif
      
 static int __devinit pci_init(void)
 {
diff -Nru a/drivers/pci/pci.h b/drivers/pci/pci.h
--- a/drivers/pci/pci.h	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/pci.h	Fri Apr  2 11:31:03 2004
@@ -60,3 +60,5 @@
 
 /* Lock for read/write access to pci device and bus lists */
 extern spinlock_t pci_bus_lock;
+
+extern int pciehp_msi_quirk;
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/probe.c	Fri Apr  2 11:31:03 2004
@@ -18,6 +18,8 @@
 
 #define CARDBUS_LATENCY_TIMER	176	/* secondary latency timer */
 #define CARDBUS_RESERVE_BUSNR	3
+#define PCI_CFG_SPACE_SIZE	256
+#define PCI_CFG_SPACE_EXP_SIZE	4096
 
 /* Ugh.  Need to stop exporting this to modules. */
 LIST_HEAD(pci_root_buses);
@@ -530,6 +532,43 @@
 	kfree(pci_dev);
 }
 
+/**
+ * pci_cfg_space_size - get the configuration space size of the PCI device.
+ *
+ * Regular PCI devices have 256 bytes, but PCI-X 2 and PCI Express devices
+ * have 4096 bytes.  Even if the device is capable, that doesn't mean we can
+ * access it.  Maybe we don't have a way to generate extended config space
+ * accesses, or the device is behind a reverse Express bridge.  So we try
+ * reading the dword at 0x100 which must either be 0 or a valid extended
+ * capability header.
+ */
+static int pci_cfg_space_size(struct pci_dev *dev)
+{
+	int pos;
+	u32 status;
+
+	pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
+	if (!pos) {
+		pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
+		if (!pos)
+			goto fail;
+
+		pci_read_config_dword(dev, pos + PCI_X_STATUS, &status);
+		if (!(status & (PCI_X_STATUS_266MHZ | PCI_X_STATUS_533MHZ)))
+			goto fail;
+	}
+
+	if (pci_read_config_dword(dev, 256, &status) != PCIBIOS_SUCCESSFUL)
+		goto fail;
+	if (status == 0xffffffff)
+		goto fail;
+
+	return PCI_CFG_SPACE_EXP_SIZE;
+
+ fail:
+	return PCI_CFG_SPACE_SIZE;
+}
+
 /*
  * Read the config data for a PCI device, sanity-check it
  * and fill in the dev structure...
@@ -566,6 +605,7 @@
 	dev->multifunction = !!(hdr_type & 0x80);
 	dev->vendor = l & 0xffff;
 	dev->device = (l >> 16) & 0xffff;
+	dev->cfg_size = pci_cfg_space_size(dev);
 
 	/* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer)
 	   set this higher, assuming the system even supports it.  */
diff -Nru a/drivers/pci/proc.c b/drivers/pci/proc.c
--- a/drivers/pci/proc.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/proc.c	Fri Apr  2 11:31:03 2004
@@ -16,16 +16,15 @@
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
 
-#define PCI_CFG_SPACE_SIZE 256
-
 static int proc_initialized;	/* = 0 */
 
 static loff_t
 proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
 {
 	loff_t new = -1;
+	struct inode *inode = file->f_dentry->d_inode;
 
-	down(&file->f_dentry->d_inode->i_sem);
+	down(&inode->i_sem);
 	switch (whence) {
 	case 0:
 		new = off;
@@ -34,14 +33,14 @@
 		new = file->f_pos + off;
 		break;
 	case 2:
-		new = PCI_CFG_SPACE_SIZE + off;
+		new = inode->i_size + off;
 		break;
 	}
-	if (new < 0 || new > PCI_CFG_SPACE_SIZE)
+	if (new < 0 || new > inode->i_size)
 		new = -EINVAL;
 	else
 		file->f_pos = new;
-	up(&file->f_dentry->d_inode->i_sem);
+	up(&inode->i_sem);
 	return new;
 }
 
@@ -61,7 +60,7 @@
 	 */
 
 	if (capable(CAP_SYS_ADMIN))
-		size = PCI_CFG_SPACE_SIZE;
+		size = dev->cfg_size;
 	else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
 		size = 128;
 	else
@@ -134,14 +133,15 @@
 	const struct proc_dir_entry *dp = PDE(ino);
 	struct pci_dev *dev = dp->data;
 	int pos = *ppos;
+	int size = dev->cfg_size;
 	int cnt;
 
-	if (pos >= PCI_CFG_SPACE_SIZE)
+	if (pos >= size)
 		return 0;
-	if (nbytes >= PCI_CFG_SPACE_SIZE)
-		nbytes = PCI_CFG_SPACE_SIZE;
-	if (pos + nbytes > PCI_CFG_SPACE_SIZE)
-		nbytes = PCI_CFG_SPACE_SIZE - pos;
+	if (nbytes >= size)
+		nbytes = size;
+	if (pos + nbytes > size)
+		nbytes = size - pos;
 	cnt = nbytes;
 
 	if (!access_ok(VERIFY_READ, buf, cnt))
@@ -403,7 +403,7 @@
 		return -ENOMEM;
 	e->proc_fops = &proc_bus_pci_operations;
 	e->data = dev;
-	e->size = PCI_CFG_SPACE_SIZE;
+	e->size = dev->cfg_size;
 
 	return 0;
 }
diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c
--- a/drivers/pci/quirks.c	Fri Apr  2 11:31:03 2004
+++ b/drivers/pci/quirks.c	Fri Apr  2 11:31:03 2004
@@ -868,6 +868,13 @@
 }
 #endif /* CONFIG_SCSI_SATA */
 
+int pciehp_msi_quirk;
+
+static void __devinit quirk_pciehp_msi(struct pci_dev *pdev)
+{
+	pciehp_msi_quirk = 1;
+}
+
 /*
  *  The main table of quirks.
  *
@@ -984,6 +991,8 @@
 	  quirk_intel_ide_combined },
 #endif /* CONFIG_SCSI_SATA */
 
+	{ PCI_FIXUP_FINAL,      PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_SMCH,	quirk_pciehp_msi },
+
 	{ 0 }
 };
 
@@ -1008,3 +1017,5 @@
 	pci_do_fixups(dev, pass, pcibios_fixups);
 	pci_do_fixups(dev, pass, pci_fixups);
 }
+
+EXPORT_SYMBOL(pciehp_msi_quirk);
diff -Nru a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
--- a/include/linux/dma-mapping.h	Fri Apr  2 11:31:03 2004
+++ b/include/linux/dma-mapping.h	Fri Apr  2 11:31:03 2004
@@ -10,6 +10,9 @@
 	DMA_NONE = 3,
 };
 
+#define DMA_64BIT_MASK	0xffffffffffffffffULL
+#define DMA_32BIT_MASK	0x00000000ffffffffULL
+
 #include <asm/dma-mapping.h>
 
 /* Backwards compat, remove in 2.7.x */
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Fri Apr  2 11:31:03 2004
+++ b/include/linux/pci.h	Fri Apr  2 11:31:03 2004
@@ -305,18 +305,89 @@
 #define  PCI_X_CMD_ERO		0x0002	/* Enable Relaxed Ordering */
 #define  PCI_X_CMD_MAX_READ	0x000c	/* Max Memory Read Byte Count */
 #define  PCI_X_CMD_MAX_SPLIT	0x0070	/* Max Outstanding Split Transactions */
-#define PCI_X_DEVFN		4	/* A copy of devfn. */
-#define PCI_X_BUSNR		5	/* Bus segment number */
-#define PCI_X_STATUS		6	/* PCI-X capabilities */
-#define  PCI_X_STATUS_64BIT	0x0001	/* 64-bit device */
-#define  PCI_X_STATUS_133MHZ	0x0002	/* 133 MHz capable */
-#define  PCI_X_STATUS_SPL_DISC	0x0004	/* Split Completion Discarded */
-#define  PCI_X_STATUS_UNX_SPL	0x0008	/* Unexpected Split Completion */
-#define  PCI_X_STATUS_COMPLEX	0x0010	/* Device Complexity */
-#define  PCI_X_STATUS_MAX_READ	0x0060	/* Designed Maximum Memory Read Count */
-#define  PCI_X_STATUS_MAX_SPLIT	0x0380	/* Design Max Outstanding Split Trans */
-#define  PCI_X_STATUS_MAX_CUM	0x1c00	/* Designed Max Cumulative Read Size */
-#define  PCI_X_STATUS_SPL_ERR	0x2000	/* Rcvd Split Completion Error Msg */
+#define  PCI_X_CMD_VERSION(x) 	(((x) >> 12) & 3) /* Version */
+#define PCI_X_STATUS		4	/* PCI-X capabilities */
+#define  PCI_X_STATUS_DEVFN	0x000000ff	/* A copy of devfn */
+#define  PCI_X_STATUS_BUS	0x0000ff00	/* A copy of bus nr */
+#define  PCI_X_STATUS_64BIT	0x00010000	/* 64-bit device */
+#define  PCI_X_STATUS_133MHZ	0x00020000	/* 133 MHz capable */
+#define  PCI_X_STATUS_SPL_DISC	0x00040000	/* Split Completion Discarded */
+#define  PCI_X_STATUS_UNX_SPL	0x00080000	/* Unexpected Split Completion */
+#define  PCI_X_STATUS_COMPLEX	0x00100000	/* Device Complexity */
+#define  PCI_X_STATUS_MAX_READ	0x00600000	/* Designed Max Memory Read Count */
+#define  PCI_X_STATUS_MAX_SPLIT	0x03800000	/* Designed Max Outstanding Split Transactions */
+#define  PCI_X_STATUS_MAX_CUM	0x1c000000	/* Designed Max Cumulative Read Size */
+#define  PCI_X_STATUS_SPL_ERR	0x20000000	/* Rcvd Split Completion Error Msg */
+#define  PCI_X_STATUS_266MHZ	0x40000000	/* 266 MHz capable */
+#define  PCI_X_STATUS_533MHZ	0x80000000	/* 533 MHz capable */
+
+/* Extended Capabilities (PCI-X 2.0 and Express) */
+#define PCI_EXT_CAP_ID(header)		(header & 0x0000ffff)
+#define PCI_EXT_CAP_VER(header)		((header >> 16) & 0xf)
+#define PCI_EXT_CAP_NEXT(header)	((header >> 20) & 0xffc)
+
+#define PCI_EXT_CAP_ID_ERR	1
+#define PCI_EXT_CAP_ID_VC	2
+#define PCI_EXT_CAP_ID_DSN	3
+#define PCI_EXT_CAP_ID_PWR	4
+
+/* Advanced Error Reporting */
+#define PCI_ERR_UNCOR_STATUS	4	/* Uncorrectable Error Status */
+#define  PCI_ERR_UNC_TRAIN	0x00000001	/* Training */
+#define  PCI_ERR_UNC_DLP	0x00000010	/* Data Link Protocol */
+#define  PCI_ERR_UNC_POISON_TLP	0x00001000	/* Poisoned TLP */
+#define  PCI_ERR_UNC_FCP	0x00002000	/* Flow Control Protocol */
+#define  PCI_ERR_UNC_COMP_TIME	0x00004000	/* Completion Timeout */
+#define  PCI_ERR_UNC_COMP_ABORT	0x00008000	/* Completer Abort */
+#define  PCI_ERR_UNC_UNX_COMP	0x00010000	/* Unexpected Completion */
+#define  PCI_ERR_UNC_RX_OVER	0x00020000	/* Receiver Overflow */
+#define  PCI_ERR_UNC_MALF_TLP	0x00040000	/* Malformed TLP */
+#define  PCI_ERR_UNC_ECRC	0x00080000	/* ECRC Error Status */
+#define  PCI_ERR_UNC_UNSUP	0x00100000	/* Unsupported Request */
+#define PCI_ERR_UNCOR_MASK	8	/* Uncorrectable Error Mask */
+	/* Same bits as above */
+#define PCI_ERR_UNCOR_SEVER	12	/* Uncorrectable Error Severity */
+	/* Same bits as above */
+#define PCI_ERR_COR_STATUS	16	/* Correctable Error Status */
+#define  PCI_ERR_COR_RCVR	0x00000001	/* Receiver Error Status */
+#define  PCI_ERR_COR_BAD_TLP	0x00000040	/* Bad TLP Status */
+#define  PCI_ERR_COR_BAD_DLLP	0x00000080	/* Bad DLLP Status */
+#define  PCI_ERR_COR_REP_ROLL	0x00000100	/* REPLAY_NUM Rollover */
+#define  PCI_ERR_COR_REP_TIMER	0x00001000	/* Replay Timer Timeout */
+#define PCI_ERR_COR_MASK	20	/* Correctable Error Mask */
+	/* Same bits as above */
+#define PCI_ERR_CAP		24	/* Advanced Error Capabilities */
+#define  PCI_ERR_CAP_FEP(x)	((x) & 31)	/* First Error Pointer */
+#define  PCI_ERR_CAP_ECRC_GENC	0x00000020	/* ECRC Generation Capable */
+#define  PCI_ERR_CAP_ECRC_GENE	0x00000040	/* ECRC Generation Enable */
+#define  PCI_ERR_CAP_ECRC_CHKC	0x00000080	/* ECRC Check Capable */
+#define  PCI_ERR_CAP_ECRC_CHKE	0x00000100	/* ECRC Check Enable */
+#define PCI_ERR_HEADER_LOG	28	/* Header Log Register (16 bytes) */
+#define PCI_ERR_ROOT_COMMAND	44	/* Root Error Command */
+#define PCI_ERR_ROOT_STATUS	48
+#define PCI_ERR_ROOT_COR_SRC	52
+#define PCI_ERR_ROOT_SRC	54
+
+/* Virtual Channel */
+#define PCI_VC_PORT_REG1	4
+#define PCI_VC_PORT_REG2	8
+#define PCI_VC_PORT_CTRL	12
+#define PCI_VC_PORT_STATUS	14
+#define PCI_VC_RES_CAP		16
+#define PCI_VC_RES_CTRL		20
+#define PCI_VC_RES_STATUS	26
+
+/* Power Budgeting */
+#define PCI_PWR_DSR		4	/* Data Select Register */
+#define PCI_PWR_DATA		8	/* Data Register */
+#define  PCI_PWR_DATA_BASE(x)	((x) & 0xff)	    /* Base Power */
+#define  PCI_PWR_DATA_SCALE(x)	(((x) >> 8) & 3)    /* Data Scale */
+#define  PCI_PWR_DATA_PM_SUB(x)	(((x) >> 10) & 7)   /* PM Sub State */
+#define  PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
+#define  PCI_PWR_DATA_TYPE(x)	(((x) >> 15) & 7)   /* Type */
+#define  PCI_PWR_DATA_RAIL(x)	(((x) >> 18) & 7)   /* Power Rail */
+#define PCI_PWR_CAP		12	/* Capability */
+#define  PCI_PWR_CAP_BUDGET(x)	((x) & 1)	/* Included in system budget */
 
 /* Include the ID list */
 
@@ -403,6 +474,8 @@
 	unsigned short vendor_compatible[DEVICE_COUNT_COMPATIBLE];
 	unsigned short device_compatible[DEVICE_COUNT_COMPATIBLE];
 
+	int		cfg_size;	/* Size of configuration space */
+
 	/*
 	 * Instead of touching interrupt line and base address registers
 	 * directly, use the values stored here. They might be different!
@@ -602,6 +675,7 @@
 struct pci_dev *pci_find_class (unsigned int class, const struct pci_dev *from);
 struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
 int pci_find_capability (struct pci_dev *dev, int cap);
+int pci_find_ext_capability (struct pci_dev *dev, int cap);
 struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
 
 struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
@@ -768,6 +842,7 @@
 static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
 static inline void pci_unregister_driver(struct pci_driver *drv) { }
 static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
+static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
 static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
 
 /* Power management related routines */
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	Fri Apr  2 11:31:03 2004
+++ b/include/linux/pci_ids.h	Fri Apr  2 11:31:03 2004
@@ -2074,6 +2074,7 @@
 #define PCI_DEVICE_ID_INTEL_82830_CGC	0x3577
 #define PCI_DEVICE_ID_INTEL_82855GM_HB	0x3580
 #define PCI_DEVICE_ID_INTEL_82855GM_IG	0x3582
+#define PCI_DEVICE_ID_INTEL_SMCH	0x3590
 #define PCI_DEVICE_ID_INTEL_80310	0x530d
 #define PCI_DEVICE_ID_INTEL_82371SB_0	0x7000
 #define PCI_DEVICE_ID_INTEL_82371SB_1	0x7010