Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Loic Prylli
Date: Tuesday, January 15, 2008 - 9:00 am

On 1/14/2008 6:04 PM, Adrian Bunk wrote:


Why not put in 2.6.24 a simple fix for the last known remaining mmconfig 
problems in 2.6.24?  There has mostly been three bugs related to mmconfig:
- BIOS/hardware: exaggerated MCFG claims: solved long ago
- hardware: buggy CRS+mmconfig chipset: fix included last month
- Linux code: mmconfig incompatible with live BAR-probing: *not fixed*

It would be ironic to not fix the only one that is really confined to 
the Linux code.

Everybody more or less agrees *any* patches submitted so far does solve 
the known problems, and will not cause regressions. The only long 
discussion is about how to best prevent the effect of an "imaginary" 
fourth bug, and by nature that's a controversial topic.

For 2.6.24, if nothing more than a few lines can be done, either make 
pci=nommconf the default and add a pci=mmconf option, or/and apply one 
of the easiest patch to review i.e.Tony's one, so small I copy it again 
below (using 0x40 or 0x100 for the comparison does not really matter, 
personally I would change it to 0x100 to be like Ivan's patch, but 
either is much better than nothing). Replacing some mmconfig access by 
conf1 cannot cause any regression.


Loic


P.S.: with that patch, conf1-less x86 systems requiring mmconfig would 
not be supported. But they are like UFOs. They are plenty of them in the 
galaxy, but earth sightings are not convincing enough for 2.6.24 
support, they can wait 2.6.25.


diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
index 1bf5816..4474979 100644
--- a/arch/x86/pci/mmconfig_32.c
+++ b/arch/x86/pci/mmconfig_32.c
@@ -73,7 +73,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned 
int bus,
     }
 
     base = get_base_addr(seg, bus, devfn);
-    if (!base)
+    if ((!base) || (reg < 0x40))
         return pci_conf1_read(seg,bus,devfn,reg,len,value);
 
     spin_lock_irqsave(&pci_config_lock, flags);
@@ -106,7 +106,7 @@ static int pci_mmcfg_write(unsigned int seg, 
unsigned int bus,
         return -EINVAL;
 
     base = get_base_addr(seg, bus, devfn);
-    if (!base)
+    if ((!base) || (reg < 0x40))
         return pci_conf1_write(seg,bus,devfn,reg,len,value);
 
     spin_lock_irqsave(&pci_config_lock, flags);
diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
index 4095e4d..4ad1fcb 100644
--- a/arch/x86/pci/mmconfig_64.c
+++ b/arch/x86/pci/mmconfig_64.c
@@ -61,7 +61,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned 
int bus,
     }
 
     addr = pci_dev_base(seg, bus, devfn);
-    if (!addr)
+    if ((!addr) || (reg < 0x40))
         return pci_conf1_read(seg,bus,devfn,reg,len,value);
 
     switch (len) {
@@ -89,7 +89,7 @@ static int pci_mmcfg_write(unsigned int seg, unsigned 
int bus,
         return -EINVAL;
 
     addr = pci_dev_base(seg, bus, devfn);
-    if (!addr)
+    if ((!addr) || (reg < 0x40))
         return pci_conf1_write(seg,bus,devfn,reg,len,value);
 
     switch (len) {





--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Arjan van de Ven, (Fri Jan 11, 12:09 pm)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Arjan van de Ven, (Fri Jan 11, 12:40 pm)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Arjan van de Ven, (Fri Jan 11, 12:54 pm)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Arjan van de Ven, (Sat Jan 12, 10:45 am)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Benjamin Herrenschmidt, (Sun Jan 13, 12:08 am)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Arjan van de Ven, (Sun Jan 13, 10:01 am)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Arjan van de Ven, (Sun Jan 13, 10:03 am)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Arjan van de Ven, (Sun Jan 13, 11:41 am)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Arjan van de Ven, (Sun Jan 13, 10:05 pm)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Øyvind Vågen Jægtnes, (Tue Jan 15, 5:58 am)
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a ..., Loic Prylli, (Tue Jan 15, 9:00 am)
[PATCH] Change pci_raw_ops to pci_raw_read/write, Matthew Wilcox, (Mon Jan 28, 8:03 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Yinghai Lu, (Sun Feb 3, 12:30 am)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Tony Camuso, (Thu Feb 7, 8:54 am)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Arjan van de Ven, (Thu Feb 7, 9:28 am)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Tony Camuso, (Thu Feb 7, 9:36 am)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Grant Grundler, (Thu Feb 7, 7:28 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Matthew Wilcox, (Sat Feb 9, 5:41 am)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Yinghai Lu, (Sat Feb 9, 11:25 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Matthew Wilcox, (Sun Feb 10, 7:51 am)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Grant Grundler, (Sun Feb 10, 12:13 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Matthew Wilcox, (Sun Feb 10, 12:37 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Yinghai Lu, (Sun Feb 10, 1:16 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Matthew Wilcox, (Sun Feb 10, 1:19 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Linus Torvalds, (Sun Feb 10, 1:24 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Yinghai Lu, (Sun Feb 10, 1:25 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Matthew Wilcox, (Sun Feb 10, 1:32 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Matthew Wilcox, (Sun Feb 10, 1:45 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Yinghai Lu, (Sun Feb 10, 1:47 pm)
raw_pci_read in quirk_intel_irqbalance, Matthew Wilcox, (Sun Feb 10, 4:02 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Yinghai Lu, (Sun Feb 10, 6:49 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Robert Hancock, (Sun Feb 10, 7:53 pm)
Re: raw_pci_read in quirk_intel_irqbalance, Matthew Wilcox, (Sun Feb 10, 10:04 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Yinghai Lu, (Sun Feb 10, 10:59 pm)
Re: raw_pci_read in quirk_intel_irqbalance, Grant Grundler, (Mon Feb 11, 12:49 am)
Re: raw_pci_read in quirk_intel_irqbalance, Matthew Wilcox, (Mon Feb 11, 9:15 am)
Re: raw_pci_read in quirk_intel_irqbalance, Linus Torvalds, (Mon Feb 11, 10:18 am)
Re: raw_pci_read in quirk_intel_irqbalance, Grant Grundler, (Mon Feb 11, 12:38 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Andrew Morton, (Mon Feb 11, 3:10 pm)
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write, Ingo Molnar, (Mon Feb 11, 3:38 pm)